07-10-2018 12:23 AM
Hello,
I am starting to wonder, if I should use UDP in future projects instead shared variable library.
I inherited a cRIO project with a shared variable library. Each time I create a new variable and add it to the library its pretty painful. How it makes its way from the cRIO to the PC. With UDP, I could just send another variable to another port. I am only sending every 0.5 - 1 second. The only thing that has to be on the dot is the logging, so the timestamp does not get messed up. Downside of the UDP, each receiver can only handle 248 byte, but most of the things I am sending / receiving is less. Plus I have to make sure, nothing else uses the ports in question. Other than that I can have 100s of ports as an address. The overall code would be simpler, too.
07-10-2018 01:40 AM
Hi Steffen,
Each time I create a new variable and add it to the library its pretty painful.
Yes. It can be PITA…
Downside of the UDP, each receiver can only handle 248 byte,
UDP can handle 548 bytes by default.
Plus I have to make sure, nothing else uses the ports in question.
You can implement a "search for free ports" feature…
General hints:
- Most implementations (search VIPM!) for sending messages over the network (like STM) use UDP (or TCP).
- DCAF also uses UDP (as I have heard at the last DevelopersDay).
- I also prefer UDP to communicate with my cRIO devices or to have communication between several measurement setups in one testbench…
07-10-2018 01:53 AM
worst case I transfer 110 or so double, this would still be in scope.
There are several vis I have to update each time I create another shared variable, some that create the strings for the variable adresses. I think its recommended to have maximum about 100 variables. Any new variable I guess I will use UDP.
I made a second vi on the PC host that pretty much just records things. The main vi runs the testrig. So I will just observe that 2nd vi how stable it is. And maybe over time I replace things in the main vi.