Axes

NI-Motion Functions

Axes

An axis consists of a trajectory generator, PID or stepper control block, and some sort of output resource, either a digital-to-analog converter (DAC) output or a stepper pulse generator output. Servo axes must also have some sort of feedback resource, either an encoder or ADC channel. Closed-loop stepper axes also require a feedback resource, and can use either encoder or ADC inputs. Open-loop stepper axes do not require feedback for correct operation. The following table lists the resource IDs and constants for axes:

Resource Name Resource ID Constant
Axis Control 0 (0x00) NIMC_AXIS_CTRL
Axis 1 1 (0x01) NIMC_AXIS1
Axis 2 2 (0x02) NIMC_AXIS2
Axis 3 3 (0x03) NIMC_AXIS3
Axis 4 4 (0x04) NIMC_AXIS4
Axis 5 5 (0x05) NIMC_AXIS5
Axis 6 6 (0x06) NIMC_AXIS6
Axis 7 7 (0x07) NIMC_AXIS7
Axis 8 8 (0x08) NIMC_AXIS8
Axis 9 9 (0x09) NIMC_AXIS9
Axis 10 10 (0x0A) NIMC_AXIS10
Axis 11 11 (0x0B) NIMC_AXIS11
Axis 12 12 (0x0C) NIMC_AXIS12
Axis 13 13 (0x0D) NIMC_AXIS13
Axis 14 14 (0x0E) NIMC_AXIS14
Axis 15 15 (0x0F) NIMC_AXIS15
Axis 16 177 (0xB1) NIMC_AXIS16
Axis 17 178 (0xB2) NIMC_AXIS17
Axis 18 179 (0xB3) NIMC_AXIS18
Axis 19 180 (0xB4) NIMC_AXIS19
Axis 20 181 (0xB5) NIMC_AXIS20
Axis 21 182 (0xB6) NIMC_AXIS21
Axis 22 183 (0xB7) NIMC_AXIS22
Axis 23 184 (0xB8) NIMC_AXIS23
Axis 24 185 (0xB9) NIMC_AXIS24
Axis 25 186 (0xBA) NIMC_AXIS25
Axis 26 187 (0xBB) NIMC_AXIS26
Axis 27 188 (0xBC) NIMC_AXIS27
Axis 28 189 (0xBD) NIMC_AXIS28
Axis 29 190 (0xBE) NIMC_AXIS29
Axis 30 191 (0xBF) NIMC_AXIS30

Functions that can operate on multiple axes simultaneously, such as Read Blend Status and Start Motion, can take the axis control (NIMC_AXIS_CTRL) as their resource parameter.

Use the appropriate constant value defined in the MotnCnst.h or motncnst.bas file. For example, to use axis 9 with the Configure Axis Resources function, pass NIMC_AXIS9 for the axis parameter:

status = flex_config_axis(u8 boardID, NIMC_AXIS9, u8 primaryFeedback, u8 secondaryFeedback,
                          u8 primaryOutput, u8 secondaryOutput);