I am using Simulink in external mode to control a Lego NXT robot. While simulink is running I am using Matlab scripts to complete various tasks. One of those task is to select Waypoints using ginput to select points on a figure.
Ginput seems to hang up simulink. While ginput is waiting for me to select a point, simulink appears to be stopped (the clock in the bottom right of the simulink window stops).
If I wait too long before I select a point using ginput an error occurs and Simulink stops running.
The error appears as follows:
Error occurred while executing External Mode MEX-file 'ext_serial_win32_comm_no_acks_rtt': ExtGetTargetPkt() call failed while retrieving pkt data
A few observations:
1) Running ginput from a script, the command line and from a GUI all cause the same error
2) If I click on the figure fast enough (under 2s) the timer in simulink resumes and has not lost any time i.e. pauses at 15.2 s and resumes as 16.9s
3) running ginput in a second instance of matlab does not cause an error or freeze simulink (but I don't wan to have to import and export variable from one matlab instance to the other if I don't have to....)
I am wondering if there is any setting I can change to disable what appears to be a whatchdog time or is I can run a script in a separate thread.
Any help would be appreciated. Let me know if you need more information to help.