To use your callback functions just do something like this:
CallbackFunctionName(99,99,EVENT_NAME,0,0,0);
This executes the code handling the event called EVENT_NAME in the callback function.
If you get tired of typing all that try some handy #defines.
#define EC (99,99,EVENT_COMMIT,0,0,0)
#define KP (99,99,EVENT_KEYPRESS,0,0,0)
FunctionName(EC);
//## To fake a keystroke
FunctionName(KP);
int CVICALLBACK FunctionName(int panel, int control, int event, void *callBackData, int eventdata1, int eventdata2)
{
switch(event)
{
case EVENT_COMMIT:
MessagePopup("Running EVENT_COMMIT","");
break;
case EVENT_KEYPRESS:
MessagePopup("Runnying EVENT_KEYPRESS","");
break;
}
If you are in to using more then 98 panels and/or controls ju
st use bigger numbers like 999 instead.
Grant M. Johnson
Project Engineer
LECO Corporation