LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Text Box Updating

Hello Group,
 
I have a "clear to start" tab on my app which is checking various inputs and if they are all ok it will enable a button.
I can obviously just wire the digital inputs into booleans and it will show red or green. But the operators also want some text next to the button saying ok/fail , locked/unlocked etc.
I can populate an array at the programme start up and choose the text to show in the string indicator next to each boolean depending on the booleans state.
 
Would there be much of an overhead if i just kept updating this text whether it changes or not on every loop iteration or would it be best to check if the boolean has actually changed before updating. It just seems i would need to write quite a bit of code to remember the previous boolean value and compare with the new one as i have about 30 of these dotted over the screen and im not sure whether its actually worth doing this as i cant see there being much overhead, i mean if the text in the string control is the same anyway, would the system even bother doing a screen update? Is there any difference wiring the text into the string indicator or a shared variable for it?
 
Hope someone can shed light on this for me
 
Thanks
 
Mike
 
 
 
0 Kudos
Message 1 of 5
(4,415 Views)

Hey Mike,

      I think I understand your question - keep it simple, but less efficient, or clutter the diagram with a lot of logic to make it more efficient(?)  I'd ask you to post your code, but am a bit wary when you say "i have about 30 of these dotted over the screen" because many people don't "leverage" the organizational benefit of using clusters and arrays to simplify the diagram/logic - I'm guessing there are at least 30 terminals on your diagram and it seems you need to handle each independently(?)  If I'm off-base, sorry, maybe you could post some code or a screen-shot of the diagram.  The point is, handling one array or cluster versus 30 seperate values may change the "complexion" of this question...

Cheers! 

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 5
(4,394 Views)
Hi thanks, i think you have it sport on and yes i do have 30 terminals on the diagram.
Unfortunately im not at work at the mo, so cant post the code, but basically im having to use the DSC module to read in some data from some Allen Bradley equipment. I therefore have a terminal and a shared variable from the DSC (think thats the right term im using there, basically equivalent to reading via the old datasocket method)
And yes i then need to handle each idependently, i.e. main door closed, engine locked, crane docked etc etc. All just digital ins.
I just know that when i did something before a while back which changed the colour of a boolean, it really slowed the programme down if i just kept updating it regardless of if it was the same, so i put logic in to only update the colour if it had changed. I was wondering whether it will make much of a difference in this case if im updating a text field over and over..Its times like this when i wish there was a value change event for non user initiated events
 
i dont really want to put aheap of code in and make the diagram messy if it doesnt really need it from an efficiency basis, but as stated from previous experience on colour changing, i know it had a big impact there


Message Edited by MikeW1973 on 01-19-2008 03:36 AM
0 Kudos
Message 3 of 5
(4,389 Views)
Hi Mike, are you updating FP objects via their property-nodes or by reference?  I have seen code slow-down significantly while doing that.  There's a FP.Property - "Defer Panel Updates" that greatly speeds things up when doing updates by reference/property-node.  One Disables FP Updates, does the updates, then Enables FP Updates again.

Its times like this when i wish there was a value change event for non user initiated events

This sounds a lot like the "Value(Signalling)" property of controls - it's near the bottom in the same property-group as "Value".  One can have an event-case triggered when a control/indicator is updated via its "Value(Signalling)" property - though I don't really think that's what you meant...


Message Edited by tbd on 01-19-2008 04:32 AM
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 4 of 5
(4,382 Views)
Back to your original question, you can easily populate a text string by using the boolean text associated with any boolean.  It is most obvious with the dialog checkbox control, but all have it.  Depending on the control, the default is single-valued or changes value depending on the value of the control.  You can change this in the properties dialog.  If you don't lock the boolean text to the center of the control, you can move it off to one side where it would be more useful for your application.

Let us know if you need more help.
0 Kudos
Message 5 of 5
(4,253 Views)