2.2 Connecting the inputs and outputs in the control algorithm
The inputs and outputs of the driver must be interconnected with the individual tasks (.mdl files). The individual tasks (QTASK or TASK blocks) are connected to the QTask, Level0,…, Level3 outputs of the main EXEC block. Use the blocks depicted in Fig. 2.2 to interchange data between the control algorithm and the MbDrv driver.
Figure 2.3 shows an example of a PID control loop with one input (temperature) and one output (power) signal provided by the MbDrv driver.
The From block allowing the user to read one input signal has the Goto tag set to MTM__temperature. The Goto block allowing the user to set one output signal has the Goto tag set to MTM__power. The blocks always have the MTM prefix right at the beginning of the tag followed by two __ underscore. The blocks with multiple inputs/outputs have this prefix directly in their name.
The use of multi-input/output blocks is recommended if data exchange rate (sampling frequency) is the priority. See the function block reference manual [3] for details about INOCT, OUTOCT, INHEXD, OUTHEXD blocks.
Example project with input and output flags for the MbDrv driver are prepared by default
in the folder
C:\Program Files (x86)\REX Controls\REX <_version>_\Examples\Modbus_examples\00_IO_Flags.
[Previous] [Back to top] [Up]