I would like to have separate PLCIO applications listen for messages from separate Allen-Bradley PLCs. How can I do that on the same server?
Only one process can listen on the same TCP/IP port per server. Given that, there are two ways to work around this restriction: First, you can write a separate PLCIO application that listens for all incoming PLC messages. Based on the message contents or source IP Address, you can then forward the message to the correct process using conventional means (socket or pipe communication). Unfortunately, your original two processes are no longer communicating via PLCIO and extra work is required to send a reply back to the PLC. The other approach is to enable IP Address aliasing on your server. If you configure the server’s network interface to have multiple IP Addresses, then each process can listen on the same TCP/IP port but also on a different IP Address. It is then up to the PLC to send the message to the correct IP Address destination. To listen on a single IP Address in PLCIO, set the j_plcio_ipaddr global variable prior to your plc_open() call.