MN1278 05.2001 Mint™ version 4 PC Programming Guide MN1278 Issue 1.2
Introduction MN1278 05.2001 1 1. Introduction 1 The Mint™ v4 PC Programming Guide details how to call Mint v4 functions and how to communicate w
Mint v4 PC Programming Guide 2 MN1278 05.2001 1.1 Introduction The PC Developer Libraries allow PC based applications to be written that commun
Communicating with a Controller MN1278 05.2001 3 2. Communicating with a Controller 2 This chapter covers general communication with Mint contr
Mint v4 PC Programming Guide 4 MN1278 05.2001 The Mint Interface Library is a common API that allows access to Mint controllers. It can be use
Communicating with a Controller MN1278 05.2001 5 The main features and uses of DPR are: • Support for the Mint Comms protocol. This is a method
Mint v4 PC Programming Guide 6 MN1278 05.2001 /* COMMS location uses */#define CONTROL_LOCATION 1#define PARAM_1 2/* Flags for control location
Communicating with a Controller MN1278 05.2001 7 2.5 Interfacing with Mint The Mint command line allows manual execution of Mint keywords. Usin
Mint v4 PC Programming Guide 8 MN1278 05.2001 The following is a summary of the functions used to access the Mint command line: Function Name
Using the Library with Various Languages MN1278 05.2001 9 3. Using the Library with Various Languages 3 This chapter details the use various di
Mint v4 PC Programming Guide ii MN1278 05.2001
Mint v4 PC Programming Guide 10 MN1278 05.2001 3.1 C++ The Mint Interface Library was written in C++. The source code is provided and can be
Using the Library with Various Languages MN1278 05.2001 11 File Controller nmbase.cpp NextMove PC nmstd.cpp NextMove PC precomp.cpp All serial.cp
Mint v4 PC Programming Guide 12 MN1278 05.2001 Figure 3-1: Visual C++ 6.0 Project Settings (step 5) 6. Add #include “precomp.h” to the top of
Using the Library with Various Languages MN1278 05.2001 13 Figure 3-2: Visual C++ 6.0 Project Settings (step 7) 8. Select precomp.cpp in File Vi
Mint v4 PC Programming Guide 14 MN1278 05.2001 Figure 3-3: Visual C++ 6.0 Project Settings (step 8) 9. Rebuild the project. Precomp.cpp shou
Using the Library with Various Languages MN1278 05.2001 15 1. Open Visual C and select ‘ New’ from the ‘File’ menu. Select ‘MFC Appwizard(exe)’
Mint v4 PC Programming Guide 16 MN1278 05.2001 2. At Step 1 of the wizard, select ‘Dialog based’ and press ‘Finish’. Figure 3-5: Visual C++
Using the Library with Various Languages MN1278 05.2001 17 4. Select ‘Settings’ from the ‘Project’ menu. Select ‘All configurations’ from the ‘S
Mint v4 PC Programming Guide 18 MN1278 05.2001 5. Select ‘Precompiled Headers’ in the ‘Category’ drop list. Change ‘stdafx.h’ to ‘precomp.h’ i
Using the Library with Various Languages MN1278 05.2001 19 6. Select ‘Preprocessor’ from the ‘Category’ drop list. Add ‘.,’ (dot-comma ) follow
Copyright MN1278 05.2001 iii Copyright Baldor UK Ltd © 2001. All rights reserved. This manual is copyrighted and all rights are reserved. Thi
Mint v4 PC Programming Guide 20 MN1278 05.2001 8. Right click on ‘precomp.cpp’ in ‘FileView’ and select ‘Settings’. Select ‘All Configuration
Using the Library with Various Languages MN1278 05.2001 21 10. Select ‘ClassView’. Right click on ‘CVCTutorialDlg’ and select ‘Add Member Functi
Mint v4 PC Programming Guide 22 MN1278 05.2001 12. Select ‘ClassView’. Right click on ‘CVCTutorialDlg’ and select ‘Add Member Variable’. Copy
Using the Library with Various Languages MN1278 05.2001 23 14. The code should now compile, but not link. The following files should be added t
Mint v4 PC Programming Guide 24 MN1278 05.2001 /*------------------------------------------------*//* Toggle it. *//*--------------------------
Using the Library with Various Languages MN1278 05.2001 25 3.2.2 The ActiveX Control and Error Handling. The ActiveX control produces COM (Activ
Mint v4 PC Programming Guide 26 MN1278 05.2001 When using the Active Control, warning messages such as the dialog above ( taken from a Visual
Using the Library with Various Languages MN1278 05.2001 27 AfxOleGetMessageFilter()->EnableNotRespondingDialog( FALSE );The file will have to
Mint v4 PC Programming Guide 28 MN1278 05.2001 Figure 3-12: Selection of Mint Component 3. Find ‘Baldor Motion Library XXXX for Mint Build XX
Using the Library with Various Languages MN1278 05.2001 29 6. In the Form_Load module we will tell the COM server which type of controller we wan
Mint v4 PC Programming Guide iv MN1278 05.2001
Mint v4 PC Programming Guide 30 MN1278 05.2001 Figure 3-13: Example Dialog Box 9. Add the following code to trap this (or any other error). P
Using the Library with Various Languages MN1278 05.2001 31 3.4 Borland Delphi 5.0 NOTE: Before any programs, including the examples, can be buil
Mint v4 PC Programming Guide 32 MN1278 05.2001 Figure 3-14: Delphi – Installing Mint Component 3. Select the ActiveX tab on the toolbar. The
Using the Library with Various Languages MN1278 05.2001 33 - MintDriveprocedure TForm1.FormCreate(Sender: TObject);const NodeNumber = 10;const Co
Mint v4 PC Programming Guide 34 MN1278 05.2001 6. This code should now run. To add an error handler, change the first parameter to setDriveEn
PC Based Motion Control MN1278 05.2001 35 4. PC Based Motion Control 4 This chapter covers creating motion applications on the host PC.
Mint v4 PC Programming Guide 36 MN1278 05.2001 The Mint Interface Library provides all of the functionality that is available in the Mint progr
PC Based Motion Control MN1278 05.2001 37 Functions called from the host fall into two categories. Those functions that replicate Mint keywords
Mint v4 PC Programming Guide 38 MN1278 05.2001 4.2 Events and Interrupt Control on NextMove PCI The NextMove PCI controller requires a device
PC Based Motion Control MN1278 05.2001 39 Priority Event 6 Timer 7 Digital input 8 Comms 9 DPR event 10 Move Buffer Low 11 Axis Idle Note: The
Manual Revision History MN1278 05.2001 v Manual Revision History Issue Date BOCL Reference Comments 1.0 Apr 99 UM00545-000 Raised from MN0024
Mint v4 PC Programming Guide 40 MN1278 05.2001 DPR The install function for DPR events, it accepts a pointer to a function, if this is a NULL p
PC Based Motion Control MN1278 05.2001 41 Stop Switch The install function for stop switch events, it accepts a pointer to a function, if this is
Mint v4 PC Programming Guide 42 MN1278 05.2001 // timer event handlervoid myTimerEventHandler ( void *p, __int16 nTimerEventNumber ){cout <&
PC Based Motion Control MN1278 05.2001 43 4.2.3 Interrupting the Host from a Mint Program ( DPR Events ) Events can be manually generated in bot
Mint v4 PC Programming Guide 44 MN1278 05.2001 installErrorEventHandlerinstallFastInEventHandlerinstallInputEventHandlerinstallMoveBufferLowEve
NextMove PCI and Non-Micorsoft Operating Systems MN1278 05.2001 45 5. NextMove PCI and Non-Microsoft Operating Systems 5 This chapter details h
Mint v4 PC Programming Guide 46 MN1278 05.2001 This Chapter covers implementing an interface to NextMove PCI in under an operating system other
NextMove PCI and Non-Micorsoft Operating Systems MN1278 05.2001 47 5.3.1 The CMySimplePCI Example. The CMySimplePCI example overloads CSimplePCI
Mint v4 PC Programming Guide 48 MN1278 05.2001 ……/*================================================================*//* END : Replace this *//*
NextMove PCI and Non-Micorsoft Operating Systems MN1278 05.2001 49 doDeviceClose This function releases any resources which had been taken by the
Mint v4 PC Programming Guide vi MN1278 05.2001
Mint v4 PC Programming Guide 50 MN1278 05.2001 The following files may also be added: • host_def.cpp : if the function getErrorString is being
Appendix 1: DPR Map MN1278 05.2001 51 6. Appendix 1: DPR Map Each area of the address map is described below. Where an address is shown, that i
Mint v4 PC Programming Guide 52 MN1278 05.2001 Address Use Read Only0x600 0x5FF 0x5FF ICM expansion 0x500 0x500 0x4FF 0x4FF R
Appendix 1: DPR Map MN1278 05.2001 53 Address Use Read Only0x130 0x130 0x12F 0x12F IO Data 0x110 0x110 0x10F 0x10F Axis 7 Data 0x0F0
Mint v4 PC Programming Guide 54 MN1278 05.2001 Address Use Read Only 0x002Axis Mix 0x001DPR Status Register 0x000 0x000DPR Control Regist
Appendix 1: DPR Map MN1278 05.2001 55 Address Use Read Only 0x0CF Axis 5 Data 0x0B0 0x0AF Axis 4 Data 0x090 0x08F Axis 3 Data
Mint v4 PC Programming Guide 56 MN1278 05.2001 6.3 Status and Control Registers Address Use Symbolic Constant Read Only0x000DPR Control Reg
Appendix 1: DPR Map MN1278 05.2001 57 DPR Control Register – NextMove PC: Bit Meaning Symbolic Constant 0 Lock DPR contents btLOCK 1 Lock axi
Mint v4 PC Programming Guide 58 MN1278 05.2001 MML Build ID: The build identifier of the Mint Motion Library running on NextMove. Each version
Appendix 1: DPR Map MN1278 05.2001 59 NextMove PCI: Axis Configurations gives the current configuration of each axis in 4 bits. 31 28 27
Contents MN1278 05.2001 vii Introduction ...1 1.1 Introduction...
Mint v4 PC Programming Guide 60 MN1278 05.2001 Offset Use Symbolic Constant Data Size0x00Measured Position roPOSITION float 0x01Reserved
Appendix 1: DPR Map MN1278 05.2001 61 6.5 I/O Data The I/O data area is as follows: Address Use Symbolic Constant Data Size 0x110Analog 0 roAN
Mint v4 PC Programming Guide 62 MN1278 05.2001 The layout of the section is compatible to the current layout on NextMove PC. The locations use
Appendix 1: DPR Map MN1278 05.2001 63 6.8 Pseudo Serial Interface The serial interface works by implementing a 64 word circular buffer within DP
Mint v4 PC Programming Guide 64 MN1278 05.2001 6.9 Special Functions Registers Address Use Symbolic Constant 0x3F8ICM Handshaking roICM_HAND
Appendix 1: DPR Map MN1278 05.2001 65 Functionality Code Register (3FC) This register describes the capabilities of the software running on NextM
Mint v4 PC Programming Guide 66 MN1278 05.2001 6.10 Data Synchronization It may be desirable to prevent NextMove PC and PCI from updating the
Appendix 2: Timings MN1278 05.2001 67 7. Appendix 2: Timings These timings show the time taken to call Immediate Command Mode (ICM) functions fro
Mint v4 PC Programming Guide 68 MN1278 05.2001
Appendix 3: Symbolic Constants MN1278 05.2001 69 8. Appendix 3: Symbolic Constants The library functions can return error codes or can be passed
Mint v4 PC Programming Guide viii MN1278 05.2001 3.3.2 A Visual Basic Tutorial. ...
Mint v4 PC Programming Guide 70 MN1278 05.2001 Value Symbolic Constant Meaning disabled 1025 erINVALID_HANDLE The handle had not been correctl
Appendix 3: Symbolic Constants MN1278 05.2001 71 Value Symbolic Constant Meaning 1054 erCONTROLLER_REPORTS_ERROR The controller detected an erro
Mint v4 PC Programming Guide 72 MN1278 05.2001 Value Symbolic Constant Meaning 1093 erICM_RX_SIZE_ERROR Error in ICM protocol 1094 erICM_PROCE
Appendix 3: Symbolic Constants MN1278 05.2001 73 Value Symbolic Constant Meaning 1119 erSQ_INVALID_OUTPUT_FILE_STRING Squash : Name of file to s
Mint v4 PC Programming Guide 74 MN1278 05.2001 updateFirmware Codes (nBootDevice Parameter): Value Symbolic Constant Meaning 0 tmFLASH Load pr
Appendix 3: Symbolic Constants MN1278 05.2001 75 Value Symbolic Constant Meaning 4 updateDOWNLOADING Downloading the firmware: use the percentag
Mint v4 PC Programming Guide 76 MN1278 05.2001
Bibliography MN1278 05.2001 77 9. Bibliography 6 Bibliography [1] Mint v4 Programming Guide [MN1262] [2] Mint v4 Advanced Programming Gui
Mint v4 PC Programming Guide 78 MN1278 05.2001
Contents MN1278 05.2001 ix 6.10 Data Synchronisation....................66 Appendix 2:
Kommentare zu diesen Handbüchern