LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use Single Process shared variable for control AND loging

Solved!
Go to solution

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.

 Question_1.PNG

 

Best wishes,

Lysandros

 



0 Kudos
Message 1 of 3
(2,218 Views)
Solution
Accepted by topic author Lysandros

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(2,194 Views)

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?

Best regards

Lysandros



0 Kudos
Message 3 of 3
(2,172 Views)