08-27-2009 08:45 PM
Hi,
I am trying to change the boolean button property 'operation'( i.e. latch or switch when pressed) during run-time. I was exploring on the 'property node' but seemed not find any suitable one to realize that.
The result I want to achieve is that 'Engineer A could change the property of the button to control the program while operator A only presses the button.'
How should I realize that? Could anyone give me an simple example about this?
Cheers,
SSR
08-27-2009 09:28 PM
Not really.
And why would you want to? Your best bet would be to make the mechanical action Switch and simulate the Latch part of the action when needed by programmatically writing a False boolean to it by way of an event structure.
There is a way to change the action programmatically, but it requires scripting. And it also requires the VI to not be running but in Edit mode. I really don't think you should be trying to use that.
If you can give a clearer idea why you want the action to be switch sometimes and latch other times, there may be some other way to have that sort of behavior.
08-27-2009 09:40 PM
Hi thx... I was trying to use is to control a case structure. The case structure has two states. My program is actually mainly in one state and the other empty one is set as the default case. Thus by triggering the button either latch or switch, the real program will be executed once or continuously.
Thx. Then do you have any simpler idea?
08-27-2009 10:34 PM
This idea comes from Oscilloscopes, even the way NI did it in its Virtual Bench software.
Have two buttons, one is set for switch and is called Run Continuous. The other is set for Latch and is called Single Shot. Put both functions through the OR boolean and feed that result to the case structure. The user hits whichever button they need.
08-28-2009 01:25 AM
Haha..thx a lot... actually what I did is the same.. I was wondering whether I could only use one button instead while gives the control over to the engineer. While due to the complexity of the change, I think I still use the two buttons method.
Thx a lot
08-28-2009 01:01 PM
Maybe you could simulate this by having the two buttons identical looking and on top of each other. Then have a login or something to distinguish "Operator" from "Engineer" and have the appropriate buttons hidden and displayed depending on who logged in.
Bill
08-30-2009 02:49 AM
billko wrote:Maybe you could simulate this by having the two buttons identical looking and on top of each other. Then have a login or something to distinguish "Operator" from "Engineer" and have the appropriate buttons hidden and displayed depending on who logged in.
Bill
you don't really need two buttons overlapping on each other for that. Another flag that tells what mode the one and only button should run in, will do the trick.
08-31-2009 09:40 AM
NitinD wrote:
billko wrote:Maybe you could simulate this by having the two buttons identical looking and on top of each other. Then have a login or something to distinguish "Operator" from "Engineer" and have the appropriate buttons hidden and displayed depending on who logged in.
Bill
you don't really need two buttons overlapping on each other for that. Another flag that tells what mode the one and only button should run in, will do the trick.
I agree with you, but I was trying to work within the customer constraints - i.e. he settled on two buttons but would like a one-button solution if possible. My suggestion was to make it appear to be one button, yet function as two. 🙂