LMMS MN1278 Uživatelský manuál Strana 1

Procházejte online nebo si stáhněte Uživatelský manuál pro Software LMMS MN1278. LMMS MN1278 User's Manual Uživatelská příručka

  • Stažení
  • Přidat do mých příruček
  • Tisk

Shrnutí obsahu

Strany 1 - Mint™ version 4

MN1278 05.2001 Mint™ version 4 PC Programming Guide MN1278 Issue 1.2

Strany 3

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

Strany 4

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

Strany 5 - Manual Revision History

Communicating with a Controller MN1278 05.2001 3 2. Communicating with a Controller 2 This chapter covers general communication with Mint contr

Strany 6

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

Strany 7

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

Strany 8

Mint v4 PC Programming Guide 6 MN1278 05.2001 /* COMMS location uses */#define CONTROL_LOCATION 1#define PARAM_1 2/* Flags for control location

Strany 9 - Contents

Communicating with a Controller MN1278 05.2001 7 2.5 Interfacing with Mint The Mint command line allows manual execution of Mint keywords. Usin

Strany 10

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

Strany 11 - 1. Introduction

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

Strany 12 - 1.2 Installation

Mint v4 PC Programming Guide ii MN1278 05.2001

Strany 13 - 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

Strany 14 - 2.2 NextMove PC

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

Strany 15

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

Strany 16 - Mint v4 PC Programming Guide

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

Strany 17 - 2.5 Interfacing with Mint

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

Strany 18

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)’

Strany 19

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++

Strany 20 - 3.1 C++

Using the Library with Various Languages MN1278 05.2001 17 4. Select ‘Settings’ from the ‘Project’ menu. Select ‘All configurations’ from the ‘S

Strany 21

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

Strany 22

Using the Library with Various Languages MN1278 05.2001 19 6. Select ‘Preprocessor’ from the ‘Category’ drop list. Add ‘.,’ (dot-comma ) follow

Strany 23

Copyright MN1278 05.2001 iii Copyright Baldor UK Ltd © 2001. All rights reserved. This manual is copyrighted and all rights are reserved. Thi

Strany 24

Mint v4 PC Programming Guide 20 MN1278 05.2001 8. Right click on ‘precomp.cpp’ in ‘FileView’ and select ‘Settings’. Select ‘All Configuration

Strany 25

Using the Library with Various Languages MN1278 05.2001 21 10. Select ‘ClassView’. Right click on ‘CVCTutorialDlg’ and select ‘Add Member Functi

Strany 26

Mint v4 PC Programming Guide 22 MN1278 05.2001 12. Select ‘ClassView’. Right click on ‘CVCTutorialDlg’ and select ‘Add Member Variable’. Copy

Strany 27

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

Strany 28

