Math Operations

NI-Motion

Math Operations

Note  This section applies only to NI 73xx motion controllers.

NI-Motion always performs math operations on values stored in onboard variables, and all math operations set a global condition that the Jump to Label on Condition VI or the Jump on Event function uses to determine if the operation jumps to a particular label in the onboard program.

To load the onboard variables, use the Load Constant to Variable VI or function or point the return vector in the Read functions to the onboard variable where you want the data to be saved. In the previous example, the ADC channel is read to onboard variable 2. This value is then multiplied with a scale factor loaded into variable 1 using the Load Constant to Variable VI or function.

You can perform Add, Multiply, Subtract, Divide, AND, OR, XOR, NOT, and logical shift math operations. The condition code always reflects the last math operation performed. Less Than implies less than zero, Equal implies equal to zero, and so on.