Data Operations VIs
Data Operation VIs include the available math VIs on general-purpose variables. Variables can be loaded, added, multiplied, ANDed, and so on before being used as data in a motion control VI.
General-purpose variables are 32 bits long and can be used either signed (i32) or unsigned (u32). All Data Operation VIs operate on 32-bit values and return 32-bit values. You must be careful to avoid overflow and underflow conditions. For example, multiplying two 32-bit variables and returning the result to a 32-bit variable might overflow and wrap around.
Smaller sized data is right aligned within a 32-bit variable. Bitwise logical VIs always assume this alignment and return similarly aligned results.
Many NI-Motion VIs can take input data from a general-purpose variable by pointing to the variable with the input vector parameter. Similarly, all read VIs can return data to a general-purpose variable by using the return vector parameter, refer to Input and Return Vectors.
All data operation VIs set condition codes (less than, equal to or greater than zero) depending on the result of the operation. Your program can test these conditions with the Jump to Label on Condition VI. Executing a data operations VI with a return vector of zero (0) tells the program to set the condition code and then throw the resulting data away. In this way, you can use all the data operations VIs as tests for conditional branching.
You can use indirect variables as variable inputs or return vectors with all data operation VIs.
Click the icons for VI descriptions.
Add Variables | Exclusive OR Variables | |
Subtract Variables | Invert Variable | |
Multiply Variables | Logical Shift Variable | |
Divide Variables | Load Constant to Variable | |
AND Variables | Read Variable | |
OR Variables |