LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to create a voltage ramp in LabWindows/CVI.

I'm new to programming I/O boards, so I'm trying to figure my way through this.
 
I'm trying to create a distinct analog output voltage signals using a PCI 6713 Analog Output Board that will drive a small bulb.  I have to load a csv file that has the voltage vs time.  The csv file consists of a start at 0,0.  then must increase to 5v within .5 seconds.  then stays at 5v for 3 seconds.  then ramps down to 1 v and ramps up to 5v: takes about 2 seconds.   After holding at 5v for about 2 seconds, I want the signal to go to 0V or just stop. 
 
The main questions is: I want the capability to click a "Generate" button in the window to create this signal, and I would like someone to help me if possible. 
 
I've looked through most of the samples and tried to figure it out.  So far, I have used ao_wave and aisync to learn how to load the files and graph the desired signal.  I haven't found a sample that shows me how to generate 1 single signal as I have described above.  I used filetoarray to store the values into an array.
 
If anyone could point me in the right direction, that would be great.  Thanks.
0 Kudos
Message 1 of 2
(2,989 Views)
To output a waveform you can use the waveform generation functions in the DAQ libraries.
 
You have a couple of possibilities, starting from AOGenerateWaveforms in the Easy I/O for Daq library. I really never tried using it but I assume it can be helpful for you to start building your application. Unfortunately I don't know of any example that uses this function.
 
A more complex structure is involved in using functions from the Data Acquisition library, but I can suggest you to look at WFMsingleBufAsync sample that covers almost all your needs from generating the array that describes the waveform to outputting it from the daq card. The sample project is well documented and I have used it as a basis for several applications of mine finding it very useful.
 
In the same library a Generate WFM from Disk function is present that reads a file from disk and outputs a waveform, but keep in mind that this function waits for the generation to complete before returning, so you won't be able to follow your process and perform other tasks while the generation is in progress, not even processing a simple "Stop" button to end it in case of problems.
 
Hope this helps you a little
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(2,976 Views)