From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Imitate boolean switch behavior using an event structure on a front panel indicator

Hi,

 

I am looking for a possibility to imitate the bevhavior of a boolean switch with an event structure. To be more precise, I want a boolean value to change each time I click on the front panel indicator and then remain constant until I click again. I have not worked with shift registers in a while loop yet, but could this be a way to find a solution?

0 Kudos
Message 1 of 5
(2,467 Views)

Hi Snow,

 

definitely yes...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,466 Views)

Okay, I figured it out, BUT I still have a problem. Before I first trigger a mouse event on the front panel indicator, I already need the case structure to be executed once. Therefore I assume that I need some kind of default value, but since the event structure does not create any output at first, I have no idea how to do that.

0 Kudos
Message 3 of 5
(2,450 Views)

One method to get this type of behavior is to use the timeout event for initialization

Untitled.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 5
(2,440 Views)

@LordSnow wrote:

Okay, I figured it out, BUT I still have a problem. Before I first trigger a mouse event on the front panel indicator, I already need the case structure to be executed once. Therefore I assume that I need some kind of default value, but since the event structure does not create any output at first, I have no idea how to do that.


Are you talking about the shift register you just created?  You can while in a default value on the left shift register ndoe.  It is wired outside of the loop.

 


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(2,439 Views)