My client has an instrument which communicates via TCP for command and control, but sends data samples via UDP to the host computer.
The machine can be configured to communicate to port X, via some sort of keypad interface (probably with an umpteen-level menu system).
There is a factory default value for X.
So I open a UDP socket on port X, and read data from it, all is well.
Now the client wants the ability to have TWO of these machines attached (occasionally - the second one won't be permanent).
I could tell them to configure the instrument to send on port X+10, then I could open a second socket on port X+10, and read from it - I'm pretty sure that would work.
--- BUT ---
That would mean that when they borrow the primary instrument from one test cell to use as the 2nd machine in another, they have to re-configure it.
Is there a way to avoid that?
Looking at the UDP Read function, there is a PORT output (the sending port) and an ADDRESS output (the sending address).
If both instruments are sending to the same PORT on the host, can I use a single UDP READ to listen for data, and use the ADDRESS output to determine where it came from?
Will I get a batch from machine 1 (address 1), then a batch from machine 2 (address 2), or is the data going to be jumbled and mixed together?
If I could separate it cleanly, then they wouldn't have to re-configure the machine when they moved it. But I don't know enough about UDP to answer this, and I don't have even one of these ($$$$$) machines to test, let alone two.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com
Blog for (mostly LabVIEW) programmers: Tips And Tricks