Preview only show first 10 pages with watermark. For full document please download

P Comm Server

PcommServer Library of PMAC Functions License Statement and Limited Warranty (If you have any questions, contact our Customer Service Department at (818 998-2095) IMPORTANT: Carefully read all the terms and condition of this agreement before installing this software. Installing this software indicated your acceptance of the terms and conditions contained in this agreement. If you do not agree to the terms and conditions contained in this agreement, promptly return this package, unopened, and al

   EMBED


Share

Transcript

    PcommServer Library of PMAC FunctionsLicense Statement and Limited Warranty (If you have any questions, contact our Customer Service Department at (818 998-2095)IMPORTANT: Carefully read all the terms and condition of this agreement before installing this software. Installing this software indicated your acceptance of the terms andconditions contained in this agreement. If you do not agree to the terms and conditions contained in this agreement, promptly return this package, unopened, and all associateddocumentation to the place of purchase, and your money will be refunded. No refunds will be given for products that have missing or damaged components.By installing Delta Tau Data Systems Accessory ACC-9PNPRO2, PcommServer (herein referred to as the SOFTWARE or SOFTWARE ) the purchasing customer orcorporation accepts the following License Agreement.LICENSE: The purchasing person or corporation has the right to use the SOFTWARE on an unlimited number of computers owned by the person or corporation (“site license”).The purchasing person or corporation has a royalty-free right to distribute only the run-time modules with the executable files created in any other vendor product (LanguageDevelopment Tool) limited as hereinafter set forth in paragraph a through d. Delta Tau Data Systems, Inc. grants you a royalty-free distribution if: (a) you distribute the runtime modules only in conjunction with the executable files that make use of them as part of your software product; (b) you do not use the Delta Tau Data Systems, Inc. name,logo, or trademark to market your software product; (c) The SOFTWARE end users do not use the run time modules or any other SOFTWARE components for developmentpurposes. And, (d) you agree to indemnify, hold harmless, and defend Delta Tau Data Systems, Inc. and its suppliers from and against any and all claims or lawsuits includingattorney’s fees, that arise or result from the use or distribution of your software product. If any of the conditions set forth in paragraphs a through d are breached, such breach shallconstitute an unlawful use of the SOFTWARE, and you shall be prosecuted to the full extent of the law. Furthermore, you shall be liable to Delta Tau Data Systems, Inc. for alldamages caused by such a breach and unlawful use of the software, including attorney’s fees and costs incurred in any action, lawsuit or claim brought or filed to redress thebreach of this agreement. The “run time modules” are those files included in the SOFTWARE package that are required during execution of your software program.TERM: This license agreement is in effect until terminated. You may at any time terminate this agreement by destroying the software, diskettes, documentation, and all copiesthereof. Delta Tau reserves the right to terminate this agreement if you fail to comply with any of the terms and conditions contained herein. Should Delta Tau terminate thisagreement because of your failure to comply, you agree to destroy or return to Delta Tau the program and documentation and any copies, in any and all forms, received from DeltaTau or generated in connection with this agreement.LIMITED WARRANTY: Delta Tau warrants that the diskettes and documentation enclosed within this product will be free from defects in materials and workmanship for aperiod of ninety days from the date of purchase as evidenced by a copy of your receipt. THE PROGRAM IS PROVIDED “AS-IS” WITHOUT WARRANTY OF ANY KIND,EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF THE MERCHANTABILITY AND FITNESS FOR APARTICULAR PURPOSE. This limited warranty gives you specific legal rights; you may have others that vary from state to state. Some states do not allow the exclusion of incidental or consequential damages so some of the above may not apply to you.The entire and exclusive liability and remedy for breach of the Limited Warranty shall be limited to replacement of defective diskette(s) or documentation and shall not include orextend to any claim for or right to recover any other damages, including but not limited to, loss of profit, data, or use of the software, or special, incidental, or consequentialdamages or other similar claims, even if Delta Tau has been specifically advised of the possibility of such dames. In no event will Delta Tau’s liability for damages to you or anyother person ever exceed the actual srcinal price paid, as evidenced by the receipt, for the license to use the software, regardless of any form of the claim. In the event that thesrcinal receipt is lost, the suggested list price at the time of purchase will be substituted as the maximum amount for liability for damages.GOVERNMENT: This license statement shall be construed, interpreted and governed the laws of the State of California. If any provision of this statement is found void orunenforceable, it will not affect the validity of the balance of this statement, which shall remain valid and enforceable according to its terms. If any remedy provided is determinedto have failed of its essential purpose, all limitations of liability and exclusions of damages set forth in the Limited Warranty shall remain in full force and effect. This statementmay only be modified in writing signed by you and an authorized officer of Delta Tau. Use, duplication, or disclosure by the US Government of the computer software anddocumentation in this package shall be subject to the restricted rights applicable to commercial computer software. All rights not specifically granted in this statement are reservedby Delta Tau.Copyright © 2001, 2005, 2007, 2012 Delta Tau Data Systems, Inc. 21314 Lassen St. Chatsworth, CA 91311 818-998-2095. All rights reserved.Delta Tau, PMAC, and the symbol are registered trademarks of Delta Tau Data Systems, Inc.Microsoft, Windows 2000 and XP are registered trademarks of the Microsoft Corporation. Borland is a trademark of Borland International, Inc. Windows is a trademark of Microsoft CorporationDelta Tau Data Systems Inc.21314 Lassen St.Chatsworth, CA 91311(818) 998 2095Fax: (818) 998 7807   PcommServerTable of Contents i Table of Contents INTRODUCTION.......................................................................................................................................................6   A BOUT P COMM S ERVER P RO 2   L IBRARY .....................................................................................................................6   A   G LOBAL V IEW OF THE D RIVER ...............................................................................................................................6   S UPPORTED O PERATING S YSTEMS .............................................................................................................................8   C OMMUNICATION M ODES ..........................................................................................................................................8   Plug & play ports..................................................................................................................................................8     Non-plug & play ports..........................................................................................................................................8    H ARDWARE R EQUIREMENTS ......................................................................................................................................8   D ISTRIBUTION OF P COMM S ERVER P RO 2 FILES ...........................................................................................................8   GETTING STARTED...............................................................................................................................................10   S ETTING UP C OMMUNICATIONS WITH PMAC..........................................................................................................10   U SAGE OF P COMM S ERVER .......................................................................................................................................10    Microsoft VB.NET sample code..........................................................................................................................10    Microsoft C# .NET Example code.......................................................................................................................12   Using PcommServer in MFC using .NET..........................................................................................................18     Interfacing PCOMMSERVER in Visual Studio 6 (C++) Applications...............................................................20   Visual Basic 6.0 Example ...................................................................................................................................25    Borland C++......................................................................................................................................................26    Shutting Down Communication..........................................................................................................................30   PCOMMSERVER FEATURES...............................................................................................................................32    A Guide to Using ASCII Communication Functions...........................................................................................32   Common Problems Experienced Using ASCII Communications Functions.......................................................32   Thread-Safe ASCII Communications..................................................................................................................32    Error Handling - ASCII Communication And Other Functions .........................................................................32   U SING I NTERRUPTS ..................................................................................................................................................33   D OWNLOADING T O PMAC......................................................................................................................................34   INTRODUCTION.....................................................................................................................................................37   I MPORTANT I NFORMATION A BOUT M ETHOD OF C OMMUNICATION B EING U SED BY P COMM S ERVER ......................37   NO PARAMETER SPECIFYING MAXCHAR NEEDED IN P COMM S ERVER .......................................................................37   R OLE CHANGE BETWEEN THE RETURN VALUE AND STATUS WORD ...........................................................................37   INITIALIZATION, SHUTDOWN AND CONFIGURATION FUNCTIONS.....................................................38   S ELECT D EVICE ()   M ETHOD .......................................................................................................................................38   O PEN ()   M ETHOD ......................................................................................................................................................39   C LOSE ()   M ETHOD ....................................................................................................................................................39   ASCII COMMUNICATION FUNCTIONS............................................................................................................41   G ET R ESPONSE E X ()   M ETHOD ...................................................................................................................................41   G ET C ONTROL R ESPONSE E X ()   M ETHOD ...................................................................................................................41   R AW G ET R ESPONSE E X M ETHOD ..............................................................................................................................42   R AW G ET C ONTROL R ESPONSE E X ()   M ETHOD ............................................................................................................43   G ET R ESPONSE P ROGRESS ()   M ETHOD .......................................................................................................................44   A BORT ()   M ETHOD ....................................................................................................................................................44   G ET P MAC T YPE ()   M ETHOD ......................................................................................................................................45   DEVPMACTYPE   E NUMERATION ...........................................................................................................................45   G ET P MAC L OCATION ()   M ETHOD ..............................................................................................................................46   DEVLOCATIONTYPE   E NUMERATION ..................................................................................................................47   S ET C HECKSUMS ()   M ETHOD .....................................................................................................................................47   DPRA VAILABLE (),   DPRS IZE () PROPERTIES .............................................................................................................48   G ET A SCII C OMM (),   S ET A SCII C OMM ()   M ETHODS .....................................................................................................49     PcommServer   ii Table of Contents DEVASCIIMODE   E NUMERATION ..........................................................................................................................49   PUT _USM ONITORING E NABLED () AND PUT _USM ONITORING P ERIOD ()   M ETHODS ..................................................49   P HASE M OTOR ()   M ETHOD ........................................................................................................................................50   P MAC R ESET ()   M ETHOD ...........................................................................................................................................51   P MAC S AVE ()   M ETHOD .............................................................................................................................................51   DPRT EST ()   M ETHOD ...............................................................................................................................................52   A BORT T EST ()   M ETHOD ...........................................................................................................................................53   GET _DPRT ESTING ()   M ETHOD .................................................................................................................................53   DOWNLOADING TO PMAC..................................................................................................................................54   D OWNLOAD ()   M ETHOD ............................................................................................................................................54   D OWNLOADING ()   M ETHOD ......................................................................................................................................55   A BORT D OWNLOAD ()   M ETHOD ................................................................................................................................55   UPLOAD PMAC CONFIGURATION....................................................................................................................57   DEVUPLOAD STRUCTURE .....................................................................................................................................57   U PLOAD ()   M ETHOD .................................................................................................................................................57   GETTING PMAC STATUS.....................................................................................................................................59   S TATUS Q UERY FUNCTIONS .....................................................................................................................................59   G ET T URBO M OTOR S TATUS E X () AND G ET NTM OTOR S TATUS E X ()   M ETHODS .........................................................59   G ET T URBO C OORDINATE S TATUS E X () AND G ET NTC OORDINATE S TATUS E X M ETHODS ..........................................60   G ET T URBO G LOBAL S TATUS E X () AND G ET NTG LOBAL S TATUS E X ()   M ETHODS .......................................................61   EVENTS SUPPORT IN PCOMMSERVER...........................................................................................................63   M ESSAGE E VENT .....................................................................................................................................................63   P ROGRESS E VENT ....................................................................................................................................................63   E RROR E VENTS ........................................................................................................................................................63   U NSOLICITED R EPONSE ............................................................................................................................................63   I NTERRUPTS .............................................................................................................................................................63   DATA GATHERING FUNCTIONS........................................................................................................................64   G ATHER S TRUCTURES ..............................................................................................................................................64   S TART G ATHER ,   S TOP G ATHER M ETHODS ................................................................................................................64   C OLLECT G ATHER D ATA M ETHOD ............................................................................................................................65   G ET G ATHER S AMPLES M ETHOD ...............................................................................................................................65   G ET N UM G ATHER S OURCES M ETHOD .......................................................................................................................66   S ET G ATHER M ETHOD ..............................................................................................................................................67   G ET G ATHER M ETHOD .............................................................................................................................................67   S ET Q UICK G ATHER M ETHOD ...................................................................................................................................68   S ET Q UICK G ATHER W ITH D IRECT C URRENT M ETHOD ...............................................................................................68   C LEAR G ATHER ,   C LEAR G ATHER D ATA M ETHODS ....................................................................................................69   I NIT G ATHER M ETHOD .............................................................................................................................................70   S ET C URRENT G ATHER ..............................................................................................................................................70   G ET G ATHER P OINT M ETHOD ....................................................................................................................................71   PCOMMSERVER DPR FEATURES......................................................................................................................73   A   G LOBAL V IEW OF THE DPR   S UPPORT F UNCTIONS ...............................................................................................73   Fixed Real Time Data buffer...............................................................................................................................73   Fixed Background Data Buffer...........................................................................................................................73    Binary Rotary Buffer...........................................................................................................................................73    Read/Write Functions.........................................................................................................................................74   CONFIGURING DPR REAL TIME FIXED AND BACKGROUND FIXED DATA BUFFERS.....................75   Startup/ShutDown and Handshaking..................................................................................................................75