^1 SOFTWARE REFERENCE MANUAL
^2 PCOMM32PRO
^3 Communication Driver Set
^4 3A0-09WPRO-xSx2
^5 January 28, 2003
Single Source Machine Control Power // Flexibility // Ease of Use
21314 Lassen Street Chatsworth, CA 91311 // Tel. (818) 998-2095 Fax. (818) 998-7807 // www.deltatau.com
Copyright Information
© 2003 Delta Tau Data Systems, Inc. All rights reserved.
This document is furnished for the customers of Delta Tau Data Systems, Inc. Other uses are
unauthorized without written permission of Delta Tau Data Systems, Inc. Information contained
in this manual may be updated from time-to-time due to product improvements, etc., and may not
conform in every respect to former issues.
To report errors or inconsistencies, call or email:
Delta Tau Data Systems, Inc. Technical Support
Phone: (818) 717-5656
Fax: (818) 998-7807
Email: support@deltatau.com
Website: http://www.deltatau.com
Operating Conditions
All Delta Tau Data Systems, Inc. motion controller products, accessories, and amplifiers contain
static sensitive components that can be damaged by incorrect handling. When installing or
handling Delta Tau Data Systems, Inc. products, avoid contact with highly insulated materials.
Only qualified personnel should be allowed to handle this equipment.
In the case of industrial applications, we expect our products to be protected from hazardous or
conductive materials and/or environments that could cause harm to the controller by damaging
components or causing electrical shorts. When our products are used in an industrial
environment, install them into an industrial electrical cabinet or industrial PC to protect them
from excessive or corrosive moisture, abnormal ambient temperatures, and conductive materials.
If Delta Tau Data Systems, Inc. products are directly exposed to hazardous or conductive
materials and/or environments, we cannot guarantee their operation.
\
PCOMM32PRO
Table of Contents i
Table of Contents
INTRODUCTION TO USER MANUAL..................................................................................................................1
About PComm32PRO...............................................................................................................................................1
A Global View of the Library ...................................................................................................................................1
Supported Operating Systems ...................................................................................................................................2
Communication Modes .............................................................................................................................................2
Plug & Play Ports.................................................................................................................................................2
Non-plug & Play Ports .........................................................................................................................................2
GETTING STARTED.................................................................................................................................................5
Setting up Communications with PMAC..................................................................................................................5
Installing Pcomm32PRO...........................................................................................................................................5
Usage of PComm32PRO...........................................................................................................................................5
Linking Your Code with the Driver.......................................................................................................................5
Initializing Communication ..................................................................................................................................6
PmacServer...........................................................................................................................................................7
Shutting Down Communication............................................................................................................................7
A Guide to Using ASCII Communication Functions.............................................................................................7
Common Problems Experienced Using ASCII Communications Functions.........................................................7
Thread-Safe ASCII Communications....................................................................................................................8
Error Handling - ASCII Communication and Other Functions............................................................................8
Int vs Long Data Type.........................................................................................................................................10
PCOMM32PRO FEATURES...................................................................................................................................11
Using Interrupts.......................................................................................................................................................11
Send A Message To A Window ...........................................................................................................................11
Call a Function...................................................................................................................................................11
Start a Thread Function......................................................................................................................................11
Set an Event ........................................................................................................................................................12
Downloading To PMAC .........................................................................................................................................12
PCOMM32PRO DPR FEATURES .........................................................................................................................13
A Global View of the DPR Support Functions .......................................................................................................13
Control Panel (Non-Turbo PMACs)...................................................................................................................13
Fixed Real Time Data buffer ..............................................................................................................................13
Fixed Background Data Buffer...........................................................................................................................13
Variable Background Data Buffer......................................................................................................................14
Binary Rotary Buffer...........................................................................................................................................14
Read/Write Functions.........................................................................................................................................14
Initialization /Shutdown..........................................................................................................................................14
Memory Organization/Correct Order of Initialization ............................................................................................15
Using the DPR Control Panel (Non-Turbo PMAC)................................................................................................16
Action Bits...........................................................................................................................................................16
Request Bits ........................................................................................................................................................17
Assigning a New Feedrate Override...................................................................................................................17
Feedrate Override Enable Bits...........................................................................................................................18
Using the DPR Real Time Fixed Data Buffer.........................................................................................................18
Startup/ShutDown...............................................................................................................................................18
Handshaking.......................................................................................................................................................18
Data Query Functions ........................................................................................................................................18
Using the DPR Real Time Fixed Data Buffer (Turbo)............................................................................................20
Startup/Shutdown................................................................................................................................................20
Handshaking.......................................................................................................................................................20
Data Query Functions ........................................................................................................................................20
Using the DPR Background Fixed Data Buffer ......................................................................................................22
Startup/Shutdown and Handshaking Functions..................................................................................................22
Data Query Functions ........................................................................................................................................22
PCOMM32PRO
ii Table of Contents
Logical Query Functions....................................................................................................................................22
Using the DPR Background Fixed Data Buffer (Turbo).........................................................................................23
Startup/Shutdown and Handshaking Functions..................................................................................................23
Data Query Functions ........................................................................................................................................23
Logical Query Functions....................................................................................................................................24
Using the DPR Variable Background Read/Write Data Buffer ..............................................................................26
Variable Read Data Buffer .................................................................................................................................26
Startup/Shutdown................................................................................................................................................26
Data Query Function Description......................................................................................................................27
Variable Write Data Buffer.................................................................................................................................28
Using the DPR Binary Rotary Motion Program Buffer ..........................................................................................30
Startup/Shutdown Functions...............................................................................................................................30
Conversion and Transfer Functions ...................................................................................................................30
PmacDPRRotBufChange() .................................................................................................................................30
PmacDPRRotBufRemove().................................................................................................................................30
PmacDPRRotBufClr() ........................................................................................................................................31
PmacDPRRotBuf()..............................................................................................................................................31
PmacDPRBufLast() ............................................................................................................................................31
Downloading Stuffing Functions ........................................................................................................................31
INTRODUCTION TO PROGRAMMER’S REFERENCE ..................................................................................35
Important Information about Method of Communication Being Used by PComm32PRO.....................................35
Maximum Number of Response Buffer Characters ................................................................................................35
INITIALIZATION, SHUTDOWN AND CONFIGURATION FUNCTIONS.....................................................37
OpenPmacDevice() .................................................................................................................................................37
ClosePmacDevice().................................................................................................................................................37
PmacSelect()............................................................................................................................................................37
LockPmac().............................................................................................................................................................38
ReleasePmac().........................................................................................................................................................38
PmacSetCriticaIVars().............................................................................................................................................39
PmacAbortDPRTest() .............................................................................................................................................39
PmacConfigure().....................................................................................................................................................39
PmacGetDpramAvailable().....................................................................................................................................40
PmacInBootStrapMode().........................................................................................................................................40
PmacDPRTest().......................................................................................................................................................40
PmacSERGetPort()..................................................................................................................................................41
ASCII COMMUNICATION FUNCTIONS............................................................................................................43
GetUSResponse(), USReadReady()........................................................................................................................43
PmacFlush() ............................................................................................................................................................43
PmacGetAsciiComm() ............................................................................................................................................44
PmacGetBufferA() ..................................................................................................................................................44
PmacGetControlResponseA(), PmacGetControlResponseExA() ............................................................................44
PmacGetLineA(), PmacGetLineExA()....................................................................................................................45
PmacGetResponseA(),PmacGetResponseExA().....................................................................................................46
PmacReadReady()...................................................................................................................................................46
PmacSendCharA()...................................................................................................................................................46
PmacSendCommandA()..........................................................................................................................................47
PmacSendLineA() ...................................................................................................................................................47
PmacSetAsciiComm().............................................................................................................................................47
DOWNLOADING FUNCTIONS.............................................................................................................................49
PmacAbortDownload() ...........................................................................................................................................49
PmacAddDownloadFileA().....................................................................................................................................49
PmacDownloadA()..................................................................................................................................................50
PmacDownloadFirmwareFile()...............................................................................................................................50
PmacMultiDownload()............................................................................................................................................51
PCOMM32PRO
Table of Contents iii
PmacRemoveDownloadFile() .................................................................................................................................52
PmacSetMaxDownloadErrors() ..............................................................................................................................53
DUAL PORTED RAM CONTROL PANEL ..........................................................................................................55
PmacDPRControlPanel().........................................................................................................................................55
PmacDPRGetActionBit() and PmacDPRSetActionBit() .........................................................................................55
PmacDPRGetFOEnableBit() and PmacDPRSetFOEnableBit()..............................................................................56
PmacDPRGetFOValue() and PmacDPRSetFOValue()...........................................................................................56
PmacDPRGetRequestBit() and PmacDPRSetRequestBit().....................................................................................57
DPR REAL TIME FIXED DATA BUFFER...........................................................................................................59
DPR Real Time Fixed Data Buffer Initialization and Handshaking........................................................................59
Startup/Shutdown................................................................................................................................................59
HandShaking ......................................................................................................................................................59
DPR Real Time Fixed Data Buffer Query Routines ...............................................................................................59
DPR REAL TIME FIXED DATA BUFFER (TURBO).........................................................................................63
DPR Real Time Fixed Data Buffer Initialization (Turbo).......................................................................................63
Startup/ShutDown...............................................................................................................................................63
HandShaking ......................................................................................................................................................63
DPR Real Time Fixed Data Buffer Query Routines (Turbo)..................................................................................63
DPR BACKGROUND FIXED DATA BUFFER ....................................................................................................67
DPR Background Fixed Data Buffer Initialization and Handshaking.....................................................................67
DPR Background Fixed Data Buffer Query Routines.............................................................................................68
Data Query Functions ........................................................................................................................................68
Logical Query Functions....................................................................................................................................69
DPR BACKGROUND FIXED DATA BUFFER (TURBO)...................................................................................71
DPR Background Fixed Data Buffer Initialization and Handshaking (Turbo) .......................................................71
Startup/Shutdown and Handshaking Functions..................................................................................................71
DPR Background Fixed Data Buffer Query Routines (Turbo) ...............................................................................71
Data Query Functions ........................................................................................................................................71
Logical Query Functions....................................................................................................................................72
DPR VARIABLE BACKGROUND READ/WRITE DATA BUFFER.................................................................73
PmacDPRBackground()..........................................................................................................................................73
PmacDPRBufLast().................................................................................................................................................73
PmacDPRGetVBGAddress() ..................................................................................................................................74
PmacDPRGetVBGNumEntries() ............................................................................................................................74
PmacDPRGetVBGDataOffset()..............................................................................................................................74
PmacDPRGetVBGAddrOffset() .............................................................................................................................74
PmacDPRGetVBGServoTimer() ............................................................................................................................75
PmacDPRGetVBGStartAddr()................................................................................................................................75
PmacDPRGetVBGTotalEntries()............................................................................................................................75
PmacDPRVarBufChange() .....................................................................................................................................75
PmacDPRVarBufInit()............................................................................................................................................76
PmacDPRVarBufRead() .........................................................................................................................................76
PmacDPRVarBufReadEx().....................................................................................................................................76
PmacDPRVarBufRemove() ....................................................................................................................................77
PmacDPRWriteBufferEx()......................................................................................................................................77
DPR BINARY ROTARY BUFFER FUNCTIONS.................................................................................................79
PmacDPRAsciiFileToRot().....................................................................................................................................79
PmacDPRAsciiStrToRot() ......................................................................................................................................80
PmacDPRAsciiStrToRotEx()..................................................................................................................................80
PmacDPRRotBufChange()......................................................................................................................................81
PmacDPRRotBufRemove().....................................................................................................................................82
PmacDPRRotBufClr().............................................................................................................................................82
评论1