フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Compiled program cannot distinguish whether a request is initiated via GUI or programmable interface command

1 回表示 (過去 30 日間)
Xiaolan
Xiaolan 2016 年 8 月 11 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello. I have an application which runs on an instrument. The app has a GUI and is compiled by Matlab compiler. It also supports programmable interface command via VISA connection.
The app has an "exit" button on the GUI (who shuts down the app and terminates its communication with the instrument). Similarly, it also includes a PI command to do the same thing. The only difference is an exit dialog will prompt if sent in by GUI, but not from PI command. This distinction is made by the following line in the exit callback:
if (gcbo == gcf) % Request via GUI
% Display an exit dialog
end
This has been tested and works fine if running app from Matlab. If a request is sent via PI, "gcbo" is [] in the above command.
However, once compiled, the build no longer recognizes request from PI. It treats all exit requests as coming from GUI, as the exit dialog is always prompted.
Anyone has suggestions:
  1. How to debug and troubleshoot this in the compiled build ? I inserted "dbstack" and "disp" at selected checkpoints. Worked to some extent, but not very comprehensive.
  2. Possible contributors to this different behavior between source code and build ?
Thank you.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by