LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP Addressing Issues

The main board is made by a small Korean company who don't reply and nor have any documentation. There are no more details in regards to the inner workings of the main board besides what I have already mentioned. I know it is possible to communicate with this device as I have partially done it and a coworker has done it with python, see attached python code.

 

I am able to individually ping and receive a response from all the channels 1-6 (201-206). As a sanity check when I cut power to an individual driver, I do not receive a response when I attempt to ping it.

 

 

0 Kudos
Message 11 of 15
(482 Views)

Remove the address-input to the listen. it does not what you think it does. You are supposed to build up a listener who waits for connections. This Listener should keep running and wait for new connections, For that you need to abandon the current Listener vi and use the nodes inside directly.

Call Create Listener then go in a loop and call Wait on Listener. When it returns without error, push the returned connection AND the address it returns into a queue. Have a second loop which deques these new connections and stores them in an array of connections in a shift register together with the address.

Now when you want to send data to one of the display endpoints you have to search the right connection in that array based on the address/port number, grab its connection and send data to it

Bonus points for searching in that array for an existing connection with the same address whenever a new connection arrives and replacing it instead of adding it and closing the old connection.

If you use LabVIEW 2019 or newer you can make it a lot easier by replacing the queue between the loops and array inside the loop through a Map. Use the address/port as key into the map.

I do recommend to use LabVIEW 2020 if you want to use Maps or Sets. There were some nasty errors before.

Rolf Kalbermatter
Averna BV
Message 12 of 15
(472 Views)

OK, so if I correctly understand, this "board" is actually inside your computer and creates several IP addresses visible to the OS (192.168.200.200 for the local IP and 192.168.200.201..206). All these are fixed, not configurable, and independent of any other networking interface on this PC (e.g. WIFI, RJ45, etc.). There is no external networking involved. (Up to now I thought that this "board" is an external device connected via e.g. cat5 cable). How is it connected? Do you have a picture?

 

This board apparently implements a convoluted scheme where you need to create a listener on 192.168.200.200 and all active devices at the higher IP addresses will each automatically try open a TCP connection to it, then wait on these connections for commands. Only the listener writes to the connection, but never reads data.

 

I assume once each connection is established, you want to keep it open, i.e. not close it immediately after sending a command, but who knows? My Python is not good enough to really read the code.

 

Please correct me if I am wrong. Is this a common architecture?

 

In any case, follow Rolf's ideas and you should be OK.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 13 of 15
(448 Views)

This is a bit of a quick and dirty setup about what I was explaining earlier. It shows the principle but is certainly not a finished application. Error handling should be more elaborate, and your communication is likely going to be different in the end, but this creates the listener, receives the connections and puts them into a map from where you can then handle them.

 

TCPIP Communication.png

Rolf Kalbermatter
Averna BV
Message 14 of 15
(434 Views)

Sorry, adding nothing technical here, but when I see Rolf post like this, this immediately springs to mind:

 

Please excuse the crudity of this model... I didn't have time to build it to scale or paint itPlease excuse the crudity of this model... I didn't have time to build it to scale or paint it

 

"Please excuse the crudity of this model.  I didn't have time to build it to scale or paint it."

 

Best regards,

 

Dave

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
Message 15 of 15
(411 Views)