Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How Siemens plc quickly assigns variables to fb block
How Siemens plc quickly assigns variables to fb block
Siemens plc quickly assigns variables to fb block, as shown below:

1. Create a function block fb 1 to convert "integer" variables into "real" variables.

2. Open the function block fb 1.

3. Add entry parameter, exit parameter and static variable entry parameter = ino-> in the function block fb 1; Integer (int) exportparameter = out1-> real static variable = stat2->; Integer (INT) local variable = = temp3->; Long integer (DINT).

4. Create the background data block DB2.

5. Open the DB2 background data block, and you can see that the system has established three data INO->; Entry parameter (integer) out1->; Derived parameter (real type) STAT2->; Static variable (integer).

6. Open the fb 1 function block and write the following code to realize the conversion from "integer" variable to "real" variable, and at the same time write a static variable self-adding 1 code.

7. Open the OB 1 main program and add the fb 1 function block. Determine the block number of the program parameter type and send it to fb.