MATLAB: Do I receive an the error “Undefined function or variable ‘NIFGEN_VAL_OUTPUT_ARB'” when attempting to use NI-FGEN Instrument Drivers

controlictinstrumentInstrument Control Toolboxnifgen_val_output_arbnifgen_val_output_functoolbox

I am trying to modify the code example for "Using NI-FGEN Instrument Driver To Generate A Sine Wave", available at:
so that I can use an arbitrary waveform instead of a sine wave. However, when I replace the line:
 
invoke(ictObj.Configuration,'configureoutputmode',NIFGEN_VAL_OUTPUT_FUNC);
with 
 
invoke(ictObj.Configuration,'configureoutputmode',NIFGEN_VAL_OUTPUT_ARB);
I receive the error:
  ERROR: Undefined function or variable 'NIFGEN_VAL_OUTPUT_ARB'

Best Answer

The "NIFGEN_*" constants are defined in the "niFgen.h" header file included with the National Instruments drivers.
Search your machine for the "niFgen.h" file, open the file, and search it for the "NIFGEN_VAL_OUTPUT_ARB" variable. In this file, the variable is defined to a value of 1.
Now, above the invoke line in MATLAB, define a variable named "NIFGEN_VAL_OUTPUT_FUNC" to a value of 1, as shown:
 
NIFGEN_VAL_OUTPUT_FUNC = 1;
invoke(ictObj.Configuration,'configureoutputmode',NIFGEN_VAL_OUTPUT_ARB);