Page 89 of 112
DMM-0200 Product User Guide
159 Swanson Road
Boxborough, MA 01719
Tel: 508-475-3400
Email: sales@dovermotion.com
USB Communication Description
PMX-2EX-SA USB communication is USB 2.0 compliant.
Communication between the PC and PMX-2EX-SA is done using Windows compatible DLL API function calls
as shown below. Windows programming language such as Visual BASIC, Visual C++, LAB View, or any other
programming language that can use DLL can be used to communicate with the Performax module.
Typical communication transaction time between PC and PMX-4EX-SA for sending a command from a PC and
getting a reply from PMX-2EX-SA using the fnPerformaxComSendRecvØAPI function is in single digit
milliseconds. This value will vary with CPU speed of PC and the type of command.
USB Communication API Functions
For USB communication, following DLL API functions are provided.
BOOL fnPerformaxComGetNumDevices(OUT LPDWORD lpNumDevices);
- This function is used to get total number of all types of Performax and Performax USB modules
connected to the PC.
BOOL fnPerformaxComGetProductString(IN DWORD dwNumDevices,
OUT LPVOID lpDeviceString,
IN DWORD dwOptions);
- This function is used to get the Performax or Performax product string. This function is used to find out
Performax USB module product string and its associated index number. Index number starts from 0.
BOOL fnPerformaxComOpen(IN DWORD dwDeviceNum,
OUT HANDLE* pHandle);
- This function is used to open communication with the Performax USB module and to get
communication handle. dwDeviceNum starts from 0.
BOOL fnPerformaxComClose(IN HANDLE pHandle);
- This function is used to close communication with the Performax USB module.
BOOL fnPerformaxComSetTimeouts(IN DWORD dwReadTimeout,
DWORD dwWriteTimeout);
- This function is used to set the communication read and write timeout. Values are in milliseconds. This
must be set for the communication to work. Typical value of 1000 msec is recommended.
BOOL fnPerformaxComSendRecv(IN HANDLE pHandle,
IN LPVOID wBuffer,
IN DWORD dwNumBytesToWrite,
IN DWORD dwNumBytesToRead,
OUT LPVOID rBuffer);
- This function is used to send command and get reply. Number of bytes to read and write must be 64
characters.
BOOL fnPerformaxComFlush(IN HANDLE pHandle)
- Flushes the communication buffer on the PC as well as the USB controller. It is recommended to
perform this operation right after the communication handle is opened.