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.
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.
08-29-2014 12:40 PM
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.
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.
08-29-2014 01:16 PM
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.
08-29-2014 01:25 PM
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.
08-29-2014 01:32 PM
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?
08-29-2014 01:37 PM
08-29-2014 01:45 PM
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/
08-29-2014 01:47 PM
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
08-29-2014 02:27 PM
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.
08-30-2014 04:57 AM
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.
09-02-2014 09:13 AM
@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.