12-08-2009 08:39 PM
Hi,
I am trying to aquire data from NI9211 DAQ Unit via USB and record that data to a file with a timestamp. I have tried all I could think of and came up with this. somewhere on the way my signal is being lost and I have no idea where. I am not sure if I need to use shift registers but I want to output the data in the loop after time out. Thank you so much.
12-08-2009 09:27 PM - edited 12-08-2009 09:27 PM
You have some fundamental flaws in your program. First of all, you are not acquiring data with any timestamps. It does no good to convert to dynamic data - garbage in, garbage out. Second, you are using the insert into array on an empty array. That does not work either. Inserting an element into an empty array results in an empty array. You could have seen that if you had used a probe on the shift register.
Attached is a modified version. It acquires data as a waveform data type so that there are timestamps. It then uses a build array function so that a new acquisition is appended to the old. Cleaned up your messy diagram as well.
12-08-2009 09:40 PM
Dennis,
I am sorry for my poor understanding of NI but I am trying. The VI you modified works, however the loop stops after the time target but not the VI and it never asks for a file name and therefore it does not output any file. Thanks!
Boris M.
12-08-2009 10:03 PM
12-08-2009 10:30 PM
Yes, you're right. Sorry, the waveform datatype got me messed up as well.
Your current VI has a single channel. If that is what you are using, then the DAQmx Read can be changed to a 1Ch acquisition which will return a waveform and not a 1D waveform array. You can then replace the Build Array with the Append Waveform function. If you need multiple channels, that will take a little more work. I don't have time right now, though to provide that example.
12-09-2009 08:24 AM
I need to have the functionality to select 1 or more channels to log. I would really appreciate your help on this. Thank you so much.
Boris M.
12-09-2009 10:35 AM