LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mx data acquisition

I am using DAQmx virtual channel with readmx, timingmx and clear taskmx for acquiring data (analogue input channel). Also a waveform is generated using an analogue output channel using DAQmx virtual channel with writemx and clear taskmx. The graph for the output waveform shows a nice triangular waveform. However, there is no input signal shown in the graph for the  input waveform.  In addition, a column of data is only recorded for the output waveform and only one point for the input data. If a chart is wired to the data from the read file (analogue input channel) a signal can be seen although it is still not recorded in a text file. I guess somewhere along the line I am only recording one point for some reason. Can anybody help. I am sampling at 10000 Hz. The I/O card used is PCI6036E and a BNC2110 for interfacing.

thanks,

Martin
0 Kudos
Message 1 of 6
(3,102 Views)
It might be a little easier to diagnose if we could see your VIs.

But, I'll give some suggestions anyway...

Where are you using the Clear Task VI? A Clear Task destroys the task and you have to create a new task in order to acquire data. If your Clear Task is inside your acquisition loop, then you will only get one data point.

With DAQmx, it's fastest to create your task once and then use Start Task and Stop Task to work with the task.  Acquire data using the read functions as you need it and Stop Task or Clear Task only when you are done acquiring data.

Hope this helps some.

     Rob
0 Kudos
Message 2 of 6
(3,097 Views)
Rob,

Thanks for your help. I am still having problems so I have attached my vi. I hope you don't mind having a quick look at it.

all the best,

Martin
0 Kudos
Message 3 of 6
(3,087 Views)
Okay, I've taken a quick look at it.

It's as I said, you have the Clear Task inside of the acquisition loop. The normal mode of operation is to Setup the channels then do your acquisition in a loop and then close the task once you're done with it.

Here is the VI changed as above. I also moved things around a little to make it easier to read.

     Rob
0 Kudos
Message 4 of 6
(3,074 Views)
Rob,

Thanks for your help. It is reading ok now and recording all the points although I think I will have to adjust the clock timing as the output should follow the input (when using an in line resistor). At the moment its not doing this.

thanks for your help,

Martin
0 Kudos
Message 5 of 6
(3,063 Views)
Yes, the VI as it stands is trying to read and write at around the same time. You can always use some form of data flow to ensure that the read function only happens after the write function or vice versa.

     Rob
0 Kudos
Message 6 of 6
(3,045 Views)