MATLAB Link for Code Composer Studio Development Tools | ![]() |
Write messages to the specified RTDX channel
Syntax
Description
data = writemsg(rx,
writes channelname
,data)
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 timeout defined in cc
.
writemsg
supports the following datatypes: uint8, int16, int32, single, and double.
data = writemsg(rx,
ises the global timeout setting assigned to cc when you create the link. channelname
,data)
Examples
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=ccsdsp; 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.
The matrix indata
is written column-wise to ichan
. The preceding function syntax is equivalent to:
See Also
![]() | write |