11-15-2010 02:09 PM
I been running the PID auto tune wizard in lab windows cvi and can't seem to find how to determine if the operator canceled the operation. Is there anyway to determine this? I would appreciate any help!
Thanks
Solved! Go to Solution.
11-16-2010 09:47 AM
Hi cjp1,
I'm a little confused on what you would like to happen if the Auto Tune Wizard is canceled. Would you like there to be a pop-up message saying it was canceled, or perhaps have it create a log file so that you can look at it later? You can easily modify the callback to the cancel button on the wizard so that it has whatever functionality you would like.
11-16-2010 11:08 AM
I don't see how to get at the cancel button callback function.
I start the wizard using
PidAutotuneShowDialog (pidHandle);
11-17-2010 03:08 PM
Hi cjp1,
After looking at the code for the wizard, you are correct and there is no callback function for the cancel button. However, there is a workaround solution, although it is somewhat of a hack. Essentially, you will have to get the active panel, which would be the Autotune wizard panel, and then loop through all the controls to find the cancel button. You can then create a function for when that button is clicked. Attached is a small example that creates a pop-up window asking "Do you really want to cancel?" when the cancel button is hit. In order to use the example, load the attached .c file into your project and be sure to #include the header file at the top of your main source fle. Then call the command HookDialogCancelButton, passing it your panel handle, directly after the line where you are displaying the autotune dialog box. For example:
You can modify the CancelButtonCB callback on the attached .c file to have whatever functionality you desire.
03-16-2011 10:42 PM