LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for an efficient way of passing references from array to multiple DAQ functions

I am working with the measurement and calibration toolkit to acquire data. The way data acquisition works with M&C toolkit is that after establishing a connection with the device you feed the DAQ Initialize.vi with an event name and an array of signal names that need to be acquired. The device recognizes the signal names and event name and then the acquisiton could start in a while loop. I'm going to name the combination of an event name and an array of signal names a DAQList for simplification. I am reading DAQLists from a file and I have 199 of those, so I am iterating through the DAQ Lists to initialize the data acquisition and later I am passing the array of references to a while, where the acquisiton should take place. The issue I'm having is that I need to index the array of references and use the MC DAQ Read.vi function 199 times in order to acquire data, which I believe is not the best way of to do that. Any suggestions how to do that in a better way?

P.S. As far as I know the toolkit doesn't provide a way of incorporating multiple DAQ Lists.

0 Kudos
Message 1 of 5
(886 Views)

I don't understand the terms "array of references" and "references from array". Too ambiguous. Can you show us some code instead?

0 Kudos
Message 2 of 5
(867 Views)

 

Hi altenbach,

I added a screenshot of my code, I meant the references passed between the M&C Toolkit VIs. I hope that makes it clear now.

 

AmrLV_0-1658525181842.png

 

0 Kudos
Message 3 of 5
(829 Views)

 

I am not familiar with these MC DAQ "references" or "lists". Do you have a link to the manual?

 

Sorry, a truncated picture is pretty useless! Still, your image raises a lot of questions....

 

  • Why are you wiring N when also autoindexing?
  • Why do you use delete from array in a shift register instead of autoindexing on the second pink array?
  • Why is the "mode" control inside the loop? Is it allowed to be changed during the loop? (If not, it belongs before the loop!)
  • If you only have 199 elements, the element at index 199 does not even exist (valid indices are 0..198 unless you actually have 200 elements)..
  • Are you really planning to have 199 array indicators for raw and scaled values? How is this supposed to look like to the operator?
  • Why can't you just autoindex on the array in the second loop?
0 Kudos
Message 4 of 5
(818 Views)

Hi altenbach,

I relied on your remarks and solved most of the issues that I had with my code. Currently I'm having the problem that when I run the for loop for initialzing the DAQ list. I'm getting an array of references that are all equal. When I run the MC DAQ initialize in parallel without a for loop I get unique reference from each function. I tried enabling iteration parallelism hoping that it might solve my problem but it unfortunately didn't. I attached the VI for DAQ Initialization "DAQ Init" and VI where I initalize the DAQ Lists in parallel w/o a for loop "DAQ Parallel". What is the difference between the two implementations that is making the results different in your opinion?

Here is the user manual for the toolkit: https://www.ni.com/docs/en-US/bundle/371601p/page/download.html

Download All
0 Kudos
Message 5 of 5
(767 Views)