Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

SCXI Sample rate changes when VI run as SubVI

I have a VI which acquires 7 channels of data from SCXI-1100 module and places the data into a global variable. The VI runs fine on it's own but once it is used as a SubVI the performance drops.
0 Kudos
Message 1 of 2
(2,724 Views)
Hello Andy,

Using global variables might be the culprit here. You have to consider that for every read of a local or global variable in a VI or its subVIs, a copy of the data is made in memory. Each instance of a local or global variable will therefore make a copy of the data in memory.

So if you are reading from this global in a loop, this could be slowing down your CPU and program. I would suggest to just create an output of the SubVI that could pass the data from the SubVI to the main VI. This should help the efficiency of your program.

Does Reading a Local and Global Variable Create a Copy of the Data in Memory?
http://digital.ni.com/public.nsf/websearch/37002ACC84B961CA86256D9C00760EE2?OpenDocument

I hope this helps. Let me know if you have any add
itional questions.

Regards,

Todd D.
NI Applications Engineer
0 Kudos
Message 2 of 2
(2,724 Views)