English
Language : 

MC73110 Datasheet, PDF (32/40 Pages) List of Unclassifed Manufacturers – Advanced 3-Phase Motor Control IC
4
32
Developing Your Own Applications with C-Motion
4.1 Theory of Use
C-Motion is a set of functions that encapsulate the motion processor command set. Every command has as its
first parameter an “axis handle”. The axis handle is a structure containing information about the interface to the
motion processor and the axis number that the handle represents. Before communicating to the motion
processor, the axis handle must be initialized using the following sequence of commands:
// the axis handle
PMDAxisHandle handle;
// open serial interface to PMD processor and initialize handle to axis one
PMDSetupAxisInterface_Serial( &handle, PMDAxis1, 1 ); // COM1
Once the axis handle has been initialized, any of the motion processor commands can be executed. C-Motion.h
includes the prototypes for all motion processor commands as implemented in C-Motion. Refer to this file for
the required parameters for each command. The MC73110 Product Manual is the primary source for information
about the operation and purpose of each command.
Every C-Motion processor command returns a status code of type PMDresult. The return code for every
command executed should be checked before attempting to execute more commands.
PMDresult result,status;
result = PMDSetVelocity(&handle, 100000);
if (result != PMD_ERR_OK)
{
printf(“Error: %s\n”, PMDGetErrorMessage(result));
return;
}
Many commands require additional parameters. Some standard values are defined by C-Motion and can be used
with the appropriate commands. Refer to PMDtypes.h for a complete list of defined types. An example of
calling one of the C-Motion functions with the pre-defined types is shown below.
PMDSetConditionMask(&handle, PMDConditionMaskAmpDisable, PMDConditionOverTemp);
In addition to the processor commands, C-Motion provides several support functions. A subset of these are:
void PMDCloseAxisInterface(PMDAxisHandle* axis_handle);
should be called to terminate an interface connection.
char *PMDGetErrorMessage(PMDresult errorCode);
returns a character string representation of the corresponding PMD chip or C-Motion error code.
void GetCMotionVersion(PMDuint8* MajorVersion, PMDuint8* MinorVersion);
returns the major and minor version number of C-Motion.
MC73110 Developer’s Kit Manual