LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control and indicator at same time...how?

Hi all,
I need to build a panel in wich I can insert 5 params. What I want is
modify 4 params and calculate the 5th param. I have formulas for every
expression, but I can't use an indicator as control and vice versa.
Sometimes I have to calculate the 3rd param in function of the other
params, sometimes I have to calculate the 1st...and so on. How can I use
the same "entity" as indicator and as control? Excuse me for my bad
english and thenks a lot for your precious help.

Regards
CiccioSPICE


--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
0 Kudos
Message 1 of 7
(6,894 Views)
About the simplist method to do this is to use local variables. Decide if the enties are more often indicators or controls, and make them such, then use local variables to read or set the values as needed. For what you have said, I think that it would be more appropriate to make the enties controls, since 4 are being read at a time, and the fifth is being written to.
Jon D
Certified LabVIEW Developer.
0 Kudos
Message 2 of 7
(6,894 Views)
Local variables permit this. You can find some examples on how they're used by going to Help>Find Examples>Fundamentals>Local and Global Variables.
0 Kudos
Message 3 of 7
(6,894 Views)
You can use local variables for this. However, I would suggest using Property Nodes instead. You can read and write to the control by accessing the Value property of a front panel control. So, it behaves like a local variables, but with one benefit (which may be significant). When you read from a local variables, LabVIEW makes a copy of that data in memory. Therefore, for every local variable you use in your program, you're using more memory. Property nodes don't do this, however, so they're a little more efficient.

To create a Property Node for a control, right-click on the front panel control and select Create >> Property Node. Then right-click on this Property Node on the Block Diagram and select the Value Property. If you right-click on that property na
me, you can set it to either read or write.
J.R. Allen
0 Kudos
Message 4 of 7
(6,894 Views)
It might be useful to think of this problem in another way.

The 5 controls can be left on the panel, in addition to a sixth "answer" indicator. The fifth control (The one being calculated can simply be grayed-out. The "Subtitle" of the indicator will need to be re-assigned each time (The names cannot be changed in run-time), and the value produced set equal to the 5th, grayed-out control. The calculation is then performed within a case statement, taking the 4 variables and producing the 5th.

Then again, maybe it`s simply too complicated.

Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 5 of 7
(6,894 Views)
It is my understanding that property nodes are indeed more memory efficient, but can slow execution time. This is due to the block diagram needing to interact with the front panel in order to retrieve the value of a control. So, the normal tradeoff applies, more memory used and slightly faster, or less memory used and slightly slower.
0 Kudos
Message 6 of 7
(6,894 Views)
Whether LabVIEW reads a local, global or value property, it makes a copy of the data. So it is best to use a local since it is more efficient.


LabVIEW, C'est LabVIEW

0 Kudos
Message 7 of 7
(6,894 Views)