imgPulseCreate2

NI IMAQ Function

imgPulseCreate2

Usage

rval imgPulseCreate2(uInt32 timebase, uInt32 delay, uInt32 width, IMG_SIGNAL_TYPE signalType, uInt32 signalIdentifier, uInt32 signalPolarity, IMG_SIGNAL_TYPE outputType, uInt32 outputNumber, uInt32 outputPolarity, uInt32 pulseMode, PULSE_ID* plsID);

Purpose

Configures the attributes of a pulse. A single pulse consists of a delay phase (phase 1), followed by a pulse phase (phase 2), and then a return to the phase 1 level.

Only the NI PCI/PXI-1409, NI PCI-1410, NI PCI/PXI-1422, NI PCI-1424, NI PCI-1426, NI PCIe-1427, NI PCI/PXI-1428, NI PCIe-1429, and NI PCIe-1430 can generate pulses.

  • The NI 1409, NI 1410, NI 1422, NI 1424, NI 1426, and NI 1428 can generate a maximum of 2 pulses.
  • The NI 1427 and NI 1429 can generate a maximum of 3 pulses.
  • The NI 1430 can generate a maximum of 6 pulses.

Parameters

Name Type Direction
timebase uInt32 input
delay uInt32 input
width uInt32 input
signalType uInt32 input
signalIdentifier uInt32 input
signalPolarity uInt32 input
outputType uInt32 input
outputNumber uInt32 input
outputPolarity uInt32 input
pulseMode uInt32 input
plsID PULSE_ID* output
rval Int32 output

Parameter Discussion

timebase: timebase of the counter. timebase has the following possible values:

PULSE_TIMEBASE_PIXELCLKSpecifies the incoming pixel clock from the camera to use as a timebase for pulse generation.
PULSE_TIMEBASE_100KHZSpecifies a 100 kHz timebase to use for pulse generation.
PULSE_TIMEBASE_50MHZSpecifies a 50 MHz timebase to use for pulse generation.
PULSE_TIMEBASE_SCALED_ENCODERSpecifies scaled encoder counts as units for pulse generation.

delay: duration of the first phase of the pulse. Use the following formula to determine the actual time period that delay represents:

delay × (timebase resolution)

width: duration of the second phase of the pulse, phase 2. The unit is cycles of the timebase. Use the following formula to determine the actual time period that width represents:

width × (timebase resolution)

signalType: type of signal that will initiate the pulse generation. signalType can be one of the following constants:

Note  Note  To use the ISO_IN or RS422_IN signals on the NI PCI-1426, select External as the Trigger Type for your function and choose ISO In or RS-422 In as the Signal Level for the trigger line in Measurement & Automation Explorer (MAX).
IMG_SIGNAL_EXTERNAL
IMG_SIGNAL_RTSI
IMG_SIGNAL_ISO_IN
IMG_SIGNAL_STATUS

signalIdentifier: is the identifier of the signal that will initiate the pulse generation. If the signal type is one of the triggers, then this value specifies which trigger line. If the signal type is IMG_SIGNAL_STATUS, signalIdentifier can be one of the following constants:

IMG_AQ_DONE
IMG_AQ_IN_PROGRESS
IMG_FRAME_DONE
IMG_FRAME_START
IMG_FRAME_VALID
IMG_IMMEDIATE
IMG_LINE_VALID

signalPolarity: polarity of the signal input as defined by the following constants:

IMG_TRIG_POLAR_ACTIVELTriggers on a falling edge
IMG_TRIG_POLAR_ACTIVEHTriggers on a rising edge

outputType: type of trigger line on which the pulse is generated. outputType can be one of the following constants:

Note  To use the ISO_IN or RS422_IN signals on the NI PCI-1426, select External as the Trigger Type for your function and choose ISO In or RS-422 In as the Signal Level for the trigger line in MAX.
IMG_SIGNAL_EXTERNAL
IMG_SIGNAL_RTSI
IMG_SIGNAL_ISO_OUT

outputNumber: number of the trigger line on which the pulse is generated.

outputPolarity: polarity of the pulse output as defined by the following constants:

IMG_PULSE_POLAR_ACTIVELDrives the line high during the delay phase, and drives the line low during the pulse phase
IMG_PULSE_POLAR_ACTIVEHDrives the line low during the delay phase, and drives the line high during the pulse phase

pulseMode: value that indicates if the pulse is generated once or continuously. pulseMode can be one of the following constants:

PULSE_MODE_TRAINPulse is generated continuously after the trigger is asserted. Choose this option to generate a continuous pulse train that is inactive for the number of cycles specified in the delay parameter, and active for the number of cycles specified in the width parameter. When the pulse train is started, it continues periodically until you call imgPulseStop, imgPulseDispose, or imgClose.
PULSE_MODE_SINGLEPulse occurs one time when the first trigger occurs. Choose this option to generate a single pulse. On the first occurrence of signal_source, the output line stays inactive for the number of cycles specified in the delay parameter, and becomes active for the number of cycles specified in the width parameter. Future occurrences of signal_source do not affect the output line.
PULSE_MODE_SINGLE_REARMPulse occurs one time on each trigger occurrence. Choose this option to generate a rearmed single shot pulse. On every occurrence of signal_source, the output line stays inactive for the number of cycles specified in the delay parameter, and becomes active for the number of cycles specified in the width parameter. When the pulse is started, output toggles for each occurrence of signal_source until you call imgPulseStop, imgPulseDispose, or imgClose.

plsID: pointer to a variable to receive the pulse ID. If the function succeeds, the variable is populated with a valid PULSE_ID that can be used in subsequent functions.

Return Value

This function returns 0 on success. On failure, this function returns an error code. For information about the error code, call imgShowError.