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: 

In need of advice

Hello,

 

I have some error handling functions to be used on my projects.

specifically I spawn a error dialog to the user (using VI server) to both show the error and give the user the option to close the top most-level VI (is there are repeating errors (say in a loop) using a file>shut down menu option.

 

so I can drag the spawner and place it on any top level VI and have my error hangling.

 

Now, this functions I want to be able to use them on any project (universal) per say and since my style is to always include a panel closed? event which i ignore and do house cleaning before terminate my main program I can standarize this.

 

here are some links i visited while attempting to create panel close? event dynamically

 

http://zone.ni.com/reference/en-XX/help/371361H-01/lvprop/vi_pnl_closing/

http://digital.ni.com/public.nsf/allkb/81E9C1441900FFCE8625748F0055DBB0

this variant closes the vi but does not generate the efect of cliking on the "X button" the next link mentiones that "WM_CLose" it should behave like pressing the "X button". I also try "WM_Quit" but no joy.

http://stackoverflow.com/questions/3155782/what-is-the-difference-between-wm-quit-wm-close-and-wm-de...

method FP-CLose failed

function "Stop" acts like an abort

 

I though about moving the mouse (based on the size of the top most level windows FP) to where the "X button" is but iam hoping for a more elegant approach.

 

any help will be greatly appreaciataed.

 

 

0 Kudos
Message 1 of 10
(2,753 Views)

are you using a state machine architecture?  if so, your error would queue up the cleanup state, which is what your Panel: Close? event would do.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 10
(2,738 Views)

NO.

I want to create a panel close? event.

regardless of what my architecture is, I do not whish unless it is absolutly necessary have to change my architecture to acomodate this nuisance.

0 Kudos
Message 3 of 10
(2,729 Views)

I understand what you are trying to do but i don't think you can generate a panel close event without using a Menu....Exit command or clicking the "X".  Can you show a screenshot?  You are discarding the panel close event in order to do cleanup.  Where is your cleanup code...in the Panel: Close filter?

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 10
(2,724 Views)

Are you familiar with User Events?  Have you tried them for this?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 5 of 10
(2,721 Views)

so from my dialog vi i want to be able to generate a panel close

(I can ofcorse create a dummy control and hide it and in its value change case, do whatever I do for my house keeping) but it would be my ugly option, because user cliking on X is my signal that I have to terminate all my process in a gracefull manner (clore reference, etc).

 

has any one even with the win32.dll variant been able to mimic a close (x) (not in G) so that LV can successfully capture it.

 

the last guy in this post mentions it.

http://lavag.org/topic/4020-how-programmatically-fire-the-panel-close-event/

 

 

0 Kudos
Message 6 of 10
(2,711 Views)

I am able to create dynamic events for controls but I cant seem to be able to generate an event (panel close?) for a VI

0 Kudos
Message 7 of 10
(2,709 Views)

I'm curious now.  I was going to create a user event and add it to the same event case as the Panel: Close filter.  I get an error that says "Filter events must have identical data to share a case."  So I am trying to create a user event with identical data so that maybe they can share a case.  Anyone know if this is possible or is there a way to find out the exact event data?  I can see that there are 5 different values (4 input, 1 output) but this isn't working.  They may not be in the right order.

user event.PNG

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 8 of 10
(2,695 Views)

If all you are doing in the Panel Close? filter event is discard the event, then I don't see a really good reason to try to get a filter event and a dynamic event to work in a single case.  I don't think they would work together anyways.  So just make another event case that does the same thing as the filter event using a User Event.


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 9 of 10
(2,658 Views)

@crossrulz wrote:

If all you are doing in the Panel Close? filter event is discard the event, then I don't see a really good reason to try to get a filter event and a dynamic event to work in a single case.  I don't think they would work together anyways.  So just make another event case that does the same thing as the filter event using a User Event.


I don't have a particular use case for this.  It was more of a "curiosity killed the cat" sorta thing....just to see if I could get it to work. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 10 of 10
(2,597 Views)