I’m trying to write a simple program that sends the status of digital inputs out to the serial line. My need is to manage 48 digital inputs using 3 PCB124*000 modules connected to a SlimLine CPU module.
The request is to send a string, out to the serial port (9600, n, 8, 1), every time one of the inputs changes its state. The string must contains the status of all the inputs. As example the strings can be like these:
*010000000000000000000000000000000000000000000000# //Digital inp01 is On
*010000001000000000000000000000000000000000000000# //Digital inp01 and 08 are On
*000000000000000000000000000000000000000000000000# //All digital inputs are Off
Can someone help me ?