Qdatasheet_Logo
Integrated circuits, Transistor, Semiconductors Search and Datasheet PDF Download Site

PC104 View Datasheet(PDF) - PMD

Part Name
Description
MFG CO.
'PC104' PDF : 70 Pages View PDF
Developing Your Own Applications with C-Motion
4
communicating to the motion processor, the axis handle must be initialized using the following
sequence of commands:
// the axis handles
PMDAxisHandle hAxis1, hAxis2;
// open interface to PMD processor and initialize handle to axis one
PMDSetupAxisInterface_Parallel( &hAxis1, PMDAxis1, 0 );
// initialize handle to the second axis
PMDCopyAxisInterface( &hAxis2, &hAxis1, PMDAxis2 );
The above is an example of initializing communication using the parallel communication interface. Each interface
.c source file contains an example of initializing the interface.
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 Navigator Motion Processor
Programmer’s Command Reference is the primary source for information about the operation and
purpose of each command.
As part of a normal startup procedure, the motion processor is often reset. This command only needs
to be executed ONCE for each motion processor, and not for every axis. The following code demon-
strates a chip reset using C-Motion.
PMDuint16 result;
PMDuint16 status;
// reset the PMD chip that this axis resides on
// if more than one chip(set) is present, all of them should be
// reset here
result = PMDReset(handle);
// in the serial interface mode if an error occured it is returned
// immediately with no need to call GetHostIOError, so in this
// code we check for any error before continuing.
// with the parallel interface the result code will always be
// PMD_ERR_CommandError since that bit is set whenever a reset
// occurs. If it ISN’T set then there is some other error
if ( (result != PMD_ERR_ChipsetReset) && (result != PMD_ERR_CommandError))
{
printf(“Error: %s\n”, PMDGetErrorMessage(result));
return 0;
}
// after the reset the chip will be in the PMDChipsetReset state
result = PMDGetHostIOError(handle, &status);
// the above command should execute without error but we need to check
if ( (result != PMD_ERR_OK) || (status != PMD_ERR_ChipsetReset) )
{
printf(“Error: %s\n”, PMDGetErrorMessage(result));
printf(“Status: %s\n”, PMDGetErrorMessage(status));
return 0;
}
return 1;
Navigator-PC/104 User’s Guide
53
Share Link: GO URL

All Rights Reserved © qdatasheet.com  [ Privacy Policy ] [ Contact Us ]