Showing results for 
Search instead for 
Did you mean: 

Feed Daqmx analog output with data from 1D array

Hi everyone,


I am working on a project of a potentiostat and wrote the code to perform cyclic voltammetry in LabView. I want to generate a cyclic potential ramp that goes up and down at specific potential range and rate. I got it working, but the problem is that when I use this ramp to feed the DAQmx to generate an idential  analog output it does not work. I already tried to index the array but it did not work. I am newbie on labview and do not know how to fix it. I attached the code of my VI and highlighted the point I am facing problems. If someone could helpm me would be great.

0 Kudos
Message 1 of 5

Hi Bruno,


I can take a look if you save for LV 2012. (File >> Save for previous version...)


When I've worked with DAQmx drivers I create a waveform (a specific data type with more components than just voltage values) for the analog output device, have you tried this?

0 Kudos
Message 2 of 5

Hi Gregory,


Thanks for the help. I attached a new vi file saved for LV2012. I believe now you will be able to open it. I also attached a screen print of the block diagram.


Actually I did not try anything yet. This vi worked exactly as I need, except for the issue that I can not feed the analog output with the generated cyclic wave. Anyway, before try some other solution I would like to check if there is some way to correct the code I wrote.


How would be this wave form you talked about? Could you give more details about it?    

0 Kudos
Message 3 of 5

Hi Bruno,


I notice a couple of things that you should try to stay away from: (1) Bent wires. This may seem like it's just a neat freak issue, but you will waste a lot of time trying to trace wires that could be much shorter. This includes wires going in the wrong direction (2) Dynamic data. This is one of the reasons you don't really know what you are sending to your DAQmx. It is quite easy to build your own XY graph after you do it once or twice, you don't need an express VI to add overhead. (3) Unnecessary structures. There is no need for a while loop at the end, just wire the error wires out of your for loop. 


Now to the heart of the issue, your DAQmx function is set for 1Chan 1Samp. This is not the right instance for an array of values. I like to use the waveform because it has timing information, t0 and delta t. (Acess quickstart, ctrl+spacebar, and type in "build waveform" to create one, it's just like a cluster.) I think you could set up your clock  earlier in the code so the output comes out as you expect it as well. Either way you will want to use one of the 1Chan NSamp instances.

0 Kudos
Message 4 of 5

You should use the waveforms VIs to accomplish this and set the DAQmx to use Waveform. Here is a quick example where I use the Triangle Waveform VI to create a signal that goes from 0V to 10V and then go back to 0V. The Triangle Waveform VI sampling is set to 1000 samples at 1KHz, these setting will be used by the DAQmx Timing VI.



AO Using DAQmx VIs.png

The best way to say thanks is to give kudos!
Message 5 of 5