Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Want to output a voltage ramp over time and measure 2 analog input USB-6008

Solved!
Go to solution

Hi,

 

I want to produce an analog voltage output signal which increases over time with a certain slope, which I will send into a potentiostat and at the same time I want to read out the actual voltage and current (both are represented by a voltage signal) which I want to log and eventually plot against each other. To do this I have a USB-6008 DAQ system to my disposal.

 

Creating the analog output signal with an linear ramp I was possible to do by using a while loop and a Time Delay (see attachment). Important here is that I can set the slope of the linear ramp (e.g.. 10mV/s) and the step size to make a smooth inclement. However when I now want to measure an analog input signal it goes wrong.

To reduce noise influences I want for instance measure 10 values for example within 0,1 second and average it out (this read out should be quicker or equal then the inclement caused by the slope and the step size of the linear ramp. Example: a slope of 10mV/s is set along with a step size of 10. Every 0,1s the analog output signal rises with 1mV. Then I want to read 10 values at the analog inlet within this 0,1s)

Because I use a Time Delay to create the linear ramp and the analog input is in the same while loop, the time delay also affects the analog input and I get an error every time. Separately in different VI-programs (analog input and output) they work fine but combined not. I have searched this forum to found a way to create the ramp in a different way but because I am not an experienced user of labview I can't find an other way. 

 

To make it now a bit more complicated I said I want to measure 2 analog input signals (one for the voltage of the potentiostat and one for the current (also represented by a voltage signal)) and they should be measured quicker then the inclement of the analog signal. This I have not even started with because I could not get the read out of one channel working.
 

 

Hopefully someone can help me with this problem

 

0 Kudos
Message 1 of 7
(5,812 Views)

Exactly what error do you get? Can't help fix it unless you provide that information.

 

p.s. Your calculation to get the mean of the analog input is wrong and why not simply specify samples read instead of basing it on step size?

0 Kudos
Message 2 of 7
(5,802 Views)

I get the following error: Error -200278

 

I saw it also that the mean of analog input was wrong. I changed it

 

I also got the VI working by using 2 separate loops which run simultaneously (did not know this was possible, see attachement). But now I want to use the same stop conditions, but if i just connect it from loop 1 to loop 2 they won't run simultaneously anymore but one after the other. Do you know how to fix this?

 

The reason why I do not fix the samples to be read is because otherwise the DAQ-system is reading out while the analog output rises and not between the moment it has rised and the moment it has to rise. But is perhaps a better idea to play with the sample rate instead of the ammount of samples?

0 Kudos
Message 3 of 7
(5,797 Views)

I suspect your error was caused by the goofy number of samples you were using. Instead of a fixed count, use a -1 which will return all availab.le samples. There is no need to use 2 separate loops. In one loop, the read and write will be sequential and not indpendent.

 

p.s. Just use the Mean function.

0 Kudos
Message 4 of 7
(5,787 Views)

Thank you.

 

One small question, I now want to measure 2 AI channels and set the DAQmx Read to Analog 2D DBL NChan NSamp but how do split the data in to its belonging AI channel?

0 Kudos
Message 5 of 7
(5,777 Views)
Solution
Accepted by topic author JonasH321656

Index Array. You want to index the columns to get a single channel.

0 Kudos
Message 6 of 7
(5,774 Views)

Thanks

0 Kudos
Message 7 of 7
(5,769 Views)