User`s guide
readmsg
datatype String Specified Data Type
'single'
Floating-point data, 32-bits
(single -precision).
'uint8'
Unsigned 8-bit integers.
When you include the timeout input argument in the function, readmsg
readsmessagesfromthespecified queue until it receives nummsgs,or
until the p eriod defined by
timeout ex pires while readmsg waits for
more messages to be available.
When the d esired number of messages is not available in the queue,
readmsg enters a wait loop and stays there until more m e ssages become
available or
timeout seconds elapse. The timeout argument overrides
the global timeout specified when you create
rx.
data = readmsg(rx,channelname,'datatype',siz,nummsgs) reads
nummsgs from a channel associated w ith rx. channelname identifies
the channel queue, which must be configured for read access. Each
messageisthesametype,defined by
datatype. nummsgs can be an
integer that defines the number of messages to read from the specified
queue, or
all to read all the messages present in the queue when you
call the
readmsg function.
Each read message becomes an output matrix in
data,withdimensions
specified by the elements in vector
siz.Whensiz is [mn], readin g 10
messages (
nummsgs equal 10) creates 10 n-by- m matrices in data.
Each output matrix in
data must have the same number of elements (m
x n) as the number of elements in each message.
You must specify the type of messages you are reading by including the
datatype argument. datatype supports six strings that de fine the type
of data you are expecting.
data = readmsg(rx,channelname,datatype,siz) reads one data
message because
nummsgs defaults to one when you omit the input
argument.
readmsgs returns the message as a row vector in data.
7-124