Add “Part Number” to “Temp” in OB1, then add the four Inputs from the Tag Table to the Input side of Function Block, and finally add “Part Number” to the Output side of the Function Block: Image By Chris Wright Step 7) Now create a watch table and name it ‘Part Numbers'. This will create an “Instance Data Block” (IDB). It will also display the Part Number that was selected, and if no part is selected the output will display ‘No Part': Image By Chris Wright Step 6) Now we need to add the “Part Reference” FB1 to the OB1 Main Routine. This logic will convert the Byte to Int, and then select the part number based on the inputs. The Inputs will write to the first 4 Bits of the Byte “Input Code,” and are addressed as #”Input Code”.%X0 thru %X3 as shown below: Image By Chris Wright Step 5) Next, we'll add an “SCL Network” to the Function Block. ‘Programs' in the static section needs “Retain” to be “Set in IDB.” “Programs” is an Array 0…15 with a max string length of 15: Image By Chris Wright Step 4) Now we will add the first Logic to the FB.
![siemens step 7 write to string siemens step 7 write to string](http://www.plcdev.com/files/plcdev/images/s7-lite-editor.png)
These will be wired into our PLC as inputs, and therefore we need to add them to our PLC's tag table: Image By Chris Wright Step 2) Now that we've added our Input Tags, we'll next add a new Function Block to the program named “Part Reference”: Image By Chris Wright Step 3) In this step we will add the data to the FB that will be used to “select” the part number of the product being made. Step 1) In this example we have four outputs on our machine that tells us which product is being made.
![siemens step 7 write to string siemens step 7 write to string](https://ca.atevatech.com/wp-content/uploads/sites/3/2019/03/exporter_en.jpg)
Siemens step 7 write to string how to#
Do you have a machine that you need to get data from? And do you need to send that data to another device but the machine lacks networking capabilities? In this article I'll show how to get data a your machine into a Siemens S7-1214C PLC by using the machine's existing outputs to select which data the PLC will make available over your network.