The program is divided into 3 actions and is created in programming language CFC (Continuous Function Chart). All actions will be called on each program execution.
By the program code in this action, the status word of the device is read via Modbus SL using the FB READ_VAR
.
The Modbus communication is managed internally with the variable GVL.wModbusToken
. The token coordinates the execution of all Modbus function blocks configured in the project. The token is being reserved by the active Modbus function block until the Modbus operation has been completed. If the read process of the status word is possible, the variable GVL.wModbusToken will be reserved (the slave address is written on it), until the request is completed.
The value of the status word is assigned to the corresponding variables which have been declared in the associated GVL.
By the program code in this action, the motor control FB is called.
Implemented features are:
Mapping of the manual commands to the control word.
FB instance (MOT1D1S) call with assigned parameters.
Extracting of the status word (detailed alarm and alert information) to boolean variables.
By the program code in this action the control word of the device is written via Modbus SL using the FB WRITE_VAR.
The Modbus communication is managed internally with the variable GVL.wModbusToken
. The token controls execution of all Modbus function blocks configured in the project. The token is being reserved by the active Modbus function block until the Modbus operation has been completed. If the write process of the control word is possible, the GVL.wModbusToken will be reserved (the slave address is written on it) until the request is completed.