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: 

"Latch When Released" won't work

Hello,

 

I'm using boolean buttons with the mechanical action "latch when released" directly on the front panel. I palced the button within the eventcase "value change" of the event structure in the block diagram:

 

latch.PNG

 

But sometimes the latch action won't work. The button stays pressed when clicking on it although the event case has finished its code. A new click on it will reset the button and run the case again. It seems that LabVIEW won't read the button within the block diagram.

I tested manually resetting the button with a local variable and the mechanical action "switch when pressed" but it won't work, too.

 

This error occures when running my application as executable (generated by the application builder). From LabVIEW itself it always works.

 

Is this a LabVIEW bug or is it my fault?

 

Regards

0 Kudos
Message 1 of 12
(6,678 Views)

Hello Mathias,

 

When the code inside the event case is really executed, it seems like a bug. But you should check that carefully. As a workaraound: does it help, to wire the boolean terminal to the border of the event case? Perhaps this forces LabVIEW to read the Bool in another way. But it remains a bug anyway.

Greets, Dave
0 Kudos
Message 2 of 12
(6,667 Views)

Hello Dave,

 

the code inside the event structure has really executed. I'm sure. Because I can click other buttons handled within the event structure and all events will work fine. Only the reset of the buttons won't work.

And the mechanical action is set to "latch when released", I checked it again.

 

When I run my application directly from LabVIEW, it works.

 

I tried to connect the boolean values to the border of the event structure and it still won't work.

 

The buttons itself are type definitions (not strict, only the normal type definition).

But that's not the problem. I tested it.

 

I did rebuild my executable 4 times. The 1st 3 times the latch action won't work. The 4th time it worked.

That's very strange.

 

Regards

0 Kudos
Message 3 of 12
(6,655 Views)

Matthias,

 

can you post a small example showing this behavior?

 

As i understand, the issue is only within an EXE, not during development. Correct?

What version of LV/LV RTE are you using? Is it on the same machine?

 

thanks,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 12
(6,639 Views)

Hello,

 

I tried to create a demo, but in the demo it always works.

It is a project with about 800 VIs and I'm not allowed to post it here (and that doesn't make sense for you to look though all the code).

 

Yes the problem is only within the exe, not during development.

 

I'm using LabVIEW 2011 SP1 and the standard run time engine.

And yes it's on the same machine, but on other machines, where LabVIEW is not installed, I have the same problem.

 

Regards

0 Kudos
Message 5 of 12
(6,636 Views)

Is it possible, that you have

a) a second event structure configured on UI elements somewhere in your VI?

b) you have property nodes on this button which might be in conflict? 

c) the behavior is true if you previously pressed a button taking longer during execution and the (during that execution) pressing the OK button leads to this?

 

One thing you might want to check:

Disable debugging over all your sources in the development environment. Run in there. Behavior still different?

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 12
(6,632 Views)

Hello Norbert,

 

in the main VI I use one event struture. But within the event cases I called some subVIs which could include an own event structure (the function of the subVI is like a menu with only some buttons).

In the subVIs the latch action works I think.

 

Yes I'm using property nodes for these buttons to set the position and the caption.

 

I can't click twice on the button during the event case is running. Because it looks like the following:

Button click in main VI -> subVI is called in modal mode (window appearance) -> button in subVI is clicked -> some data is sent through notifiers -> subVI is closed -> event finished

 

What do you mean? I should disable the debugging function in every single VI (VI settings -> Execution)?

I disabled it in the build specifications and that's ok, too isn't it?

 

Regards

0 Kudos
Message 7 of 12
(6,625 Views)

Building an EXE without setting it to "debuggable" will automatically disable this for all VIs (in the build, not in the sources!).

It happened in the past, that this setting is the explanation why things go differently in development vs EXE. That's why i'm asking this.

 

Does the behavior change if you call the dialog non-modal?

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 8 of 12
(6,622 Views)

The behavior is the same when the subVIs are called non-modal.

0 Kudos
Message 9 of 12
(6,620 Views)

I had the same problem. When using latching buttons in "Mouse up" cases it seems that the terminal of the button has to be in a location were the code is executed. The latching back happens when the button is read the next time. I seems like the terminals must be placed outside the event structure but inside the while loop.

Other solution: When I changed to "Value change" and had the terminal inside the case it worked fine.

 

I think problems with latching buttons would deserve a help page of their own...

 

Regards

Message 10 of 12
(6,042 Views)