| Embedded IDE Link™ CC | ![]() |
data = writemsg(rx,channelname,data)
data = writemsg(rx,channelname,data)
data = writemsg(rx,channelname,data) writes data to a channel associated with rx. channelname identifies the channel queue, which must be configured for write access. All messages must be the same type for a single write operation. writemsg takes the elements of matrix data in column-major order.
To limit the time that writemsg spends transferring messages from the target processor, the optional argument timeout tells the message transfer process to stop after timeout seconds. timeout is defined as the number of seconds allowed to complete the write operation. You may find this useful for limiting prolonged data transfer operations. If you omit the timeout option in the syntax, write defaults to the global time-out period defined in cc.
writemsg supports the following data types: uint8, int16, int32, single, and double.
data = writemsg(rx,channelname,data) uses the global time-out setting assigned to cc when you create the link.
After you load a program to your target, configure a link in RTDX for write access and use writemsg to write data to the target. Recall that the program loaded on the target must define ichannel and the channel must be configured for write access.
cc=ticcs;
rx = cc.rtdx;
open(rx,'ichannel','w'); % Could use rx.open('ichannel','w')
enable(rx,'ichannel');
inputdata(1:25);
writemsg(rx,'ichannel',int16(inputdata));
As a further illustration, the following code snippet writes the messages in matrix indata to the write-enabled channel specified by ichan. Note again that this example works only when ichan is defined by the program on the target and enabled for write access.
indata = [1 4 7; 2 5 8; 3 6 9]; writemsg(cc.rtdx,'ichan',indata);
The matrix indata is written by column to ichan. The preceding function syntax is equivalent to
writemsg(cc.rtdx,'ichan',[1:9]);
![]() | writebin | Block Reference | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |