LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview software to run voltage ramps and collect resulting current

I am attempting to write a program that will record cyclic voltammograms and amperometry for electrochemistry techniques. Basically I want the  labview program  (one output channel) to run voltage ramps  and collect the resulting current response of the system using a current to voltage op amp circuit (one input channel). The voltage output signals and current response will then be kept in a spreadsheet format for further analysis. I would like to be able to start either at a low or high voltage for the voltage ramp. Also, a more complex program would start at any point in the cycle and start in either direction. The resulting graph would show a current/voltage plot as seen on electrochemical recordings. I am only at a basic level using Labview and would appreciate somebody giving me advice on how to start this project.

thanks,

Martin
0 Kudos
Message 1 of 10
(5,081 Views)
What you want to do can be very easy, or can be quite complex.  The attached may be a good starting point.  We don't know what equipment you are using to set voltage or read current.  I have assumed they are two separate pieces of equipment.  I have made "dummy" sub-vis that you can put the GPIB commands to speak with your specific equipment.
-R
0 Kudos
Message 2 of 10
(5,071 Views)
Thanks Rob,

I'm running it through a PCI 6036E caerd via a BNC2110 box. I'm using one analogue input for the current and an analogue output BNC for the voltage. The same instrument (potentiostat) is used for the voltage ramp and current output through a series of op amps. Could I substutue your I/O bit using the DAQ assistant? I see that you are using a for loop - is this so the voltage can be delivered in small steps?

Thanks for your help,

Martin
0 Kudos
Message 3 of 10
(5,068 Views)
I don't see why you couldn't substitute code from the DAQ assistant.  I am, however, unfamiliar with what that entails.

The for-loop is used for the reason you mention.  Most of the equipment I use, I step current through a range and get device readings (from a different piece of equipment).  Often, equipment won't have a sweep function, or if it does, for higher precision, the manuals say don't use it.  This is because it is difficult to synchronize sweep time and rate with the reading time and rate.  If your equipment has a sweep function, you could use it, but taking small steps is just a bit more "general".

Good luck.
0 Kudos
Message 4 of 10
(5,060 Views)
Hi Martin,

LabVIEW ship with a lot of examples to help you in your programing. There is one called Multi-Function-Synch AI-AO.vi found under Hardware Input and Output>>DAQmx>>Sychronisation>>Multi-Function in the NI Examples Finder (found under Help>>Find Examples...). This example does simultaneaous input/output. You can change it so that the waveform you use is a ramp. You coud make this ramp a waveform or just an array of numbers (you could easily create a ramp by using a for loop and outputing the Iteration count, then scaling it to your needs). The update generation Rate would detmine how fast your ramp would be.

Regards

Jon B
Applications Engineer
NI UK
0 Kudos
Message 5 of 10
(5,047 Views)
Your program has three main parts:
  1. Generating of the desired voltage ramp as an array.
  2. do the synchronized AO/AI
  3. Chart the V vs. I in an x-y graph while doing (2), then write to a file.

For (1), just generate an array of voltages once, then you can rotate it for any desired phase if you want to start somwehere in the middle.

For (2), there are probably better tools available using DAQmx. Just for reference, here's what I did ca. 1996 for a similar project: a. Set up a hardware timed voltage ramp for the AO. b. Set up AI with the clock set to AO update. c. Start the AO. The AI will automatically start and be syncronized with the AO.

For (3), just accumulate the Voltage and Current data into arrays and update them into an xy graph at regular intervals. When the taks is done, write everything to file.

0 Kudos
Message 6 of 10
(5,043 Views)
Thanks for your help which has given me a few ideas. I basically generated an up and down ramp using a For Loop. The voltage ramp can either go up or down between various start points. The output of this was then fed into the x input of an xy graph via another For Loop built around a flat sequence structure. The  flat sequence structure is made up of three partitions :1. is analog out. 2. is analog in and 3. is the xy graph. The For Loop was used to bring the input voltage and output current into sequence together. This seems to work fine except I now want to be able to control the number of scans and the scan rate and also to be able to hold the initial voltage for a given time. The only strange thing I have come across is when the program is running all I get is a dot moving across the xy graph rather than a line even though there is data output as I have already written it to file. Any suggestions or am I missing something.


cheers,

Martin
0 Kudos
Message 7 of 10
(5,020 Views)
You have to understand the nature of an XY graph. The input to it is a cluster that consists of an x array and a y array. What it sounds like you're doing is that with each iteration, you are creating new arrays from just the last acquisition and graphing that. You could use a shift register to keep the previous values and append new results to them so that the XY graph will display all values. You could also wire the XY graph outside the loop so that you would get every value after the entire acquisition is done. You can also make an XY Graph act like a chart. A chart keeps a history of values written to it so that with each iteration, you just write a new point and not an entire array. This technique is shown in the shipping example called XY Chart.
0 Kudos
Message 8 of 10
(5,014 Views)
I am trying the same setup, except both of my voltages are set as analog inputs. Did you ever get it to work? If so, how much progress have you made so far.
0 Kudos
Message 9 of 10
(4,935 Views)
In the end I used a modified version of the Multi-Function-Synch AI-AO.vi.  For my waveform outputs I wired an extra waveform generator to the DAQmx analog input. This seems to work very well although I have to make sure that the number of runs and sample rate are set up properly to match the frequency of the input wave.

cheers,

Martin
0 Kudos
Message 10 of 10
(4,924 Views)