Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Software timed analog input/output voltage NI USB 6008 plot xy graph

This is my first time trying to write a labview program and I am having difficulties with my labview code.  I am using an NI USB 6008 to output a voltage triangle type function by creating an array of 1000 voltage points.  This voltage is being applied to an electrode where I am measuring the current between two electrodes using an electrometer that outputs a voltage proportional to the current. That voltage is then being read on the NI USB 6008 analog input channel.  I want to take the analog output voltage and analog input voltage and plot them on an x-y graph, where the applied potential is on the x axis and the voltage proportional to the current is on the y-axis.  I understand I can't synchronize the analog input/output due to the fact there is no hardware timing available on this device.  What I have done is tried to share a sample clock within a while loop, hoping it would work.  However, the plot I am seeing is nothing like what I expected so it leads me to believe there is something wrong with my program.  Any suggestions would be much appreciated. Here is what I have so far.

0 Kudos
Message 1 of 6
(5,422 Views)

A few notes:

 

  • You don't need the start and stop for the DAQmx driver for what you're doing
  • Wire the Error Out from the Write to the Read, this ensures that the Write executes first
  • Insert a variable delay between Write and Read, this will allow you to account for the response delay of your circuit (assuming it ends up being meaningful)
  • Convert your Stacked Sequence structure to a flat one by right clicking on it and selecting Replace >> With Flat Sequence
  • Eliminate your stacked sequence structure as it's not necessary to ensure dataflow in this use case (right click on structure, Remove)
CTA, CLA, MTFBWY
Message 2 of 6
(5,416 Views)

Thank you for your suggestions, they were very helpful in getting my program to run much more efficiently.  However, I am still having a few difficulties with some of the noise in the signal.  I was wondering if anyone had any suggestions on how to average say every ten points read from my analog input.  Im thinking this might help decrease some of the spikes in the signal, making the graph a little easier to read.  Also, I was wondering if there is anyway to control the amount of points I output.  To be more clear, I want to be able to choose how many cycles I want to run.  As of now, each cycle consists of 1000 points, but what I want to do is be able to specify 1 cycle, 2 cycles, ...etc.  Is there anyway to do that. Here is my new VI attached below.

0 Kudos
Message 3 of 6
(5,401 Views)

Here is what I have so far with no timers

0 Kudos
Message 4 of 6
(5,348 Views)

Hi hedlundc33,

 

Please refer to the Gen Mult Volt Updates-Int Clk.vi shipping example in LabVIEW in order to see a general programming architecture. From here you can make your own modifications. Hope this helps! Thanks!

 

-Carisa L.

Applications Engineer
National Instruments
Message 5 of 6
(5,337 Views)
0 Kudos
Message 6 of 6
(5,318 Views)