Understanding the
API
As the API reacts to a simple byte-based protocol (as shown below) it means you have the
freedom to use formal programming languages like C, C#, C++ or Python, or graphical or
icon-based languages like Flowcode, App Inventor or LabView.
The other thing to note about the API is that some commands are bi-directional. This
means that a command sent to the equipment could result in a value being returned.
Shown below is the general format for the equipment's API.
':'
Command Start
Command Code
Every command starts off with a ':' character, ASCII value 58 which is then followed by a
command code byte that identifies what the robot should do. This may be followed by one or
more parameters depending on the command issued. The command is completed with a '\n'
characters, ASCII value 10 which executes the command.
For example to change the relay status you might send the following bytes:
The numeric byte values for this would look like this.
Where <value> is a 1 or a 0 for ON or OFF respectively.
It should be noted that the API commands for a particular language might have some subtle
differences. For example, Python will use something like "RA2.SetRelay(1)" whereas C#
would look like "RA_DLL.RA_SetRelay(1);" and for App Inventor, Flowcode and LabView
the appropriate icon would be selected.
Here's another example that shows how to control one of the motors on the equipment.
'A'
Parameters
':', 'E', <value>, '\n'
58, 69, <value>, 10
':', 'I', <motor>, <LSB>, <MSB>, '\n'
Copyright 2023 Matrix TSL Limited
...
'\n'
Command End
...
Returns
Page 28
Need help?
Do you have a question about the Process Control and is the answer not in the manual?
Questions and answers