flex_configure_drive_signal |
Configure Drive Signal
Usage
status = flex_configure_drive_signal(u8 boardID, u8 axis, u16 port, u16 pin, u16 mode, u16 polarity);
Purpose
Configures the drive signal.
Parameters
Name | Type | Description |
boardID | u8 | assigned by Measurement & Automation Explorer (MAX) |
axis | u8 | axis to configure |
port | u16 | general-purpose I/O port (NIMC_IO_PORT1 to NIMC_IO_PORT8) or HSC software port (NIMC_HSC_PORT) to control |
pin | u16 | specific bit in the port (0 to 7) |
mode | u16 | mode that the pin will be reserved for |
polarity | u16 | polarity applied to the requested pin |
Parameter Discussion
axis is the axis to configure. Valid values are NIMC_AXIS1 through NIMC_AXIS30. On motion controllers that support fewer than thirty axes, configuring non-existent axes returns error 70006 (NIMC_badResourceIDOrAxisError). Refer to Axes for axis resource IDs.
port is the general purpose I/O port (NIMC_IO_PORT1 to NIMC_IO_PORT8) or HSC software port (NIMC_HSC_PORT) that you are controlling with the drive signal. Refer to 73xx Controller General-Purpose I/O Port IDs for I/O port resource IDs and constants.
pin is the specific bit in the port (0 to 7) specified by port. For the HSC port, trigger 1 = pin 0, trigger 2 = pin 1, trigger 3 = pin 2, trigger 4 = pin 3, trigger 5 = pin 4, trigger 6 = pin 5, trigger 7 = pin 6, and trigger 8 = pin 7.
mode is the mode that the pin will be reserved for. Options for mode are NIMC_DRIVE_SIGNAL_CLEAR_ALL (0), NIMC_IN_POSITION_MODE (1) or NIMC_DRIVE_FAULT_MODE (2). If a DIO or high-speed capture line has been reserved for a drive signal, I/O functionality is blocked for the reserved pin. You must use the Read Drive Signal Status function to read the status of this signal. NIMC_DRIVE_SIGNAL_CLEAR_ALL (0) clears any reservations for In-Position or Drive Fault signals for the specified axis. Use this mode to unconfigure I/O lines and reset them to their default functionality.
polarity is the polarity applied to the requested pin. Valid options are NIMC_ACTIVE_HIGH (0) or NIMC_ACTIVE_LOW (1).
Using This Function
Use this function to configure and reserve I/O lines to receive signals from the drive. The following drive signals are available: In-Position and Drive Fault (Servo Alarm).
Tip Use Configure Motion I/O Map instead of this function for additional drive signal support. |
Use the In-Position drive signal when the drive is controlling a servo motor and the input to the drive is step/direction. This signal tells the motion controller when the drive considers the motor to be at the commanded position.
When the In-Position drive signal is configured, the Move Complete status is linked to the state of the In-Position signal. The move is not considered complete unless the In-Position signal is active.
Note Refer to Write Trajectory Data to add or remove this signal from the move complete criteria. |
Use the Drive Fault drive signal to connect a servo alarm signal to the motion controller so that when an alarm or other drive fault occurs, the motion is stopped using a kill stop. A kill stop disables the control loop and zeroes the DAC so that frictional forces stop the motion.