Example Code

Find Unique values in a DIAdem channel

Code and Documents

Attachment

Download All

Functional Description

The script takes in the channel index, and group index for the channel on which to operate.  The output of the function are 3 channels, the original channel sorted, the channel of all the unique values, and a channel that shows how many time those unique values occur.  The function also returns the number of unique values as an integer.

http://decibel.ni.com/content/servlet/JiveServlet/download/3995-1-5007/UniqueValsScreen.PNG

Caveats and Additional Notes

You may have to modify the function as it expects the channel index parameter to be the last channel in the group.  If it is not you need to modify the code to recognize where the sorted channel will be created.  Also, the code can be easily modified to remove the 3 created channels and simply return the integer if it is disired.

John B.
Applications Engineer
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors