Dear NI friends,
I use a real-time application (see attachment) with various VIs running in parallel on a PXI target.
In the Controlling.vi, sensor data are captured and simultaneously actuators are commanded both inside a Timed Loop. Also a Networking.vi is used for interaction with the user, e.g. chart monitoring and update of control setpoints. This vi communicates with the controlling.vi via single-process shared variables and with the user interface via network-published shared variables.
A third, Logging.vi is used for logging data and saving them on the PXI. After the test I can load the text file onto the host pc. My question is how should I log variables that are already used in the controlling.vi. Should I use a separate single process shared variable and basically capture the data twice or can I read the same variables that are used for communication with the networking.vi? I am not sure if conflicts can arise due to the fact that one variable will be read from two separate VIs simultaneously.
Solved! Go to Solution.
You can just read the same variable. Just make sure only 1 place is ever writing to that variable.
Personally, I would use a Queue to send the data to the logging loop.
Thanks for the quick reply. I did not mention that I also need the acquisition timestamp for each variable. If I enable timestamping, will this time be the acquisition time or the instant I call the variable again inside the logging.vi?