Simulink "Monitor & Tune" no longer working for Arduino (SDI no signal error), but play button under simulation does?
10 次查看(过去 30 天)
显示 更早的评论
I've been working on a project for a really long time and occasionally send outputs from a Matlab function block to the scope to see how things like a Kalman filter might compare to some complementary filters. More specifically, to see how accuracy and computation time compare between methods after it's deployed to Arduino hardware.
At one point, I decided to start working on my project again after a few weeks down time and hit the Monitor button to make sure everything is still working. Unfortunatly, a problem arose where my Scope, or any block designed to log or display output signals, no longer functions when using the Monitor and Tune button. It spits out these error messages when using XCP over serial:
Warning: Streaming to SDI is not available for signal at <sldiag objui="outport" objparam="2" objname="model3/Main Control">output port 2</sldiag> of block 'model3/Main Control'. Consider adding a SignalCopy block at that port and instrumenting the SignalCopy output port instead.
Warning: Streaming to SDI is not available for signal at <sldiag objui="outport" objparam="5" objname="model3/Main Control">output port 5</sldiag> of block 'model3/Main Control'. Consider adding a SignalCopy block at that port and instrumenting the SignalCopy output port instead.
Warning: Streaming to SDI is not available for signal at <sldiag objui="outport" objparam="9" objname="model3/Main Control">output port 9</sldiag> of block 'model3/Main Control'. Consider adding a SignalCopy block at that port and instrumenting the SignalCopy output port instead.
Saving external mode simulation output as a single object is not supported because the workspace variable 'out' is not created during model code execution. To suppress the warning, set 'ReturnWorkspaceOutputs' to 'off'.
For any signal I specify to be monitored, it will produce a corrisponding SDI is not available message. If I try serial without XCP, I don't get these errors. Instead I get
Error occurred while executing External Mode MEX-file 'ext_comm':
ExtTargetPktPending() call failed while checking for target pkt
I've been unable to find anything on google related to this other than maybe clearing SDI and restarting matlab, or even restarting the pc, but that didn't work after trying it a few times. The program I created still works when I "Build, Deploy, & Start" and spits out log files via an onboard SD card data logger I created with a CPP wrapper, but swapping that back and forth to see what happened is a little bit of a pain compared to the convenience of the monitor. I've also tried uploading basic test sketches from Arduino INO, deleting all the related compiled files, and copying the project to a new model. All the includes I'm using are also in their own isolated folder and don't get updated automatically.
Furthermore, even though this Monitor button fails to enter external mode, so long as I attempt it once to update the program (and wait for it to fail), I can go to the Simulation tab and hit play. When I do this, It just suddenly starts working again and the scope displays the data. Unfortunately, it appears any updates any changes I make only successfully apply to matlab function blocks and do not appear to take changes to any of my S functions or C callers. If I for example, stuff a micros() into some function to test its output, it will just output 0 while all other functions within operate normally.
Any ideas why "Monitor and Tune" might be failing to get external mode running? I've noticed once in the past that Simulink decided to randomly change options in my hardware settings. I try never to mess with things I don't understand once it works, but sometimes things change for reasons I don't know. I suspected either that happened again, or some other program sneaked in a compiler update. I've also tried switching over from a VS 2015 to VS2019, which by happen stance appeares to have fixed a random timeout issue I've been having with the scope, but did not resolve the main issue.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Run on Target Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!