Import and use the FB_RobCo_Controller
Imports the .scl file as an external source, generates the function block from it,
and wires it up in your PLC program. The FB must be compiled, and any user
modifications can be made directly in the SCL editor in TIA Portal.
For what the block does, see Function Block.
Steps
- In the Project Tree, go to
External source files - Click on
Add new external fileand open the file - The file is now under
External source files. Right-click on it and selectGenerate blocks from source. TIA Portal will parse the file and generate the FB underProgram blocks. - Right-click
FB_RobCo_ControllerinProgram blocksand selectCompile. You can now insert the function block into your cyclic OB (e.g.Main [OB1]) or use it in your user program. - Go to
PLC tags/Default tag tableand create two tags per physical Robot instance, one for the input values and one for the output values. For example:robot_1_inof typeRobCo_Inputwith the first input bit of the attached Profinet device (typically%I68.0if no other device is attached).robot_1_outof typeRobCo_Outputwith the first output bit (typically%Q64.0if no other device is attached).
- Go to your inserted RobCo function block and set the
hwInputfield asrobot_1_inand thehwOutputasrobot_1_out.
warning
Never touch the content of the .scl function block. Always add custom logic to
additional function blocks.
Related
- Data Fields and Address Offsets — what sits behind
RobCo_InputandRobCo_Output. - Update Profinet Variables — the FB must be recompiled after a Variable change.