I have a PCI-6221 DAQ card and I need some advice for the interface I'm trying to program.
I need a program to define and build a waveform made up of several different levels (see attachment). This waveform will then be sent to the analog output of my card. The basic requirements of the program are :
- the number of levels is defined by the user (typically 10-20 levels)
- the duration (a few seconds per level) and amplitude are defined by the user
- this basic waveform is then repeated several times (typically a few hundred). However, there should be a factor to multiply the whole waveform at the beginning of each cycle, to increase it.
So I'm not sure about the best way to implement this, so any advice would be welcome.
The best approach I've thought of is the following :
- the user enters the number of levels, with the amplitude and duration of each level, in a table.
- the program then builds the waveform using the ''basic function generator vi'' placed within a for loop. The function would be a square wave with a duty cycle of 100%. Each time the loop would generate one level and append it to the previous levels.
Is this a good approach ?
Thanks,
waveform.jpg:
http://forums.ni.com/attachments/ni/170/347295/1/waveform.jpg
customizable waveform.vi:
http://forums.ni.com/attachments/ni/170/347475/1/customizable waveform.vi
customizable waveform.vi:
http://forums.ni.com/attachments/ni/170/347498/1/customizable waveform.vi
Thanks for your help. However, I have Labview 8.0 and I can't open the vi, which was programmed on 8.5 apparently. Is there any way of opening it with 8.0 ?
Thanks,
customizable_waveform_LV80.vi:
http://forums.ni.com/attachments/ni/170/347510/1/customizable_waveform_LV80.vi
Thanks,
The DAQ device will not do any linear interpolation between samples. When you output a sample, it will hold that value until the next sample is output. If you are doing software timing then it will update the value based on each time that you write the sample. If you are doing hardware timing then it will update the value on each rising edge of the sample clock.
For your example, yes, the resulting waveform would be the same as long as the value of all the samples were 4V.