How do we create Function Blocks that modify global variables that can operate at the same time with a Main Program running that is written in Structured Text. Is there any documentation to show that linkage? Thanks in advance for any assistance.
is Opta a multitasking processor?
The Opta, like most PLCs, has a Task Manager that groups POUs (Program Organization Units) into Fast, Slow Background and Init Tasks. The Frequency in which the Fast POUs are initiated is configurable in milliseconds. Each POU is executed once per period and several POUs can be executed sequentially in each period. The other Tasks: Slow, Background and Init(ialization) have fixed periods. So yes it has a fixed logic multi-tasking capability.
OK, to Link Function Block POUs with a Structured Text POU with the Arduino PLC IDE and the OPTA do the following:
Create the Structured Text POU with Project_NewObject_NewProgram
Select the ST Language
Assign it to the Fast Task
Create a new Function Block POU with Project_NewObject_NewProgram
Select the FBD Language
Assign it to the Fast Task
Use Global Variables for the Input and Output wiring of the Function Block POUs
The Global Variables are fully readable/writeable by the Structured Text POU
Enjoy. JMc