MATLAB: Send String with SCI transmit

rs232 transmitserial sendsimulinksimulink sci transmit

Anyone here know how to send a string with the SCI Transmit block.
I tried creating an embedded matlab function that simply returns
y = uint8('fu');
but the SCI transmit block spits out an error message saying it only accepts scalars. Is there any way to send a vector? Only other option i have is to create a function that runs a for loop and transmits each character at a time but i don't want to do this if a tool for this already exist. The matlab embedded tools cost so much I can't believe they don't have a simple serial send command that can accept an array of numbers or characters.

Best Answer

When you are in enough of a hurry that you can't afford to follow a lead from someone who is trying to help, then it is time to call Mathworks technical support. The people who answer questions here are volunteers, and most of them are not Mathworks staff. When you see someone's name here in a link, look right after the link: Mathworks staff have the little Mathworks icon -- but even those staff are volunteers.
------
In your hurry, you omitted to say what your device is. I researched all of the devices that are documented as supporting SCI. The links to their SCI Transmit blocks are:
And the general description of SCI transmit block configuration is here
All of the blocks explicitly state they support vectors of data, including vectors of uint8. There is, however, an important clue in the mpc555 description:
The Serial Transmit block transmits bytes via either of the MPC555 QSMCM submodules SCI1 or SCI2. You can use it either to transmit a fixed number of bytes, or, by enabling the second input, transmit a variable number of bytes each time this block is called. With SCI1, a hardware buffer is used that allows up to 16 bytes to be queued for transmission. With SCI2, the buffer allows only up to one byte to be queued each time the block is called. Once bytes are queued for transmit, they will be sent as fast as possible by the serial interface hardware with no further intervention required by the rest of the application.
Thus, if you happen to be using mpc555 and you are using it with two input ports, one of which is the number of bytes to transmit, then in that mode only one byte is accepted per trigger of the block, and so that one mode would complain if you tried to pass in a vector.
Corresponding two-input uses are not documented for the c28* series. I do not have the toolbox so I cannot experiment to see if the same construction applies.
There is also a relevant technical support note that is suggestive in the situation: 1-92LEMV . It presumes that vectors can be sent, but notes that in some circumstances you have to do klutzy things to build the vectors.