The 220VAC lamp can be controlled in toogle mode by virtual and physical input as follows: Touch button is connected to Arduino plus RS485 shield and send the command to PLC S7-300 via Profibus-DP ...
#define SAP_SET_SLAVE_ADR 55 // Master sets slave address, slave responds with SC #define SAP_RD_INP 56 // Master requests input data, slave sends input data #define SAP_RD_OUTP 57 // Master requests ...