User Manual

MCP Series
Brushed DC Motor Controllers
MCP Series User Manual
161
GETS
Syntax
gets stream,[variable1,...,variableN]
Stream - is a variable, constant or expression that species which stream to read.
Variabl1...VariablN - is a list of variables to store the read values in.
Description
The GETS command is used to read bytes from a data stream and store them in user variables.
Stream Types
USB Virtual Communications Port 0
CAN (CANOpen or raw CAN) 1
TTL UART 2
RS232 UART 3
Example
The example reads 4 bytes from the USB stream and stores them in a long variable:
value var long
main
gets 0,[value.byte3, value.byte2, value.byte1, value.byte0]
puts 0,[dec value,13]
end