LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

defining fgen waveform

I have gone round and round witht the examples of using fgen to output a waveform and have not succeeded in getting the output I need.

 

I have a PXI-5412.

 

I need the waveform to start at 0V then ramp to some voltage, remain at that voltage for some period of time then go back to 0V. This needs to happen as a single pulse from a software trigger.

 

(Ultimately, I need to be able to control the slew rate of the ramped portion)

 

I have tried all kinds of combinations of gains and offsets to no avail.

 

What am I missing?

 

Mac

0 Kudos
Message 1 of 7
(2,816 Views)
You just need to create an array with the necessary values. The ramp function can be used for the first segment and the second with something like initialize array with x number of points. Combine the two into a single 1D array. Add another ramp pattern function to ramp down or reverse the first ramp array and append that.
0 Kudos
Message 2 of 7
(2,806 Views)

Sorry, but I can't get any combination of gain or offset to get the ramp to go from 0V to say 1.5V, stay at 1.5V for XmS, then go back to 0V.

 

It either complains the gain is too high or the offset is too high.

 

The array is the simple part, right? Say, 256 points from -1 to 1.

 

I just can't seem to find the aha! moment for this. 😞

 

 

 

 

0 Kudos
Message 3 of 7
(2,802 Views)
Using the gain and offset is wrong. As I said, use the ramp pattern function.
0 Kudos
Message 4 of 7
(2,799 Views)
Forgot to add that you should be in arbitrary waveform mode.
0 Kudos
Message 5 of 7
(2,795 Views)

Thanks for the replies.

 

I guess I'm asking things in the wrong way. I understand how to use the ramp pattern to generate arrays of ramp data. And, I understand that I can add more to the array to get the dwell time and then turn it off. But when would one use Util Create Bin16 Waveform Data VI instead? and why?

 

For that matter, if gain and offset aren't the right thing to use, why? And, when and why are they the right thing to use?

 

So, I think I generally get the mechanics of how, I'm trying to understand the why so that I can make reasoned code design decisions rather than just use things by rote.

 

 

 

 

 

 

0 Kudos
Message 6 of 7
(2,774 Views)
The gain and offset are only applicable to the standard waveforms from the function generator - not an arbitrary waveform. The gain is a multiplication of the waveform (sine for example) and the offset is an addition.
0 Kudos
Message 7 of 7
(2,767 Views)