LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to dinamically convert an indicator to control?

Solved!
Go to solution

Hello all,

I need to write an application that:

1) Reads an array of strings from a file, and show it on a indicator (and this is correctly done)

2) Edit the array, as it was a control

3) Elaborate the strings (My array is a list of SPI commands, that are sent to an external device)

4) Optionally, save the modified array back to a file

 

How can this be done? It's not possible to think of a property node that converts the indicator to control, because the indicator is connected to a source of data, and the control should be connected to a destination... (an SPI driver in my case)

I somehow need an item with two connections, one entering and one exiting.

 

Thanks

0 Kudos
Message 1 of 12
(4,267 Views)
Solution
Accepted by xdaf

Hello... 🙂

 

Try to do this with local variable of that indicator.. So you will be able to use it as indicator as well as control... 🙂

 

Just a thought.. 🙂

Message 2 of 12
(4,260 Views)
You could use a control and use the disable property node to make it appear to change between a control and indicator. You could write to the control using property nodes / variables when needed.
_____________________________
- Cheers, Ed
0 Kudos
Message 3 of 12
(4,258 Views)

Hello xdaf,

You could use local variables of an array command

 

Message 4 of 12
(4,258 Views)
Exactly what I wanted to say... Thanks AntoineP.. 🙂
Message 5 of 12
(4,249 Views)

Hello all,

and thanks for your replies!

I think I've adopted a solution similar to the one you suggested, obtaining this front panel (see "frontpanel1.jpg" attachment)

 

The frontpanel I'd like to obtain is the one depicted on "frontpanel2.jpg": one structure (control or indicator?) used both to edit and to view what I load from file.

 

Maybe the only solution is to overlap a control and an indicator, and to toggle the "visible" property...

Download All
0 Kudos
Message 6 of 12
(4,221 Views)

I would just use an indicator, with the actual contents of the array held in a shift register. When a change is made to the sequence, save the shanges to the shift register and update the indicator.

 

If you want to be able to enter data into the element. Then I would use a string control, and enable / disable the control to allow editing.

Message Edited by yenknip on 09-24-2008 02:00 PM
_____________________________
- Cheers, Ed
0 Kudos
Message 7 of 12
(4,212 Views)

Now I understand what you mean... and it's working!!!

For a given control, I can creat two local variables: a readable one and a writable one.

Thanks to everybody!

Message Edited by xdaf on 09-24-2008 04:26 PM
0 Kudos
Message 8 of 12
(4,192 Views)

Please note that local variables should be used with caution, and in most cases are not even necessary. Also, local variables can lead to race conditions.

 

Personally, I would look for a more elegant solution than using local variables. 

0 Kudos
Message 9 of 12
(4,181 Views)
I think a variable is justified, because the array is being initialised from a file, before allowing the user to edit the elements. If the control is disabled then there is no scope for race conditions
_____________________________
- Cheers, Ed
0 Kudos
Message 10 of 12
(4,177 Views)