LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Elegant FieldPoint Array Deconstruction

I am wondering.  When you acquire many FieldPoint channels, one typically uses arrays.  The FieldPoint Read returns a value than when auto-indexed at the For Loop output is itself an array.  At some point one needs Indicators for those FieldPoint Channels to show their values on the Front Panel.  I have been using a construct like the VI attached here where the array of FieldPoint values goes into a For Loop (auto-indexed) and inside that For loop there is a Case structure where the For Loop iteration counter is wired to the Case Selector.  In each and every Case, I place a Front Panel Indicator.
 
It seems to me there must be a better way to do this.  Does anyone have a suggestion?
 
One other question:  how does one get the numeric value of an enum?  When I Index Array an array of enums it returns the text portion.  I want the integer so I can compare it to other integers.
 
Thanks in advance for your help.
0 Kudos
Message 1 of 2
(2,442 Views)
You don't explain your actual display needs, so I will just give some general advice -
 
First, to speed things up - you can read the All channel, which would return all the channels in the I/O module in an array.
 
Second, as you mentioned, if you simply index the reading out of the for loop, you will get a 2D array, which you can display.
 
If you want a different number of channels for each display, you can bundle the 1D array into a cluster (just use a bundle node) and wire that cluster out of the loop. You will get a 1D array of clusters which have a 1D array each.
 
If you want the readings to be in different places in your screen, then what you're doing is basically it. You could make it cleverer, but it would probably make it too complicated for you.
 
As for the enum, the numeric palette has a conversion subpalette which you can use to convert the enum to a U16 or U32. Another option would be to typecast it which should also work.

___________________
Try to take over the world!
Message 2 of 2
(2,436 Views)