flex_not_var

NI-Motion Functions

flex_not_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

Invert Variable

Usage

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

Purpose

Performs a bitwise inversion (NOT) on the value in a variable and returns the result.

Parameters

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

Parameter Discussion

variable1 is the location of the variable to invert. 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.

Using This Function

This function performs a bitwise logical NOT on the value in the selected variable and returns the result to the destination specified by the returnVector.

~(V1) = Result

where:
V1 is the value at variable1.
Result is stored in the location pointed to by returnVector.

The result can be returned to a new variable or to the input variable, returned to the host computer, or thrown away. In all cases the EQUAL condition code is set True if the result equals zero (all bits low) and False if any bit is set. The GREATER THAN and LESS THAN codes are also set but can be confusing after logical bitwise operations.

Example

If the value in variable1 is 0x0000 5A5A, the result of the bitwise NOT is 0xFFFF A5A5. The EQUAL condition code is set to False.