Motion Control ICs  
      Motion Control Cards  
      Motion Control Digital Drives  
      Motor Control ICs  
      Developer's Kits  
      Development Software  
      Product Selection Guide  
      Product Family Features  
     
 






Motion Control University

PMD on Twitter  Follow Us on Twitter

 

Using C-Motion

C-Motion is a “C” source code library that contains code for communicating to the motion processor using a parallel or serial interface. Please contact PMD for the latest version of the CMotion library.

All C-Motion examples are intended for use on a PC running a Windows® Operating System. The library also contains files which are MicroSoft Visual Studio® 6.0 projects. Every example folder will have a file with a “.dsp” extension. If Visual Studio 6.0 is installed on the PC, then clicking on the “.dsp” file will open the project and the user should be able to compile the project without errors. If a development environment besides Visual Studio is being used then C-Motion can still be utilized however the user is now responsible for setting up the project so that all of the necessary source, object, and library files are properly linked during a compile.

The developer’s initial utilization of C-Motion is intended for use with PMD’s Development Kit boards, which are inserted into either an ISA or PCI slot on a PC. Hence there are examples that are specific to ISA or PCI communication. However C-Motion is also useful to developers who have purchased a chip level product from PMD. In particular it is a useful starting point for developing the section of code that will run on their host processor that is responsible for communicating to the PMD chip.

One very important function of C-Motion is to translate one user level function call into several low level read and write instructions. These low level instructions, which are passed to the communication bus, are in the format of packet structures defined in the Programmer’s Reference or Programmer’s Command Reference for the product of choice. The theory is that the developer will only need to modify the low-level communication routines in C-Motion based on the type of host processor and the subsequent communication routines provided by that host processor.

C-Motion includes the following features:

  • Axis virtualization
  • Communicate to multiple motion processors
  • Easily linked to any “C/C++” application
  • Supports 16/16, 8/16 and 8/8 parallel communication modes
    (8/8 mode not supported on Magellan)
  • Support serial communication
  • Supports Windows driver communication mode

The following files make up the C-Motion source code distribution:

C-Motion.h/C-Motion.c
Definition/declaration of the PMD Navigator command set
PMDpar.h/PMDpar.c

Parallel interface functions
PMDW32ser.h/PMDW32ser.c

Windows serial communication interface functions
PMDdrv.h/PMDdrv.c

Windows driver communication interface functions
PMDutil.h/PMDutil.c

General utility functions
PMDtrans.h/PMDtrans.c

Generic transport (interface) functions
PMDecode.h

Defines the PMD and C-Motion error codes
PMDocode.h

Defines the control codes for Navigator commands
PMDtypes.h

Defines the basic types required by C-Motion
PMDdiag.h

Defines a string for each control code

C-Motion can be linked to your application code by including the above “C” source files in your application. Then, for any application source file that requires access to a PMD motion processor # include “C-Motion.h”.

By customizing the base interface functions in PMDpar.c or PMDW32ser.c, C-Motion can be ported to virtually any hardware platform. Use of C-Motion on generic platforms is covered in Section 3.2.2.2.


 
  Site Map
Performance Motion Devices, Inc.
80 Central St. | Boxborough, MA 01719 | P: 978.266.1210 F: 978.266.1211 | motion-control@pmdcorp.com