flex_select_signal

NI-Motion Functions

flex_select_signal

Device Compatibility

Device Compatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Xenus
N
NI SoftMotion Controller for CANopen—Accelnet
N

Select Signal

Usage

status = flex_select_signal(u8 boardID, u16 destination, u16 source);

Purpose

Specifies the source and destination for various motion signals, including trigger inputs, high-speed capture circuits, breakpoint outputs, RTSI lines, and RTSI software ports.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
destination u16 destination of signal
source u16 source of signal

Parameter Discussion

destination is the destination of the signal coming from source.

source is the source of the signal to route to destination. For a destination value of NIMC_HS_CAPTURE1 through NIMC_HS_CAPTURE8, the valid source values are as follows:

source Comments
NIMC_RTSI0 through NIMC_RTSI7 RTSI lines 0 through 7
NIMC_PXI_STAR_TRIGGER  PXI star trigger line
NIMC_TRIGGER_INPUT Trigger input for the corresponding axis
Note  You must route signals from the RTSI lines before you enable high-speed capture.

For a destination value of NIMC_RTSI0 through NIMC_RTSI7 (Value 0-7), the valid source values are as follows:

source Comments
NIMC_BREAKPOINT1 through NIMC_BREAKPOINT8 Breakpoint outputs
NIMC_RTSI_SOFTWARE_PORT  Corresponding bit in RTSI software port
NIMC_DONT_DRIVE Sets RTSI pin back to input state
NIMC_PHASE_A1 through NIMC_PHASE_A8 'A' phase of encoder 1 through 8
NIMC_PHASE_B1 through NIMC_PHASE_B8 'B' phase of encoder 1 through 8
NIMC_INDEX1 through NIMC_INDEX8 Index signal of encoder 1 through 8

Using This Function

When the destination is NIMC_RTSI0 through NIMC_RTSI7 or NIMC_PXI_STAR_TRIGGER, the motion controller drives the RTSI line as an output. When the destination is NIMC_HS_CAPTURE1 through NIMC_HS_CAPTURE8, the RTSI line serves as an input for the high-speed capture circuitry. This function is used to set the direction of the RTSI lines. The RTSI lines can always be read using the Read I/O Port function, regardless of the way they are currently configured.

To manually set the state of the RTSI lines, set the source for the specified RTSI line to be NIMC_RTSI_SOFTWARE_PORT. Use the Set I/O Port MOMO function to set the state of the lines.

The signal seen on the RTSI 4 pin is a high pulse of 120 to 150 ns duration. The action specified in the Enable Breakpoint Output function only applies to the breakpoint output pin on the motion I/O connector, not to RTSI pins.

Example 1

To use the signal coming in on RTSI pin 3 to trigger the high-speed capture on encoder/axis 1, call Select Signal as follows:

   flex_select_signal (boardID, NIMC_HS_CAPTURE1, NIMC_RTSI3)

The polarity of the high-speed capture input is specified by the Configure High-Speed Capture function.

Example 2

To output the breakpoint signal for axis 2 on RTSI pin 4, call Select Signal as follows:

   flex_select_signal (boardID, NIMC_RTSI4, NIMC_BREAKPOINT2)

Example 3

To drive RTSI pin 5 with the corresponding bit (bit 5) of the RTSI software port, call Select Signal as follows:

   flex_select_signal (boardID, NIMC_RTSI5, NIMC_RTSI_SOFTWARE_PORT)

To set the state of the RTSI software port, use the Set I/O Port MOMO function.

Example 4

When writing to the RTSI software port by using the Set I/O Port MOMO function, only those RTSI lines that have been configured to control by the RTSI software port are affected. To set the RTSI line back to an input, call Select Signal as follows:

   flex_select_signal (boardID, NIMC_RTSI5, NIMC_DONT_DRIVE)