Hex-Code through RS-232

5 visualizaciones (últimos 30 días)
David
David el 26 de Feb. de 2014
Comentada: Suneesh el 26 de Feb. de 2014
Hi, i made a simulink model to run a few LED's. I know that the module to which the RS-232 is connected Needs for example the Hexcode 'CA00056734DS' to make all LED's light red.
First Thing i did, was reshaping the Hexcode in a Vector: [ CA 00 05 67 34 DS] because more than that can't be send in uint8 without a data Overflow.
Then i created a Counter to read out the vector-elements and send them through the Serial device after converting them into uint8.
These Vector-elements i connected with the TX-Bytes Input and to the NumBytes-input i give the in the example above the number 6 in uint 32 because 6 elements will be send through the device.
But somehow this doesn't work correctly.
Has anyone an idea where my mistake is?
Thanks a lot!
Greetings
  1 comentario
Suneesh
Suneesh el 26 de Feb. de 2014
  1. What library is the Serial transmit block from?
  2. Devices usually require a header/terminator. Have you set this up correctly for your device?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Block and Blockset Authoring en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by