0
votes

I'm trying to create a simple model that reads data from an arduino by using the 'Serial Receive' block, but whenever I try to select a port and apply changes I get the following error:

enter image description here

I already tested this on another laptop and got the same result.

1
Does the comm port exist? - James
I suspect the block is trying to verify the settings you have input and they're not valid so it's exploding. If you right-click on the block and can select "View mask" then "Parameters" then look in Dialog callback, or in Initialisation: you might be able to view the commands it is running and determine whichever one is causing a problem. - James
yes the comm port exist, It actually works perfectly if I use matlab to make the communication with the arduino instead of the simulink block. - edua_glz
Is there still a problem if you put the Serial Configuration block in an empty new model? - James
Yes I also tried that but got the same results - edua_glz

1 Answers

0
votes

For anyone reading this I used to have this same problem; however, I think I found the solution. Simply connect your hardware to the computer before opening Matlab. Then (with the hardware connected) open Matlab, then open your Simulink model and configure the Serial Configuration Block, it should work just fine now. After doing so, you can save your Simulink model and the serial configuration will be saved as well.