Transmitting data exceeding 1 byte continuously using serial write

Robbert Lee
Robbert Lee Altair Community Member
edited August 2023 in Community Q&A

I would like to use serial communication in Embed to communicate with my ModBus device. However, I'm unsure about how to transmit data exceeding 8 bits, like "0xAA 0xAA". Could you please guide me on how to configure this in the software? Thank you!

image

Answers

  • Peter Darnell
    Peter Darnell
    Altair Employee
    edited August 2023

    Hi Robbert, Which MCU are you using? Most of them support a buffer size that allows you to write a number of bytes at each control sample. Those bytes will be sent out by the VSRTOS interrupt handler as fast as possible, so there should be no gap between the 8 byte data elements.

  • Robbert Lee
    Robbert Lee Altair Community Member
    edited August 2023

    Hi Robbert, Which MCU are you using? Most of them support a buffer size that allows you to write a number of bytes at each control sample. Those bytes will be sent out by the VSRTOS interrupt handler as fast as possible, so there should be no gap between the 8 byte data elements.

    Hi Peter, this is not intended for use on any MCU, but rather for industrial control (RS232, RS485, etc.). I am using the Real Time/Serial Write block, so I can't use a buffer to write multiple bytes.