Mint v4 PC Programming Guide 24 MN1278 05.2001 /*------------------------------------------------*//* Toggle it. *//*--------------------------

Strany 29

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

Strany 30

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

Strany 31

Using the Library with Various Languages MN1278 05.2001 27 AfxOleGetMessageFilter()->EnableNotRespondingDialog( FALSE );The file will have to

Strany 32

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

Strany 33

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

Strany 34 - 3.1.5 RS485 Networks

Mint v4 PC Programming Guide iv MN1278 05.2001

Strany 35

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

Strany 36

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

Strany 37 - 3.3 Visual Basic 6

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

Strany 38

Using the Library with Various Languages MN1278 05.2001 33 - MintDriveprocedure TForm1.FormCreate(Sender: TObject);const NodeNumber = 10;const Co

Strany 39

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

Strany 40

PC Based Motion Control MN1278 05.2001 35 4. PC Based Motion Control 4 This chapter covers creating motion applications on the host PC.

Strany 41 - 3.4 Borland Delphi 5.0

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

Strany 42

PC Based Motion Control MN1278 05.2001 37 Functions called from the host fall into two categories. Those functions that replicate Mint keywords

Strany 43

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

Strany 44

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

Strany 45 - 4. PC Based Motion Control

Manual Revision History MN1278 05.2001 v Manual Revision History Issue Date BOCL Reference Comments 1.0 Apr 99 UM00545-000 Raised from MN0024

Strany 46

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

Strany 47 - PC Based Motion Control

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

Strany 48

Mint v4 PC Programming Guide 42 MN1278 05.2001 // timer event handlervoid myTimerEventHandler ( void *p, __int16 nTimerEventNumber ){cout <&

Strany 49

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

Strany 50

Mint v4 PC Programming Guide 44 MN1278 05.2001 installErrorEventHandlerinstallFastInEventHandlerinstallInputEventHandlerinstallMoveBufferLowEve

Strany 51

NextMove PCI and Non-Micorsoft Operating Systems MN1278 05.2001 45 5. NextMove PCI and Non-Microsoft Operating Systems 5 This chapter details h

Strany 52

Mint v4 PC Programming Guide 46 MN1278 05.2001 This Chapter covers implementing an interface to NextMove PCI in under an operating system other

Strany 53

NextMove PCI and Non-Micorsoft Operating Systems MN1278 05.2001 47 5.3.1 The CMySimplePCI Example. The CMySimplePCI example overloads CSimplePCI

Strany 54

Mint v4 PC Programming Guide 48 MN1278 05.2001 ……/*================================================================*//* END : Replace this *//*

Strany 55 - Systems

NextMove PCI and Non-Micorsoft Operating Systems MN1278 05.2001 49 doDeviceClose This function releases any resources which had been taken by the

Strany 56 - 5.3 The CSimplePCI class

Mint v4 PC Programming Guide vi MN1278 05.2001

Strany 57

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

Strany 58 - Constructor

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

Strany 59

Mint v4 PC Programming Guide 52 MN1278 05.2001 Address Use Read Only0x600 0x5FF 0x5FF ICM expansion  0x500 0x500 0x4FF 0x4FF R

Strany 60

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

Strany 61 - 6. Appendix 1: DPR Map

Mint v4 PC Programming Guide 54 MN1278 05.2001 Address Use Read Only 0x002Axis Mix  0x001DPR Status Register 0x000 0x000DPR Control Regist

Strany 62

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

Strany 63 - Appendix 1: DPR Map

Mint v4 PC Programming Guide 56 MN1278 05.2001 6.3 Status and Control Registers Address Use Symbolic Constant Read Only0x000DPR Control Reg

Strany 64 - 6.2 NextMove PC DPR Map

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

Strany 65

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

Strany 66

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

Strany 67

Contents MN1278 05.2001 vii Introduction ...1 1.1 Introduction...

Strany 68

Mint v4 PC Programming Guide 60 MN1278 05.2001 Offset Use Symbolic Constant Data Size0x00Measured Position roPOSITION float 0x01Reserved

Strany 69 - 6.4 Axis Data

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

Strany 70

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

Strany 71 - 6.5 I/O Data

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

Strany 72 - 6.7 Immediate Command Mode

Mint v4 PC Programming Guide 64 MN1278 05.2001 6.9 Special Functions Registers Address Use Symbolic Constant 0x3F8ICM Handshaking roICM_HAND

Strany 73 - 6.8 Pseudo Serial Interface

Appendix 1: DPR Map MN1278 05.2001 65 Functionality Code Register (3FC) This register describes the capabilities of the software running on NextM

Strany 74

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

Strany 75

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

Strany 76 - 6.10 Data Synchronization

Mint v4 PC Programming Guide 68 MN1278 05.2001

Strany 77 - 7. Appendix 2: Timings

Appendix 3: Symbolic Constants MN1278 05.2001 69 8. Appendix 3: Symbolic Constants The library functions can return error codes or can be passed

Strany 78

Mint v4 PC Programming Guide viii MN1278 05.2001 3.3.2 A Visual Basic Tutorial. ...

Strany 79

Mint v4 PC Programming Guide 70 MN1278 05.2001 Value Symbolic Constant Meaning disabled 1025 erINVALID_HANDLE The handle had not been correctl

Strany 80

Appendix 3: Symbolic Constants MN1278 05.2001 71 Value Symbolic Constant Meaning 1054 erCONTROLLER_REPORTS_ERROR The controller detected an erro

Strany 81

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

Strany 82

Appendix 3: Symbolic Constants MN1278 05.2001 73 Value Symbolic Constant Meaning 1119 erSQ_INVALID_OUTPUT_FILE_STRING Squash : Name of file to s

Strany 83

Mint v4 PC Programming Guide 74 MN1278 05.2001 updateFirmware Codes (nBootDevice Parameter): Value Symbolic Constant Meaning 0 tmFLASH Load pr

Strany 84

Appendix 3: Symbolic Constants MN1278 05.2001 75 Value Symbolic Constant Meaning 4 updateDOWNLOADING Downloading the firmware: use the percentag

Strany 85

Mint v4 PC Programming Guide 76 MN1278 05.2001

Strany 86

Bibliography MN1278 05.2001 77 9. Bibliography 6 Bibliography [1] Mint v4 Programming Guide [MN1262] [2] Mint v4 Advanced Programming Gui

Strany 87 - 9. Bibliography

Mint v4 PC Programming Guide 78 MN1278 05.2001

Strany 88

Contents MN1278 05.2001 ix 6.10 Data Synchronisation....................66 Appendix 2:

Komentáře k této Příručce

Žádné komentáře