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!