Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

multi channel analog input using DAQmax and then write into a file e.g. text file (better) or binary file

Now you have made another common mistake. You cannot use multiple tasks. You have to create a single task that uses multiple channels (i.e. Dev1/ai0:ai3). Then you can separate the channels with the Index Array function.

 

When you had 1Samp mode, the time between samples was only roughly set by the msec wait. That is using software timing and there is considerable jitter when using a non-deterministic os such as windows.

 

I don't understand the multiplication of the dt value by the iteration count. dt is the inverse of the sample rate and is a constant.

 

0 Kudos
Message 11 of 18
(1,893 Views)

I used the Index Array Function to separate the wave forms as you said, but I couldn't find much info on the way the index works, I have wired 5 Index Array Functions. I wired a constant to the respective index values ranging from 0 to 4 respectively in the hopes that I would get 5 different charts and read their respective waveform components. When the program was run, all the charts showed similar voltages. I don't think my index constants are correct, I also need to identify the channels the charts correspond to.

 

Thanks for the tip on the Index Array function !!

0 Kudos
Message 12 of 18
(1,885 Views)

The indexing is fine.

 

Why do you keep changing back and forth the way you are doing the sampling? Now you are taking a single sample and the sample clock function is silly since you have reverted to software timed i/o.

0 Kudos
Message 13 of 18
(1,876 Views)

I was only changing the sample timing to suite my professor's demands, earlier he said 5 samples a second, then last night he said 1 sample a second. I can't really question the man, I just do my best to carry out his wishes 😄

 

But on a serious note, if the indexing is fine why is it showing the same waveform on all the charts? Also how do I identify which chart corresponds to which channel?

0 Kudos
Message 14 of 18
(1,873 Views)

Index 0 is the first channel you have defined. Index 1 is the second channel, etc. I would suggest you create a chart and wire it directly to the output of the DAQmx Read. This would display all channels. Then, you can change the channel list, perhaps selecting one channel at a time to see if the output from each channel is different. You can also test each channel individually in MAX.

0 Kudos
Message 15 of 18
(1,871 Views)

I found the issue, the wave component of ai0 was being overwritten in the output spreadsheet string by the time from it's chart, I fixed it by taking the dt and Y array and transposing it, then feeding it into the array to spread sheet converter.

 

Thank you so much for all your guidance and also for being so patient with me 😄

 

take care

0 Kudos
Message 16 of 18
(1,857 Views)

Hi, I'm new to labview and I'm having a problem while writing the measurement to a file. I'm acquiring two analog inputs and I actually write the data to a file succesfully. The thing is that I'm getting one file with three columns of data (time, channel 1, channel2), but I would prefer to have data coming from channel 1 (index 0) being saved on a file, and data coming from channel 2 (index 1) being saved on an independent file. Can I actually do that? Thanks in advance for your help.

 

Oscar

0 Kudos
Message 17 of 18
(1,737 Views)
Of course you can do that. Just use two different file write functions.
0 Kudos
Message 18 of 18
(1,729 Views)