LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time values from DAQ SubVI don't change when there are many shared variables.

Those shared variables are all single processes.

 

My coworker's program reads from and writes to a lot of single process shared variables in several threads.

 

He said that when there were a few of such variables, time values from DAQ reflects the current time, but when there were a lot of them, time values didn't change as time went.

 

DAQ SubVI and shared variables don't interact, but shared variables somehow affect DAQ time reading.

 

What is the problem?

0 Kudos
Message 1 of 2
(2,468 Views)

From what I understand your using shared variables to share data between several threads/loops in LabVIEW.  Shared variables might not be the best way to accomplish that within the same VI, since there is a lot of overhead/processing required for each of them.  If you have a lot of single process shared variables, I would suggest you look at modifying your programs architecture. (http://www.ni.com/white-paper/7605/en)  

 

Since shared variables are like global variables, I would reccomend actually using wires when possible, and local variables as nessecary.

 

Now, with that, I'm confused about the relation between your DAQ and the current time.  What DAQ are you using?  Is the DAQ aquiring the time?  Are you using the timestamp on the shared variable?

 

Your DAQ system can only aquire data and process if you give it adequate time, it sounds like the processing overhead of the shared variables is starving your DAQ tasks/threads.  

 

More on Shared Variables:

https://www.ni.com/en/support/documentation/supplemental/06/using-the-labview-shared-variable.html

Systems Engineer
SISU
0 Kudos
Message 2 of 2
(2,445 Views)