LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Opinion: best method of DAQ with multiple cards for set duration

Hi
 
I am trying to produce the most efficient DAQ labview program for multiple cards (in this case two) for a set duration or for a manual stop and to collect this data (I would imagine that collecting it in a file is the best bet)
 
I just wondered what you r thoughts were on this vi and if there are better methods to tweak this if I want to run this at a cards maximum sample rate (1Mhz) and get good relaible data collection
 
Thoughths would be appreciated
0 Kudos
Message 1 of 5
(2,834 Views)
Hi mr_nice,

The code you have provided will do what you require, however there are more efficent methods.
The first and simplest to introduce would be to write to a binary file rather than an ASCII file. This has the benefit of using the least amount of space while retaining the full numeric precision of the acquired data.

The second method that I can think of would be to use a producer/consumer loop. You can have your DAQ code in the producer loop and combine your data in to the single 2D array and send that to the consumer loop to be written to file.

Also you might want to consider using a replace array subset, rather than a insert into array, as this is more memory and processor efficient. You would need to initialise the array outside of the while loop. The array would have to be twice the size of the read buffer as you have 2 DAQ cards.

Regards
JamesC
NIUK and Ireland

Message 2 of 5
(2,806 Views)

Thanks JamesC, I appreciate these sort of questions can be annoying so thanks for taking a look at it.

I have changed it from and ASCII to a binary, should have done that in the first place!!

not sure what you mean about producer/consumer, have you got a picture showing what that actually means

I am not sure either how you could use a replace subset instead of insert

 

0 Kudos
Message 3 of 5
(2,792 Views)
Hi mr_nice,

Attached is how to use replace array subset.

I was talking abount the Producer/consumer design pattern that is bundled with LabVIEW.
Please open LabVIEW and go to File >> New ...
In the New Dialog box please go to Frameworks >> Design Patterns to see a producer/consumer example. If you do not understand what the pattern is doing it is best not to use it.

Regards
JamesC
NIUK and Ireland

0 Kudos
Message 4 of 5
(2,784 Views)
Thats nearly brilliant the only thing its not quite recording all of the data. I have simplified the vi removing the AI stuff and adding a read binary to an array to see if ithas worked, to help demonstrate clearly. Say I have two cards each using 16 channels taking three samples per loop and 4 loops. Therefore when I read back the final binary file I should get an array of 16x12 and I don't I just get a 16x3 showing it is not appended. What am I doing worng
 
Cheers

Message Edited by mr_nice on 05-18-2007 06:24 AM

0 Kudos
Message 5 of 5
(2,777 Views)