The demo covers a small automation achieved by a Cosino board equipped with a SoftPLC runtime system.
Once activated, the SoftPLC communicates with a couple of Z-Wave devices available on the market and with a IOs module which is connected with a RS485 serial communication interface with the MODBUS-RTU protocol.
The automation with Cosino consists of acquiring the status of a Z-Wave motion sensor and forwarding it to the IOs module through MODBUS protocol, which activates the buzzer and the lamp for the duration of activation of the sensor. In the opposite direction, the state of a button connected to the IOs module is acquired and forwarded to the Z-Wave switch, which turns on a fan. The duration of the fan activation, after pressing the button on the IOs module is extended to 10s by the SoftPLC.
The SoftPLC programming system consists of a SW tool for your PC that allows you to edit a diagram in the IEC61131-3 FDB language, compile it the program and download it to Cosino.
The program runs every 2 seconds the following sequence:
- acquisiton of the status of the button, through the activation of a function block which reads from MODBUS protocol.
- acquisiton of the status of the motion detector, through the activation of a function block which reads from zWave protocol.
- processing of the aquired data
- sending the new status to the RIO for driving the buzzer and lamp, through the activation of a function block which writes to MODBUS RTU protocol.
- sending the new status to the Z-Wave bynary switch, through the activation of a function block which writes to Z-Wave protocol.
Any other protocol can be easily added in the future to the SoftPLC system in order to interface different sensors and actuators.