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: 

FP not responding while waiting for event

Solved!
Go to solution

Following yesterday’s issues of my subpanel VI FP not responding (http://forums.ni.com/t5/LabVIEW/Subpanel-vi-controls-not-working/td-p/3333761) I am now having a similar problem with my main VI’s FP.

 

As before I have a ‘Settings’ button on my main FP that, when clicked, opens a subpanel below it with a VI that contains boxes to input settings. The current settings from the main VI are passed to this VI to display.

 

When the user clicks again on the Settings button the subpanel VI outputs the new settings, closes and the subpanel is hidden.

Initially I had an issue with the subpanel opening again immediately because of the event created by the second click on the Settings button but adding Flush Event Queue has removed this extra event.

 

Thus far everything works ok but now the main VI goes back to waiting for another event and none of the FP controls are responding.

 

Thanks again for any help in advance,

Pete.

Download All
0 Kudos
Message 1 of 6
(3,173 Views)

Sorry i can't view your code now. Let me give some hints:

-Are you sure second time again user clicks Settings button?

-Are you sure the event is completed? Check with highlight execution enabled.

-After the event is completed event structure must go again and wait for next event(That's normal behaviour).

-Are you sure it is not again entering settings button or any other event?

-If it's in any other event please check the same uncheck front panel and see if it works.

Thanks
uday
0 Kudos
Message 2 of 6
(3,153 Views)
Solution
Accepted by topic author Techtest

I'm guessing you have not had proper instruction in LabVIEW, nor have paid attention to the numerous LabVIEW Beginner Tutorials on the Web.

 

One important use of the Event Loop is to handle Front Panel Events, particularly button pushes of Boolean Controls.  Front Panel events are (by default in LabVIEW 2015) are "Value Changed" Events, and the default Mechanical Action for buttons such as Stop and other "Square" buttons (such as what you are using for File Settings) is Latch when Released.

 

Think about what you want a Stop or File Setting button to do.  You don't care if it is On or Off (indeed, it is more important if it is a "Momentary" button, as it is the Pushing (or, really, the Releasing) of it that is important.  So Latch when Released will do two things:  it will generate a Value Change Event when you release it, and will "reset" the value to the Button's Default value when the button is read.  For this reason, you should put the Button's Icon within the Event Case, forcing it to be read (and thus returned to the Off State) when the button is Press/Released (pressing it turns it on, Releasing it fires the Event, and reading the Icon inside the Event case turns it back off).

 

Make those changes back to the default behavior everywhere you use Front Panel Boolean buttons as "Do Something When I Press/Release This" (change Mechanical Action back to Latch when Released, change Event to Value Changed, make sure Icon is in Event (does not need to be wired to anything) and you should be Good to Go.

 

Bob Schor

 

uday -- please don't repeat what I've just posted, then beg for Kudos.

 

Message 3 of 6
(3,134 Views)
I am really sorry Bob, if you felt I am posting by copying your posts. And definitely think there's distinction between asking and begging.
It is really discouraging to post.
Thanks
uday
Message 4 of 6
(3,113 Views)
Solution
Accepted by topic author Techtest

I am not seeing the point of the button.  Are you just trying to show the settings or are you trying to give an option to edit?  For an edit, you really should just forget about the subpanel, use the standard Latch When Released mechanical action for the button, and let the subVI's front panel just show up as a dialog.  You can then use an OK and Cancel button on your dialog VI.


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
Message 5 of 6
(3,099 Views)

Bob,

 

Thanks for the help, a simple change and it worked just fine. You've spurred me into going through the online training as its been a while since I used LabVIEW (6 years!) and even then I was completely self-taught from looking at a vi another ex-colleague had made.

 

 

0 Kudos
Message 6 of 6
(3,001 Views)