SASA Posted February 29 Report Share Posted February 29 Dear colleagues, I‘ve project where I need to control two industrial ink-jet printers with UNISTREAM USC-B5-T42. By control I mean sending printing data and listening their reply using TCP Client functionality. In my PLC program I’m activating TCP Client Connect (see picture) with the same TCP Client1, and with different SERVER IP addresses but this isn’t working as I thought it would. I can’t communicate with both printers at the same time which is crucial for this project. I need to receive data from both when they are finished printing the message. Is it possible to use same PORT with two different IP addresses? I did the same project several years ago with the V570 PLC and I could use same PORT NUMBER with different IP addresses for two printers. We are distributors of LINX Printing Technologies (UK) and their industrial printers uses fixed PORT NUMBER = 29043. Regards! 27_02_24_IPM_PILA_BCD.ulpr Quote Link to comment Share on other sites More sharing options...
kvlada Posted March 5 Report Share Posted March 5 Hi! One TCP client can connect to only one host at the same time. In program function "TCP_IP" you're calling TCP Client Connect function twice for two different IP addresses on a single client. This cannot work. You can try one of the following: 1. Create two TCP Clients, give them some random but different address in configuration. Later when connecting, call function as usual but on two different clients. I'm not sure if this will work, but it's worth trying. 2. Use only one TCP client, but switch IP addresses. For example: connect to first printer, when connected do data transfer, then disconnect, and connect to second printer, do data communication, disconnect, and so on. 3. Switch to UDP instead of TCP. Communication over UDP socket is similar to serial port, there is no connecting and disconnecting. Also: I've noticed you have put TCP Client Rx function but not Parse Message function, which would parse the received bytes in the buffer into a message defined in Message Composer. Parse Message function should be triggered on "Data Arrived" bit. Hope this helps! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.