Communicating with a Controller
MN1278 05.2001
5
The main features and uses of DPR are:
• Support for the Mint Comms protocol. This is a method of asynchronously updating variables in a Mint
program from the host.
•
Mint pseudo serial buffer. This allows communication with the Mint command line and Mint program
and configuration loading/saving.
•
Reporting of Mint status. The host can read whether Mint is at the command line and if not, which line
it is executing.
• Automatic reporting of motion variables. Every 2 milliseconds NextMove writes various motion
parameters into DPR such as position and velocity of an axis. This can be read at any time by the host.
•
Event control. This allows NextMove to interrupt the host and the host to interrupt NextMove.
• Flags & control registers. Each NextMove application uses control registers to tell the host which
features it supports. Control registers can also be used to synchronize communications between
NextMove and the host.
•
User area. There is an area in DPR which has been left to allow NextMove and the host application to
exchange whatever application specific data is required.
Appendix 1 shows the layout of DPR and describes the functionality of each section in detail.
2.4 Mint Comms Array (All Controllers)
The Mint Comms Protocol is a secure communication method allowing asynchronous transfer of floating point
data to and from a Mint controller. This is a 255 element array where the first 99 elements can contain user data
and the remaining elements contain pre-defined data such as axis position and velocity. Comms provides the best
way of communicating data between a Mint program running on a controller and the host at run time. It can be
used for simple data transfer, or as a method of synchronizing events. Comms can also be used for transferring
data directly between controllers. For further information on the uses of Comms, see the Mint v4 Programming
Guide section 5, ‘Mint Comms Communications’, and the Mint v4 CAN Programming Manual section 3,
‘Getting Started with CANopen’.
On Mint v4 serial controllers, Comms now uses binary packets to transfer data but in earlier Mint versions, an
ASCII based packet was used. All Mint v4 controllers also support the older protocol.
Example:
In this example, Comms is used to pass commands to a Mint program using two Comms locations. Location 1 is
used to pass the command and location 2 is used to pass data. The host code is written in C++ but the principles
are applicable to any language.
Host:
/* Address of NextMove PC */
#define nmADDRESS 0x33C
/* Node number */
#define NODE0 0