Resumo do conteúdo contido na página número 1
Mint™ version 4
PC Programming Guide
MN1278
Issue 1.2
MN1278 05.2001
Resumo do conteúdo contido na página número 2
Mint v4 PC Programming Guide ii MN1278 05.2001
Resumo do conteúdo contido na página número 3
Copyright Copyright Baldor UK Ltd © 2001. All rights reserved. This manual is copyrighted and all rights are reserved. This document or attached software may not, in whole or in part, be copied or reproduced in any form without the prior written consent of Baldor UK. Baldor UK makes no representations or warranties with respect to the contents hereof and specifically disclaims any implied warranties of fitness for any particular purpose. The information in this document is subject t
Resumo do conteúdo contido na página número 4
Mint v4 PC Programming Guide iv MN1278 05.2001
Resumo do conteúdo contido na página número 5
Manual Revision History Manual Revision History Issue Date BOCL Comments Reference 1.0 Apr 99 UM00545-000 Raised from MN00249-003. This is a new UM for v4, allowing updates to the v3 manual to continue as MN00249-XYZ 1.1 Feb 00 UM00545-001 Added NextMove PC device driver documentation. Corrected for Mint v4 ( new C++ files, Win2000, WinME. 1.2 May 2001 UM00545-002 Updates for PC Developer Libraries 1302 release. MN1278 05.2001 v
Resumo do conteúdo contido na página número 6
Mint v4 PC Programming Guide vi MN1278 05.2001
Resumo do conteúdo contido na página número 7
Contents Introduction ................................................................................1 1.1 Introduction...............................................................................................2 1.2 Installation................................................................................................2 Communicating with a Controller .............................................3 2.1 NextMove PCI.....................................................................
Resumo do conteúdo contido na página número 8
Mint v4 PC Programming Guide 3.3.2 A Visual Basic Tutorial. ......................................................................27 3.4 Borland Delphi 5.0 ..................................................................................31 PC Based Motion Control ........................................................35 4.1 Limitations of PC based applications ......................................................37 4.2 Events and Interrupt Control on NextMove PCI ......................
Resumo do conteúdo contido na página número 9
Contents 6.10 Data Synchronisation..............................................................................66 Appendix 2: Timings ................................................................67 7.1 Immediate Command Mode Functions ...................................................67 Appendix 3: Symbolic Constants............................................69 Bibliography .............................................................................77 MN1278 05.2001 ix
Resumo do conteúdo contido na página número 10
Resumo do conteúdo contido na página número 11
Introduction 1. Introduction The Mint™ v4 PC Programming Guide details how to call Mint v4 functions and how to communicate with Mint controllers from PC based host applications. 1 MN1278 05.2001 1
Resumo do conteúdo contido na página número 12
Mint v4 PC Programming Guide 1.1 Introduction The PC Developer Libraries allow PC based applications to be written that communicate with Mint controllers. This is achieved using the Mint Interface Library which is a common API (Application Program Interface) for the range of Mint based motion controllers. The Mint Interface Library is suitable for use under Windows 95, 98, ME, NT and 2000 via an ActiveX control or C++ source code. Features include: • Ability to upload and download Mi
Resumo do conteúdo contido na página número 13
Communicating with a Controller 2. Communicating with a Controller This chapter covers general communication with Mint controllers. 2 MN1278 05.2001 3
Resumo do conteúdo contido na página número 14
Mint v4 PC Programming Guide The Mint Interface Library is a common API that allows access to Mint controllers. It can be used via an ActiveX control or through C++ source code. The Mint Interface Library is suitable for use under Windows 95, 98, ME, NT and 2000. The ActiveX control (OCX) can be used with a large number of languages. This document concentrates on Microsoft Visual C++, Microsoft Visual Basic and Borland Delphi but the principle is the same in any language. The C++ sou
Resumo do conteúdo contido na página número 15
Communicating with a Controller The main features and uses of DPR are: • Support for the Mint Comms protocol. This is a method of asynchronously updating variables in a Mint program from the host. Mint pseudo serial buffer. This allows communication with the Mint command line and Mint program • and configuration loading/saving. • Reporting of Mint status. The host can read whether Mint is at the command line and if not, which line it is executing. • Automatic reporting of motion vari
Resumo do conteúdo contido na página número 16
Mint v4 PC Programming Guide /* COMMS location uses */ #define CONTROL_LOCATION 1 #define PARAM_1 2 /* Flags for control location */ #define COMPLETED 0.0 #define SPECIAL_ROUTINE1 1.0 /* Create a handle to the controller */ CNextMovePC myNextMove ( NODE0, nmADDRESS ); /* Define variables */ float fErrorCode; float fOutput = 1.0; float fControl = SPECIAL_ROUTINE1; /* Write to comms location */ myNextMove.setComms (NODE0, PARAM_1, &fOutput ); /* Write to comms location */ myNextMove.setComms (N
Resumo do conteúdo contido na página número 17
Communicating with a Controller 2.5 Interfacing with Mint The Mint command line allows manual execution of Mint keywords. Using the Mint WorkBench, the Mint command line can be used when testing, commissioning and debugging Mint programs. There are several functions in the Mint Interface Library for direct access to the serial buffer: setSerialChar, setSerialCharTimeout, setSerialStringTimeout, getSerialChar, getSerialCharTimeout and getSerialStringTimeout. These allow characters a
Resumo do conteúdo contido na página número 18
Mint v4 PC Programming Guide The following is a summary of the functions used to access the Mint command line: Function Name Description doMintBreak Sends Ctrl-E to Mint,( bypassing the pseudo-serial buffer on NextMove PC and PCI ). doMintRun Write RUN getSerialChar Read a char from the pseudo-serial buffer if one is available getSerialCharTimeout Read a char from the if one is available within the given period of time. getSerialStringTimeout Read up to 64 chars from serial b
Resumo do conteúdo contido na página número 19
Using the Library with Various Languages 3. Using the Library with Various Languages This chapter details the use various different programming languages. The languages covered are: ◊ C++ Visual C++ 6 ◊ 3 ◊ Visual Basic 6 Inprise Delphi ◊ MN1278 05.2001 9
Resumo do conteúdo contido na página número 20
Mint v4 PC Programming Guide 3.1 C++ The Mint Interface Library was written in C++. The source code is provided and can be included in your project. The only supported compilers are Visual C++ v6.0 and Watcom 11. All other compilers must use the ActiveX control to communicate with controllers. 3.1.1 C++ : the Classes The Mint Interface Library contains a C++ class for each controller. In each case the class is defined in the header file in the right of the table. All of these heade