LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic mechanical action button

Does anyone know if you can change the mechanical auction property of a button on the fly.  I looked at using a proptery node, but couldn't find the right element.
 
Thanks
Trevor 
0 Kudos
Message 1 of 18
(5,024 Views)

Hi Trevor,

There is no way to programmatically change the mechanical action of a Boolean.  I recommend that if you need this functionality, you have two booleans on your front panel, and make one or the other visible depending on which mechanical action you need.

Good luck,
-D

0 Kudos
Message 2 of 18
(5,017 Views)
maybe another way is to use the events (mouse up/down) and handle it flexible by code?  
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 3 of 18
(5,006 Views)

I would second the event structure.  With dynamic event registration you can now really control the mechanical action of  a button do do almost anything.  you want to handle the mouse down, mouse up, and value change events (possibly filtering events) to do what you need.  Using 2 buttons can complicate your logic in the longrun and break the data flow.  also polling architectures can miss events and cause some difficulty if you want to do multithreaded concurrent programming.

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 4 of 18
(4,995 Views)

Hi,

 

I was searching the forum for a dynamical mechanical button and found this thread, which is exactly what I was looking for.

 

I have created a small vi with an event structure and a button which acts either as a push button or a switch. I have used local variables in this vi. How can I avoid using local variables?

 

 

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 5 of 18
(4,601 Views)

I have modified the example a little.

 

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 6 of 18
(4,592 Views)

no help?

 

21267iFCD1AFB0AFFC6E8A

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 7 of 18
(4,573 Views)

 


@johanneshoer wrote:

 

I have created a small vi with an event structure and a button which acts either as a push button or a switch. I have used local variables in this vi. How can I avoid using local variables?

 


 

You could use the CtlRef terminal and a property node to write to the Value property of the Boolean.  But, this is actually worse than using a local.  Locals are not inherently evil, and in a case like this a simple wire won't work.

 

Once you drop an Event Structure onto a BD, most if not all dataflow bets are off.  Locals are an effective band-aid in this case and a small price to pay for the power of the Event Structure.

 

Your warriness is good.  As I typically say, locals are to be understood, respected, but not feared.  And although they may save your bacon here, let's not allow them to be your new best friend...

Message 8 of 18
(4,558 Views)

I think you should start with to question yourself about wheter why you need such control, because you proberbly made a flaw during the design of your program.

0 Kudos
Message 9 of 18
(4,550 Views)

@WouterG wrote:

I think you should start with to question yourself about wheter why you need such control, because you proberbly made a flaw during the design of your program.


I stumbled upon this string because I'm trying to do the same thing, namely have a front panel button at times act like a "Latch" and at times like a "Switch".

 

I'm writing a VI that acts as a test/control routine for part of a fairly large and complex Real Time system implementing a psychophysical experiment.  We are asking people to localize a sound source, with the stimulus consisting of either a brief train of 5 pulses, or a continuous train.  In the first case, we want to send a "trigger" to the sound-generator (i.e. a brief pulse whose rising edge starts the sound), in the second we want to send a "gate" (a signal that is High as long as we wish the sound to keep playing).  The sound generator "knows" whether it's getting a trigger or gate based on the number of pulses we ask it to send (we use "0 pulses" to mean an infinite train, until we say "stop").

 

My tester VI has a front panel with a button called "Stim" and a dial called "Number of Pulses", ranging from 0 to 10.  If the number of pulses is 0 (i.e. "Go as long as Stim is True"), I want the Stim control to act like a switch -- push once for True (On), once for False (Off).  However, for a finite train of pulses, I want it to generate a trigger, which the "Latch" behavior will facilitate (push to turn On, read in Event Structure which automatically turns it off).

 

Bob Schor

0 Kudos
Message 10 of 18
(4,446 Views)