LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help a Noob manage many channels and build an elegant program

I don't think there is a way to change background colors for individual items in an array.

 

An alternative though, if you wanted to avoid creating 64 indicators, would be to create an array of clusters to display the status of the channels.  The cluster would contain the channel name, the current value, the min/max values, and an LED or some other indicator to show the status of the channel. 

 

You can use the "Index & Bundle Cluster Array Function" to transform several arrays of differing data types (string for channel name, double for value/min/max, bool for status, etc) into one array of clusters which contain those data types.  See the documentation to understand what I mean.  You can then display this entire array or a subset of it on your front panel.  The advantage of using this method would be that you don't have to track and position and wire and name a whole bunch of indicators.

 

Bonus points if you create a type-def for the cluster, which is a way to make your code more maintainable.

Message 21 of 33
(1,068 Views)

I'll have to work on all that tomorrow. I don't know much about how clusters work, but i'll do some reading up on it tomorrow.

Right now i'm just trying to get my min/max to function, but I realized i can't put a shift register on the FOR loop inside the WHILE loop. Maybe I have to index the channels out of the array for min/max on each channel and put the FOR loop outside of the WHILE...

minmaxforloop.PNG

0 Kudos
Message 22 of 33
(1,061 Views)

@LabNoob14 wrote:

Right now i'm just trying to get my min/max to function,  


You need a shift register on your WHILE loop to hold the max values.  You need to initialize it to have as many elements as you have channels.  That is what the Initialize Array was for in the example I gave you.

 

Also, I relearned today that the Max/Min works with arrays.  Do you do not need a FOR loop around it.

 

Finally, you might want to look at using a Table to display your values.  One column can be the current value and a second column shows the max value.  Also with tables, you can color individual cells.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 23 of 33
(1,057 Views)

but a task can't be used with initialize array, it needs to have physical channels right?

initializearray.PNG

0 Kudos
Message 24 of 33
(1,042 Views)

Why can't you have an array of tasks?  Have you tried it?

0 Kudos
Message 25 of 33
(1,035 Views)

@LabNoob14 wrote:

but a task can't be used with initialize array, it needs to have physical channels right?

 


Use a DAQmx Task Property Node.  Wire that up to the task.  There is a property to get the number of channels.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 26 of 33
(1,034 Views)

Works good!

Now I've got to find a way to get these BG colors to display what I want them too.

Each box with a reading in it needs to independently display it's own color.

 

Current temp goes from blue(coolest) to red(hottest) which I have some math to achieve that, but only for a single indicator.

 

Max temp is pass/fail(green/red). The fail limit is controlled by the user which is also the red limit for Current temp. I have the code for that function as well.

 

Use a table: I know I can use a table which crossrulz explained earlier, but this doesn't allow me to organize the position of the boxes on the front panel.

 

The concept for the front panel is that it will mimic the physical locations of the TCs on the walls inside the box showing current temp and max temp for each position.

 

With my limited LV knowledge I think I'm going to have to use individual indicators to achieve the concept goal. Am I wrong?

 

So this means in order to complete the front panel there with be 128 indicators 64 current temp/64 max temp (3 more 9213s to add in the code)

 

Would it be a good idea to make a sub VI to do the work for the indicators? So that it can be copied 63 more times?

0 Kudos
Message 27 of 33
(1,023 Views)

@LabNoob14 wrote:
The concept for the front panel is that it will mimic the physical locations of the TCs on the walls inside the box showing current temp and max temp for each position.

Perhaps 4 tables, one for each wall/task?

 

Another option is to make a cluster for all of the indicators and you can use an Array To Cluster function.  That would take care of all of your values.  We could do the coloring by getting the array of controls in the cluster (property node) and then loop on the references to set the color.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 28 of 33
(1,018 Views)

I'll give it a shot, it's going to take a little while for my noobness to figure out lol.

 

The TC's on the wall are position something like this(below) I don't know if a table can do that.

TClocations.png

0 Kudos
Message 29 of 33
(1,015 Views)

@LabNoob14 wrote:

The TC's on the wall are position something like this(below) I don't know if a table can do that.

 


Yeah, if you want to mimic that, then you will definitely want to go the cluster route.  At the top of my head, I am thinking you should use a cluster for each wall/task.  Then we can exploit a bunch of reuse.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 30 of 33
(1,010 Views)