flex_read_var

NI-Motion Functions

flex_read_var

Device Compatibility

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

Read Variable

Usage

status = flex_read_var(u8 boardID, u8 variable1, u8 returnVector);

Purpose

Reads the value of a variable and returns the result.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
variable1 u8 variable to read
returnVector u8 destination for the return data

Parameter Discussion

variable1 is the variable to read. Valid inputs are variables (0x01 through 0x78) and indirect variables (0x81 through 0xF8).

returnVector indicates the destination for the return data generated by this function. Available return vectors include return data to the host (0xFF), to a variable (0x01 through 0x78), to an indirect variable (0x81 through 0xF8), and return no data (0). Refer to Input and Return Vectors for more detailed information.

Note  The suffix _rtn on the function indicates that the data must be returned to the host. When this calling convention is used, no returnVector is required.

Using This Function

This function reads the value of the selected variable and returns it to the destination specified by the returnVector.

When the value of returnVector is set to Return to Host (0xFF), this function returns the value to the return data buffer.

The condition codes are set according to the value read: GREATER THAN, LESS THAN, or EQUAL to zero.