08-27-2014 03:48 PM
Hi, so I'm planning on creating a remote VI using shared variables. The scope of this project is kind of a network where a user (PC1) connects to a kiosk (PC2) which connects to devices (PC3). The VI would preferably run only on PC2. Now I was able to do this using shared variables but a question came up. What if multiple users (multiple PC1s) use the VI at the same time? Would the data stored in the variable grab data from whoever used it last?
For example: if I have a VI that multiplies A and B and outputs it to C, and I chose 3 for A and 5 for B but another user uses 10 for A and 20 for B (assume all A, B, and C are shared variables) what would C show to me and the other user?
08-27-2014 03:59 PM
08-27-2014 04:03 PM
Dennis_Knutson,
Thanks for the reply. Can you elaborate? Does that mean that it will only take the recent value? If so, do you have any suggestions on how I might be able to implement this "network"?
Thanks.
08-27-2014 04:05 PM - edited 08-27-2014 04:12 PM
You Need a Server-Client Structure. Data resides in 1 place. The Server. And each client can read data from the server and then also change the data on the server. Each client then reads the new updated values from the server. How your sever updates the data to the client can be any method of communications. Network variables, TCP, UDP, ect., The connection limitations to the server and data output is the only limitation to the number of clients and performance. Network Variables seams to have a lot of overhead and would be hard to determine who actually changed a variable.
08-27-2014 04:09 PM
Dave_Brandt
Wouldn't network variables run into the same problem as shared variables? My server also needs to connect to multiple computers that are connected to multiple devices (PC3, see first post).
08-27-2014 04:24 PM
08-27-2014 04:26 PM
If you used udp multicast or broadcast you could publish data from each source and that would make data available to all clients. This would give great streaming ability and the lowest network traffic. There can be missed data because this is a connectionless protocol. Make sure you put a send counter in your udp data to be able to check quality. This increments each time you send data out. You can also create network problems if you send to much data out. Also how critical is timing and jitter?
08-27-2014 11:37 PM
Yes, shared variables will just take the last value written so I wouldn't really recommend them here.
It sounds to me like the RT sample projects might work well for you. Basically it has a single network connection for doing commands (update value X, configure Y), but then shared variables to pass read-only values back to any number of clients (if I remember correctly, the sample code just sends back CPU usage and memory but you could do other stuff).