LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically create indicators

Is there a way to programmatically create indicators? I am reading data from "n" number of different sensors. The data is in numeric form. Depending on the number of sensors, I would like to create indicators to display the data on a gauge(or meter). ISay for instance, i am reading data from 7 sensors using Data socket. I would like to show 7 gauges on the display screen with the sensor data. Is it possible to perform this operation programmatically? am using Labview 6i.
0 Kudos
Message 1 of 21
(7,223 Views)
,

There is a very easy work around for this, but no, indicators, as such, cannot be created programmatically.

However; you can create a single gauge, create an array on the front panel, and drop the gauge into the array to create an array of indicators. Now you have complete control over the array. This means you can show how ever many gauges you like.

Please email if you need more help, but that should cover it for you. Remember to display on the front panel the number of elements as are in the array.

I have attached an example. This simply generates a random number of gauges populated with random data.
0 Kudos
Message 2 of 21
(7,222 Views)
> Is there a way to programmatically create indicators? I am reading
> data from "n" number of different sensors. The data is in numeric
> form. Depending on the number of sensors, I would like to create
> indicators to display the data on a gauge(or meter). ISay for
> instance, i am reading data from 7 sensors using Data socket. I would
> like to show 7 gauges on the display screen with the sensor data. Is
> it possible to perform this operation programmatically? am using
> Labview 6i.
>

Assuming you want the values to be placed in a row, column or a grid,
you should be able to make an array of indicators, and set the size of
the array indicator at runtime to show different numbers of elements.

Greg McKaskle
0 Kudos
Message 3 of 21
(7,222 Views)

Hi LabView Guru:

First of all, thank you for the post and the solution.  I have an identical situation as posted before (unknown number of sensors), but in this case, the indicators are in different locations on the front panel. Do you have any ideas on how I should proceed, when I don't know the number of sensors, but want to create indicators that are located at different positions in the front panel.

Thanks

0 Kudos
Message 4 of 21
(7,070 Views)
If you want the indicators distributed over the front panel, I guess you have a maximum number of indicators. As LabViewGure said before, you can't create indicators programmatically. What you can do is this: Place as many indicators as could be required on the front panel. During runtime (when you know how many are required) make the required indicators visible (using property nodes) and the others invisible.

0 Kudos
Message 5 of 21
(7,065 Views)

Hi Dan:  Does this mean that I need to have an unknown number of cases? Here is my situation:  I have an array that dynamically changes its size. I am trying to extract each element of this array and check if that element is within a range, say 0-100.  If it is below 50, I'd like to display a LED with green light and if it's above 50, the LED turns red.  I can do this using the array indexing/comparison functions and get an array/cluster of booleans. But my requirement is that the LEDs are distributed all over the front panel.  It will be nice to have a feature that gradually changes the intensity of the color as the value in the array changes, but that's just nice to have... I have attached a picture of the front panel.  Any ideas/suggestions?  Thanks in advance.

 

 

 

0 Kudos
Message 6 of 21
(7,036 Views)
Attached is a vi that controls the color of several LEDs.  You can also use the control properties to set a value to the control and also its position (referring to your gauges).
Randall Pursley
Message 7 of 21
(7,019 Views)

hi randall:

Thanks for posting the code.  Could you explain the logic you've used? I am not able to understand where the numbers 255 and 511 come from and what they do? Thanks again.

km

0 Kudos
Message 8 of 21
(7,007 Views)

You might be able to simulate this with a picture control. See this thread.

http://forums.ni.com/ni/board/message?board.id=170&message.id=24151

Message 9 of 21
(6,997 Views)
I don't have LabVIEW here so I can't give you an example VI. But you don't need a case structure for each indicator.
If you place multiple indicators on the front panel you can build an array of their references. Then, for each element in your array, index the corresponding indicator reference and make the indicator visible/invisible.
If you want color intensity you can use color boxes instead of boolean indicators. As an easy example you can use greyscale: map the values to be in the range 0..255 (in your example multiply the value with 2.55). Then, use the color component to color VI (don't know the name exactly, but it takes U8 RGB values to create a U32 color), wire the value to all inputs (R,G,B) and put the color to the color box.

Would be easier to show with an example VI, but as I said I don't have LV here...

0 Kudos
Message 10 of 21
(6,983 Views)