How to send array by using serial send block

11 Ansichten (letzte 30 Tage)
Tomoki
Tomoki am 21 Dez. 2020
I can create and execute programs in matlab that operate servo motors via serial communication.
I tried to make the same thing with simulink, but I got stuck. I would be grateful if you could tell me how to solve it.
The code of the created matlab is as follows.
------------------------------------------------------------------------------------------------------
s = serialport("COM4",115200,"Parity","even");
write(s,[0x0B,0x10,0x04,0x00,0x00,0x00,0x00,0x01,0xFF,0x7F,0x9E],"uint8");
clear s;
---------------------------------------------------------------------------------------------------------
I created a simulink model that sends the same numeric sequence in the serial send block of the instrument control toolbox,
The servo motor did not work. It seems that the connection with comport is established, and there was no error at runtime.

Antworten (0)

Kategorien

Mehr zu Motor Control Blockset finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by