serial communication device without driver
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to send a signal or generate a signal for a serial control device connecting via RS232.
point to point link, Baud rate 38400, data bits 8, parity none, stop bits 1, CRC 16.
I want to generate or use matlab function or simulink to get a signal of fixed length of 6 bytes. The massage are transfered in 15ms cycle.
Example signal : AA ID AA 02 IC IE.
I want to generate or send a signal (AA ID AA 02 IC IE) keeping in mind all the parameters.
0 commentaires
Réponses (1)
Walter Roberson
le 2 Mar 2022
That uses the Instrument Control Toolbox.
You could also use MATLAB Function Block, and code in calls to serialport() and related functions; https://www.mathworks.com/help/matlab/ref/serialport.html
6 commentaires
Walter Roberson
le 3 Mar 2022
There is no particular block in Simulink to send fixed length signals. The serial send block will send whatever shows up on its input port. Most signals in Simulink are fixed-length signals.
In theory you could be feeding the output of a triggered system or an if/then block into the serial send block. It will not care: it will send whatever is in the input port when it gets triggered (it only makes sense to use such a block with a discrete section rather than a continuous section.)
Generally speaking if you were wanting to send a block of calculated results not all created at the same time, and it was important that they be transferred at regular times or with a regular header for the block, then you could use a buffer block.
Voir également
Catégories
En savoir plus sur Block Libraries dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!