LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

InstallPanelCallback

Object:
      when program run, splash one child panel to give the operator one caution to check LED, but the function test don't want to be interrupt, if operator find problems when checking he can stop the program by press any key, or discard the child panel after one special time.  Key: function test never stop, that's say, when the panel splash, the contact, the multimeter just work as the program:
 
I have done: install one callback function by InstallPanelCallback after load the child panel and activate the panel.
 
Problem: now, I can't rightly get the event to triggle the callback;
 
below is the help from CVI itself, but I don't know how to initiated the callback as the red show;
 
This function installs a panel callback. It takes a Panel Handle, the name of the Event Function (type PanelCallbackPtr) that processes events for that panel, and Callback Data of any type.
When an event is generated on the specified panel (after the callback is installed), the event function is called.  The event function is passed the panel handle, the type of the event, any associated event data, and the callback data for processing.
A panel callback can also be installed from the Edit Panel window in the User Interface Editor.
Callbacks are initiated through RunUserInterface() or GetUserEvent().

/*-------------------- Prototype ---------------------*/
int InstallPanelCallback (int Panel_Handle,
                          PanelCallbackPtr Event_Function,
                          void *Callback_Data); 
Best regards
Jaman
Developing Test Sepcialist
0 Kudos
Message 1 of 5
(3,656 Views)
For what you are saying is not easy to determine which are your requirements and what are you doing to develop this application.
 
For example it's not clear if the splashed panel is only a warning message without controls or if it contains buttons or other controls that the operator must operate on. Second, you don't say how you are displaying the panel, wether with DisplayPanel or InstallPopup. But the major doubt I have is: what is the panel callback intended to do? A panel callback usually receives events such as the panel getting or loosing the focus, or when the panel is discarded and so on: if a button is pressed on the panel, it's better to install a callback on that control instead of processing click events on the panel...
 
You may want to run through some of the help documents included int he CVI bookshelf that installs with the product and understand the callback mechanism that manages a complete application. In any case, we need some more details on your problem to be able to help you on a particular problem.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(3,652 Views)
Hello Roberto, thank you very much for your kindly reply!
 
For your question:
first: the panel is just a warning message without any command control inside,.
 
Second: I use InstallPopup for easy activate the panel.
 
Third: the callback is intend to do, when the operator check the led as the warning message, if checking is ok, nothing to do, if he find problems, press any key to stop the program.
 
maybe we can generate one control on the panel, so I need use GetUserEvent to get the event if the check fail, but I want the panel just show and don't interrupt the function test except the operator find non-normal. if I set GetUserEvent to nowait, but other function can't be run until discard this panel. How do you think please?
 
thanks a lot
best regards
Jaman
2006.4.20
 
 
 
Best regards
Jaman
Developing Test Sepcialist
0 Kudos
Message 3 of 5
(3,644 Views)
Jaman, using InstallPopup does exactly what you find in your program: no other panels can be operated until the popup is displayed. It's better that you use a DisplayPanel for showing the message, eventually setting the "Floating style" of the panel as "when app is active" so that the panel is always on top of other panels of your application. This parameter can be found in "Other attributes" sub panel of "Edit panel" window.
 
Second item: if your program has a RunUserInterface in the main function, you don't need any other call to initiate processing the events on a panel, neither GetUserEvent is needed. I suggest you put a OK button on the panel and set that button as the close control, so that either pressing the button or the cross in the upper right corner of the panel does close the panel. In the button callback simply insert DiscardPanel (panel), in the EVENT_COMMIT switch case.
 
With this provisions your program displays the warning, which remains on top of other panels, but the program continues running and the operator can operate on controls on other panels. Pressing the OK button simply hides the message panel.

Finally: couldn't it be simpler to have a text message on the original panel to display the warning and simply turn it visible or not, instead of using a separate message panel?


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 5
(3,637 Views)

Hello Roberto,

that's clear for me now, thank you!

for your finally problem: because I want that the operator can stop the program after he get trouble when checking.

thanks a lot!

Jaman

Best regards
Jaman
Developing Test Sepcialist
0 Kudos
Message 5 of 5
(3,615 Views)