Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

niFgen_ConfigureArbSequence

I am have a Gain/Offset issue, I looked at the solution from the forum but that did not help us. The waveform I am generating is using "short" data instead of floating-point. Could this be an issue? We are trying to get 0..+4 V but we need maximum resolution so generating data from 0 to MAX_SHORT is not going to get us there...we need MIN_SHORT to MAX_SHORT.
0 Kudos
Message 1 of 3
(6,995 Views)

Hey,

There is no problem at all with generating a waveform with "short" (16 bit integer) data ata all.  I'm assuming you're using the C functions.  In that case, you can use the function "niFgen_CreateWaveformI16" to create a waveform of 16-bit integers.  The second function that you will want to use to maximize your resolution is the "niFgen_ConfigureArbSequence."  Notice that this function call has two input parameters that are critical to your application.  These parameters, "gain" and "offset," are 64-bit floating point values.  For your specific application, you will want to set these values based on your minimum and maximum output voltages.  Hope this helps and let me know if you have any more additional questions.

Regards,

David Hall | Applications Engineering | National Instruments

 

0 Kudos
Message 2 of 3
(6,984 Views)
I think the problem is that, on some arbitrary waveform generators, the maximum offset is half of the gain value.  You want an output range of 4 V, centered around +2V.  If you supply full-resolution data (MIN_SHORT to MAX_SHORT), you want to set the gain to 2 and the offset to 2.  (The gain valus is 2 because a gain of 1 implies -1 to 1 V, which is a two volt range.  You want a four volt range, so set the gain to 2.)

However, with a gain of 2, the maximum allowed offset would be 1.  What device are you using?

A solution is to set a gain of 4 and provide binary data between 0 and MAX_SHORT.  However, as you point out, this throws away some resolution.  Do you really need the full 16-bit resolution?  If you play with gain and offset values, you can provide data in a smaller range than [MIN_SHORT to MAX_SHORT], but in a bigger range than [0 to MAX_SHORT].  Do the calculations based on how much resolution you are willing to give up.


0 Kudos
Message 3 of 3
(6,978 Views)