Send String with 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.
采纳的回答
更多回答(4 个)
Walter Roberson
2011-2-21
0 个投票
2 个评论
Daniel
2011-2-22
Walter Roberson
2011-2-22
Guess you aren't interested in the solutions I researched, then, since I don't KNOW from personal experience that they will work.
Daniel
2011-2-22
0 个投票
1 个评论
Joris Lambrecht
2013-7-8
编辑:Joris Lambrecht
2013-7-8
In many cases you can use the ASCII Encode block with C2000 devices (with minor modification). Locate the file "asciiencode.c" in "<MATLABROOT>\toolbox\rtw\targets\xpc\target\build\xpcblocks" and comment out the line as follows: //#include <windows.h>
类别
在 帮助中心 和 File Exchange 中查找有关 String 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!