Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
2 ratings:
 3 out of 5     Rate this Document

Using the Compound Arithmetic Function in LabVIEW



Primary Software:
Primary Software Version: 6.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I am using the Compound Arithmetic function with the XOR operation in LabVIEW. This function seems to act differently compared to using individual XOR functions. What method does the Compound Arithmetic function use for calculating the XOR result?

Solution:
The Compound Arithmetic function performs arithmetic on one or more numeric, array, cluster, or Boolean inputs. You can select the math operation (Add, Multiply, AND, OR, or XOR) by right-clicking the function and selecting Change Mode from the shortcut menu. The default mode depends on the palette from which you drop this function. If you drop this function from the Numeric palette, the default mode is Add. When you drop this function from the Boolean palette, the default mode is OR.

When you use the Compound Arithmetic function to perform an XOR operation on 3 or more values, the Compound Arithmetic function performs a XOR operation on the first pair of inputs, and then performs a XOR operation on the result of the first pair of inputs and the next input, and so on until all inputs have been processed.

With the XOR operation, if both inputs are TRUE or both inputs are FALSE, the function returns FALSE. Otherwise, it returns TRUE.

Below are two screenshots of programs that demonstrate the equivalent behavior.

Using the Compound Arithmetic function



Using Individual XOR functions




Related Links:

Attachments:


Separate Correct.jpgCompound Correct.jpg


Report Date: 12/06/2005
Last Updated: 03/02/2006
Document ID: 3S5GFN6S

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit