Jump to content

Unistream USC-B5-T42 TCP Client communication with multiple IP addresses devices with same port number


SASA

Recommended Posts

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

Link to comment
Share on other sites

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.

1.png.9f2ce4e0335a23eb97a7e42d836baa03.png

2.png.50147ebbf19a0a8a90616ae2097f2da6.png

 

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!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...