04-11-2006 10:32 AM
04-12-2006 01:58 AM
04-12-2006 05:37 AM
I did not used shared variables yet, but before this functionality existed (and still now
), I simply created communication between both system using tcp or udp sockets. This is not so complicated in LabVIEW and would also allow having clients written in other languages and/or running on other OS.
In your case I would suggest TCP buffered transmission from RT to PC (allowing log of all data without loss) and single point transfer from PC to RT for variable update.
04-13-2006 12:18 AM
Sima,
It is strongly recommended to not use networked shared variables (or anything else networking related) in the time critical loop. When you have any shared resource in the time critical loop (TCL) and the TCL is accessing that resource, nothing else can get to it, including the shared variable engine to rebroadcast the data over the network. What is probably happening is that your TCL is "blocking" access to the shared variable while it is reading and writing to it, and preventing other threads from getting to in a timely matter. Also, adding a network shared variable to a TCL will effectively destroy its determinism because TCP/IP communications are inherently non-deterministic.
To fix this, if you are using the shared variable to store values between loop iterations, I would instead use a RT FIFO shared variable to bring data in and out of the TCL, and the in a separate non deterministic loop, write the data to a networked shared a variable.
Hope this helps,
04-13-2006 09:13 AM
04-14-2006 04:07 PM
04-15-2006 05:19 AM
Yeah, I'm aware of that. I just didn't think there would be such a large jump - about an extra 60% when we changed the loop time from 100ms to 10ms. That pushes the CPU usage up close to 100%, which seemed like too much for just that test VI running. Knocking down the size of the array to about 1000 elements helped, as did making the shared variable FIFO single process. The network communication for a network-published shared variable eats up a good deal of both CPU usage and time. A couple of NI application engineers I've spoken to seem to think that reading and writing to a networked shared variable that fast (1ms) is possible, but some others don't and I'm leaning towards the latter 🙂 I think as Paul mentioned, we should have a second loop to transfer data across the network.
I'm interested to know how other people developed their applications for high-speed data acquisition and logging, particularly across a network.