PCI-8144

4-Axis Stepper

Motion Control Card

User's Manual

Manual Rev. 2.01

Revision Date: September 2, 2008

Part No: 50-11144-1010

![The image displays the universal recycling symbol, known as the Mobius loop. It features a solid black circle containing a white symbol composed of three arrows arranged in a triangular formation. Each arrow points toward the next in a continuous cycle and is stylized with parallel lines along its length to resemble a ribbon. There is no text present in the image.](.pci-8144-50-11144-1010-201/e9b2dffc4247132d989f45e0a063eaf3d83a817ba4688f9ad0622be1764e9abe.jpg)
Recycled Paper

Copyright 2008 ADLINK TECHNOLOGY INC.

All Rights Reserved.

The information in this document is subject to change without prior notice in order to improve reliability, design, and function and does not represent a commitment on the part of the manufacturer.

In no event will the manufacturer be liable for direct, indirect, special, incidental, or consequential damages arising out of the use or inability to use the product or documentation, even if advised of the possibility of such damages.

This document contains proprietary information protected by copyright. All rights are reserved. No part of this manual may be reproduced by any mechanical, electronic, or other means in any form without prior written permission of the manufacturer.

Trademarks

NuDAQ, NuIPC, DAQBench are registered trademarks of ADLINK Technology Inc.

Product names mentioned herein are used for identification purposes only and may be trademarks and/or registered trademarks of their respective companies.

# Getting Service from ADLINK

Customer Satisfaction is top priority for ADLINK Technology Inc. Please contact us should you require any service or assistance.

# ADLINK TECHNOLOGY INC.

Web Site: http://www.adlinktech.com

Sales & Service: Service@adlinktech.com

TEL: +886-2-82265877

FAX: +886-2-82265717

Address: 9F, No. 166, Jian Yi Road, Chungho City,

Taipei, 235 Taiwan

Please email or FAX this completed service form for prompt and satisfactory service.

<table><tr><td colspan="2">Company Information</td></tr><tr><td>Company/Organization</td><td></td></tr><tr><td>Contact Person</td><td></td></tr><tr><td>E-mail Address</td><td></td></tr><tr><td>Address</td><td></td></tr><tr><td>Country</td><td></td></tr><tr><td>TEL</td><td>FAX:</td></tr><tr><td>Web Site</td><td></td></tr><tr><td colspan="2">Product Information</td></tr><tr><td>Product Model</td><td></td></tr><tr><td>Environment</td><td>OS:M/B: CPU:Chipset: BIOS:</td></tr></table>

Please give a detailed description of the problem(s):

# Table of Contents

# Table of Contents...... i

# List of Tables...... v

# List of Figures ...... vi

# 1 Introduction ...... 1

1.1 Features.... 5
1.2 Specifications.... 6
1.3 Supported Software 7

Programming Library 7

MotionCreatorPro 7

# 2 Installation 9

2.1 Package Contents 9
2.2 PCI-8144 Outline Drawing 10
2.3 PCI-8144 Hardware Installation.... 11

Hardware configuration 11
PCI slot selection 11
Installation Procedures 11
Troubleshooting: 11

2.4 Software Driver Installation.... 13
2.5 SW1 Card Index Selection.... 13
2.6 J1-J8 Pulse Output Type: Differential / Open Collector ..... 14
2.7 JP2 Direct Control to Stepper 14
2.8 CN1 Pin Assignments: Main connector 15

# 3 Signal Connections.... 17

3.1 Pulse Output Signals CW and CCW 18
3.2 Origin Signal ORG 21
3.3 Slow Down input signal.... 22
3.4 End-Limit Signals PEL and MEL 23
3.5 Simultaneously Start/Stop Signals STA and STP 24
3.6 Termination Board 25
3.7 General Purpose DIO 25

Isolated Input channels 26
Isolated Output channels 26
Example of input connection 26

Example of output connection 27

3.8 JP2 pin define for stepping singal (Optional) 27

# 4 Operation Theory 29

4.1 Classifications of Motion Controller.... 29

Voltage motion control interface 29

Pulse motion control interface 30

Network motion control interface 30

Software real-time motion control kernel 31

DSP motion control kernel 31

ASIC motion control kernel 31

Compare Table of all motion control types 32

PCI-8144 motion controller type 32

4.2 Motion Control Modes.... 33

Coordinate system 33

Absolute and relative position move 34

Trapezoidal speed profile 35

S-curve and Bell-curve speed profile 36

Velocity mode 38

One axis position mode 39

Home Return Mode 40

Synchronous Start Function 41

Auto Home Move Mode 42

4.3 The motor driver interface.... 44

Pulse Command Output Interface 44

4.4 Mechanical switch interface 46

Original or home signal 46

End-Limit switch signal 46

Slow down switch 46

4.5 The Counters 47

Preset Command position counter 47

4.6 Interrupt Control 47

4.7 Multiple Card Operation 50

# 5 MotionCreatorPro 51

5.1 Run MotionCreatorPro 51

5.2 About MotionCreatorPro 52

5.3 MotionCreatorPro Form Introducing 53

Main Menu 53

Select Menu 54

Card Information Menu 55

Configuration Menu 56

Single Axis Operation Menu 59

Four-Axis Operation Menu 63

Help Menu 65

# 6 Function Library 67

6.1 List of Functions.... 68
6.2 C/C++ Programming Library 71
6.3 System and Initialization 72

\_8144\_initial 72
\_8144\_close 74
\_8144\_get\_version 75
\_8144\_set\_security\_key 76
\_8144\_check\_security\_key 78
\_8144\_reset\_security\_key 80
\_8144\_config\_from\_file 82

6.4 Motion Interface I/O 83

\_8144\_set\_limit\_logic 83
\_8144\_get\_limit\_logic 85
\_8144\_get\_mio\_status 87
\_8144\_set\_mio\_sensitivity 89
\_8144\_set\_pls\_outmode 91
\_8144\_set\_pls\_outmode2 93

6.5 Motion 94

\_8144\_tv\_move 94
\_8144\_sv\_move 96
\_8144\_start\_tr\_move 98
\_8144\_start\_sr\_move 101
\_8144\_enable\_get\_command 104
\_8144\_get\_command 105
\_8144\_set\_command 106
\_8144\_set\_external\_start 107
\_8144\_emg\_stop 109
\_8144\_dec\_stop 111
\_8144\_speed\_up 113
\_8144\_slow\_down 114
\_8144\_enable\_org\_stop 116
\_8144\_enable\_sd\_signal 118
\_8144\_home\_move 120

\_8144\_home\_status 122

6.6 Motion status.... 125

\_8144\_motion\_done 125

\_8144\_motion\_status 127

6.7 Interrupt 129

\_8144\_set\_motion\_interrupt\_factor 129

\_8144\_wait\_single\_motion\_interrupt 131

\_8144\_set\_gpio\_interrupt\_factor 134

\_8144\_wait\_single\_gpio\_interrupt 136

\_8144\_wait\_multiple\_gpio\_interrupt 138

6.8 General purpose input/output 141

\_8144\_get\_gpio\_input 141

\_8144\_get\_gpio\_input\_channel 142

\_8144\_set\_gpio\_output 143

\_8144\_set\_gpio\_output\_channel 144

\_8144\_get\_gpio\_output 145

\_8144\_get\_gpio\_output\_channel 146

6.9 Speed profile calculation.... 147

\_8144\_get\_tv\_move\_profile 147

\_8144\_get\_sv\_move\_profile 149

\_8144\_get\_start\_tr\_move\_profile 151

\_8144\_get\_start\_sr\_move\_profile 153

# 7 Function Return Code 155

# List of Tables

Table 2-1: SW1 Card Index 13

Table 2-2: JP2 Direct Control to Stepper 14

Table 2-3: CN1 Pin Assignments 15

Table 6-1: Data type definitions 71

# List of Figures

Figure 1-1: PCI-8144 Block Diagram 2

Figure 1-2: Flow chart for building an application 4

Figure 2-1: PCB Layout of the PCI-8144 10

# 1 Introduction

The PCI-8144 is a cost-effective 4-axis motion controller card with a PCI interface that can generate a pulse train up to $2.4\mathrm{MHz}$ to control a stepper motor. As a motion controller, it provides non-symmetric acceleration and deceleration speed profile settings, T-curve and S-surve speed profile control, and simultaneously start/stop. Changing speed on the fly is also available with a single axis operation.

Multiple PCI-8144 cards can be installed in one system. The on-board switch can be used to the set a specific index for each board in order to manage multiple cards.

Figure 1 shows the functional block diagram of the PCI-8144 card. All functions and computations are performed internally by the ASIC, thus limiting the impact on the PC's CPU.

![This diagram illustrates a hardware architecture centered around a PLX9052 chip.\n\n**Top Section:**\n*   At the very top is the **PCI Bus**.\n*   Below it are two boxes: **ROM** (left) and **CPLD** (right). Both have bidirectional arrows connecting them to the **PCI Bus**.\n*   The **CPLD** has a bidirectional arrow connecting it to a box labeled **Card ID**.\n*   Below ROM and CPLD is a box labeled **PLX9052**. It has bidirectional arrows connecting to ROM, CPLD, and the PCI Bus.\n\n**Middle Section:**\n*   Below the PLX9052 is a box labeled **ASIC**. It is connected to the PLX9052 via a bidirectional arrow.\n*   To the left is a power section. A box labeled **DC/DC** receives input from **Ext +24V**.\n*   From the bottom of the **DC/DC** box, lines extend downward and split:\n    *   One arrow points left to **Ext +5V**.\n    *   One arrow points right to **+5V**, which connects into the **Isolation** block.\n\n**Bottom Section:**\n*   Below the ASIC is a grey oval labeled **Isolation**. It has a bidirectional arrow connecting it to the ASIC above.\n*   From the bottom of the **Isolation** oval, arrows point down to a row of four connected boxes:\n    1.  **Pulse Output**: Below this box is the text **CW/CCW**.\n    2.  **Mechanical Interface**: Below this box are the texts **+EL,-EL**, **SD**, and **ORG**.\n    3.  **Simultaneously Control**: Below this box are the texts **STA** and **STP**.\n    4.  **Digital I/O**: Below this box are the texts **DI *8** and **DO *8**.](.pci-8144-50-11144-1010-201/590b1cb3983a01c709bc559fa2535009c0afa26eb44c7e1f69e474381dc33319.jpg)

Figure 1-1: PCI-8144 Block Diagram

MotionCreatorPro is a Windows-based application development software package included with the PCI-8144 and is useful for debugging a motion control system during the design phase of a project. An on-screen display lists information of all installed axes and I/O signal status of the PCI-8144.

Windows programming libraries are also included for C++ and Visual Basic. Sample programs are provided to illustrate the operations of the functions.

Figure 1-2 illustrates a flow chart of the recommended process in using this manual in developing an application. Refer to the related chapters for details of each step.
![Here is an accurate description of the flowchart:\n\n**Blocks and Text:**\n*   **Top Rectangle:** Contains 'Hardware Installation', 'Jumper Setting', and 'Wiring'. To the right is the text 'Chapter 2 & 3'.\n*   **Second Rectangle:** Contains 'Using MotionCreatorPro to', 'Configure a System'. To the right is 'Chapter 5'.\n*   **Third Rectangle:** Contains 'Using Motion Creator', 'to Verify Operations'. To the right is 'Chapter 4 & 5'.\n*   **Fourth Rectangle:** Contains 'Using the Function Libraries', 'to Develop Applications'. To the right is 'Chapter 4 & 6'.\n*   **Diamond:** Contains 'System is', 'OK?'.\n*   **Bottom Circle:** Contains 'END'.\n\n**Connections:**\n*   An arrow points downward from the top rectangle to the second rectangle.\n*   An arrow points downward from the second rectangle to the third rectangle.\n*   An arrow points downward from the third rectangle to the fourth rectangle.\n*   An arrow points downward from the fourth rectangle to the 'System is OK?' diamond.\n*   From the diamond, an arrow labeled 'Yes' points downward to the 'END' circle.\n*   From the diamond, an arrow labeled 'No' exits to the left, travels upward, and splits into two arrows pointing right. One arrow points into the second rectangle ('Using MotionCreatorPro to Configure a System'), and the other arrow points into the fourth rectangle ('Using the Function Libraries to Develop Applications').](.pci-8144-50-11144-1010-201/c19b646ede2d85b7d03312245e11f1ac76f0f4278a25c1484a9e10b3465a3130.jpg)

Figure 1-2: Flow chart for building an application

# 1.1 Features

The following list summarizes the main features of the PCI-8144 motion control system.

▶ 32-bit PCI bus Plug and Play
▶ 4 pulse train channel for stepping motors
▶ Maximum output frequency: up to 2.4MPPS
▶ Pulse output options: CW/CCW
▶ Programmable acceleration and deceleration time for all modes
▶ Trapezoidal and S-curve velocity profiles for all modes
▶ Change speed on the fly
▶ Home return modes with ORG & SD signal
▶ Hardware backlash compensator and vibration suppression
▶ Card index setting by switch
▶ All digital input and output signals are 2500Vrms isolated
▶ Programmable interrupt sources
▶ Simultaneous start/stop
▶ Software supports a maximum of up to 12 PCI-8144 cards operation in one system
▶ Includes MotionCreatorPro, a Microsoft Windows-based application development software
PCI-8144 libraries and utilities for Windows 2000/XP.

# 1.2 Specifications

# Applicable Motors

Stepping motors
Excitation sequencing output for 2-phase stepping motor with JP2 connector

# Performance

▶ Number of controllable axes: 4
▷ Maximum pulse output frequency: 2.4MPPS, trapezoidal, or S-Curve speed profile
▷ Internal reference clock: 4.9MHz
▷ Position pulse setting range (28-bit): -134,217,728 to +134,217,728

# I/O Signales

▷ Input/Output signals for each axis
▷ All I/O signal are optically isolated with 2500Vrms isolation voltage
▷ Command pulse output pins: CW and CCW
▶ Mechanical limit/switch signal input pins: ±EL, PSD/MSD, and ORG
▶ Digital input/output: DIN & DOUT
▷ Simultaneous Start/Stop signal: STA and STP

# General Specifications

▷ Connectors: 68-pin SCSI-type connector
▶ Operating Temperature: 0°C - 50°C
Storage Temperature: -20°C - 80°C
▷ Humidity: 5 - 85%, non-condensing

# Power Consumption

▶ Slot power supply (input): +5V DC ±5%, 900mA max
▷ External power supply (input): +24V $_{DC}$ ±5%, 500mA max
▷ External power supply (output): +5V $_{DC}$ ±5%, 500mA, max

# PCI-8144 Dimensions

▷ 159mm(L) X 126 mm(W)

# 1.3 Supported Software

# 1.3.1 Programming Library

Windows 2000/XP DLLs are provided for the PCI-8144. These function libraries are shipped with the board.

# 1.3.2 MotionCreatorPro

This Windows-based utility is used to setup cards, motors, and systems. It can also aid in debugging hardware and software problems. It allows for the setting of I/O logic parameters to be loaded in custom program. This product is also bundled with the card.

Refer to Chapter 5 for more details.

# 2 Installation

This chapter describes how to install PCI-8144. Please follow these steps below:

▶ Check what you have (section 2.1)
▶ Check the PCB (section 2.2)
▶ Install the hardware (section 2.3)
▶ Install the software driver (section 2.4)
▶ Understanding the I/O signal connections (chapter 3) and their operation (chapter 4)
▶ Understanding the connector pin assignments (the remaining sections) and wiring the connections

# 2.1 Package Contents

In addition to this User's Guide, the package also includes the following items:

PCI-8144: 4-Axis Stepper Motion Control Card
▶ ADLINK All-in-one Compact Disc
▶ An optional terminal board for wiring purposes if a different model is ordered.

If any of these items are missing or damaged, contact the dealer from whom you purchased the product. Save the shipping materials and carton to ship or store the product in the future.

# 2.2 PCI-8144 Outline Drawing

![Technical line drawing of a server rack with connector blocks and indicator lights (no text or symbols)](.pci-8144-50-11144-1010-201/7e06f9610d2fdc48c38b07394ba1b56adee43b468dd3a3db3254c9be2cb4a664.jpg)

Figure 2-1: PCB Layout of the PCI-8144

▶ CN1: Input/Output signal connector
▶ JP2: Direct control to stepper
▶ SW1: Card ID selection
▶ J1-J8: Pulse output selection jumper

# 2.3 PCI-8144 Hardware Installation

# 2.3.1 Hardware configuration

The PCI-8144 is fully Plug-and-Play compliant. Hence, memory allocation (I/O port locations) and IRQ channel of the PCI card are assigned by the system BIOS. The address assignment is done on a board-by-board basis for all PCI cards in the system.

# 2.3.2 PCI slot selection

Some computer system may have both PCI and ISA slots. Do not force the PCI card into a PC/AT slot. The PCI-8144 can be used in any PCI slot.

# 2.3.3 Installation Procedures

1. Read through this manual and setup the jumper according to your application
2. Turn off your computer. Turn off all accessories (printer, modem, monitor, etc.) connected to computer. Remove the cover from the computer.
3. Select a 32-bit PCI expansion slot. PCI slots are shorter than ISA or EISA slots and are usually white or ivory.
4. Before handling the PCI-8144, discharge any static buildup on your body by touching the metal case of the computer. Hold the edge of the card and do not touch the components.
5. Position the board into the PCI slot you have selected.
6. Secure the card in place at the rear panel of the system unit using screws removed from the slot.

# 2.3.4 Troubleshooting:

If your system doesn't boot or if you experience erratic operation with your PCI board in place, it's most likely caused by an interrupt conflict (possibly an incorrect ISA setup). In general, the solution, once determined it is not a simple oversight, is to consult the BIOS documentation that comes with your system.

Check the control panel of the Windows system if the card is listed by the system. If not, check the PCI settings in the BIOS or use another PCI slot.

# 2.4 Software Driver Installation

1. Auto run the ADLINK All-In-One CD. Choose Driver Installation -> Motion Control -> PCI-8144.
2. Follow the procedures of the installer.
3. After setup installation is completed, restart windows.

Note: Please download the latest software from ADLINK website if necessary.

# 2.5 SW1 Card Index Selection

The SW1 switch is used to set the card index. For example, if 1 is set to ON and the others are OFF, that card index is 1. The index value can be from 0 to 15. Refer to the following table for details.

<table><tr><td>Card ID</td><td>Switch Setting (ON=1)</td></tr><tr><td>0</td><td>0000</td></tr><tr><td>1</td><td>0001</td></tr><tr><td>2</td><td>0010</td></tr><tr><td>3</td><td>0011</td></tr><tr><td>4</td><td>0100</td></tr><tr><td>5</td><td>0101</td></tr><tr><td>6</td><td>0110</td></tr><tr><td>7</td><td>0111</td></tr><tr><td>8</td><td>1000</td></tr><tr><td>9</td><td>1001</td></tr><tr><td>10</td><td>1010</td></tr><tr><td>11</td><td>1011</td></tr><tr><td>12</td><td>1100</td></tr><tr><td>13</td><td>1101</td></tr><tr><td>14</td><td>1110</td></tr><tr><td>15</td><td>1111</td></tr></table>

Table 2-1: SW1 Card Index

# 2.6 J1-J8 Pulse Output Type: Differential / Open Collector

Jumpers J1-J8 are used to set the type of pulse output signals. The output signal type can either be differential line driver or open collector output. Refer to section 3.1 for detail jumper settings.

<table><tr><td>J1 &amp; J2</td><td>Axis 0</td></tr><tr><td>J3 &amp; J4</td><td>Axis 1</td></tr><tr><td>J5 &amp; J6</td><td>Axis 2</td></tr><tr><td>J7 &amp; J8</td><td>Axis 3</td></tr></table>

![Line Driver\nOpen Collector\nJ1\n1\n2\n3](.pci-8144-50-11144-1010-201/57e19eefa965c9d9c87defd74a0f9a53b6243c06f48e273793deac16fe26a57f.jpg)

# 2.7 JP2 Direct Control to Stepper

<table><tr><td>No.</td><td>Name</td><td>Function</td><td>No.</td><td>Name</td><td>Function</td></tr><tr><td>1</td><td>DGND</td><td>Bus power ground</td><td>2</td><td>PB4</td><td>Axis 3 Pulser PHB</td></tr><tr><td>3</td><td>PA4</td><td>Axis 4 Pulser PHA</td><td>4</td><td>PB3</td><td>Axis 2 Pulser PHB</td></tr><tr><td>5</td><td>PA3</td><td>Axis 3 Pulser PHA</td><td>6</td><td>VCC</td><td>Bus Power +5V</td></tr><tr><td>7</td><td>DGND</td><td>Bus power ground</td><td>8</td><td>PB2</td><td>Axis 1 Pulser PHB</td></tr><tr><td>9</td><td>PA2</td><td>Axis 1 Pulser PHA</td><td>10</td><td>PB1</td><td>Axis 0 Pulser PHB</td></tr><tr><td>11</td><td>PA1</td><td>Axis 0 Pulser PHA</td><td>12</td><td>VCC</td><td>Bus Power +5V</td></tr><tr><td>13</td><td>--</td><td>N/A</td><td>14</td><td>--</td><td>N/A</td></tr><tr><td>15</td><td>--</td><td>N/A</td><td>16</td><td>--</td><td>N/A</td></tr><tr><td>17</td><td>--</td><td>N/A</td><td>18</td><td>--</td><td>N/A</td></tr><tr><td>19</td><td>--</td><td>N/A</td><td>20</td><td>--</td><td>N/A</td></tr></table>

Table 2-2: JP2 Direct Control to Stepper

# 2.8 CN1 Pin Assignments: Main connector

CN1 is the major connector for the motion control I/O signals.

<table><tr><td>No.</td><td>Name</td><td>I/O</td><td>Function</td><td>No.</td><td>Name</td><td>I/O</td><td>Function</td></tr><tr><td>1</td><td>VDD</td><td>O</td><td>Isolated +5V Output</td><td>35</td><td>VDD</td><td>O</td><td>Isolated +5V Output</td></tr><tr><td>2</td><td>EGND</td><td>-</td><td>Ext. power ground</td><td>36</td><td>EGND</td><td>-</td><td>Ext. power ground</td></tr><tr><td>3</td><td>CW+</td><td>O</td><td>Positive pulse (+)</td><td>37</td><td>CW+</td><td>O</td><td>Positive pulse (+)</td></tr><tr><td>4</td><td>CW-</td><td>O</td><td>Positive pulse (-)</td><td>38</td><td>CW-</td><td>O</td><td>Positive pulse (-)</td></tr><tr><td>5</td><td>CCW+</td><td>O</td><td>Negative pulse (+)</td><td>39</td><td>CCW+</td><td>O</td><td>Negative pulse (+)</td></tr><tr><td>6</td><td>CCW-</td><td>O</td><td>Negative pulse (-)</td><td>40</td><td>CCW-</td><td>O</td><td>Negative pulse (-)</td></tr><tr><td>7</td><td>PEL0</td><td>I</td><td>Positive end limit signal</td><td>41</td><td>PEL2</td><td>I</td><td>Positive end limit signal</td></tr><tr><td>8</td><td>MEL0</td><td>I</td><td>Negative end limit signal</td><td>42</td><td>MEL2</td><td>I</td><td>Negative end limit signal</td></tr><tr><td>9</td><td>PSD0</td><td>I</td><td>Positive slow down signal</td><td>43</td><td>PSD2</td><td>I</td><td>Positive slow down signal</td></tr><tr><td>10</td><td>MSD0</td><td>I</td><td>Negative slow down signal</td><td>44</td><td>MSD2</td><td>I</td><td>Negative slow down signal</td></tr><tr><td>11</td><td>ORG0</td><td>I</td><td>Origin signal</td><td>45</td><td>ORG2</td><td>I</td><td>Origin signal</td></tr><tr><td>12</td><td>EGND</td><td>-</td><td>Ext. power ground</td><td>46</td><td>EGND</td><td>-</td><td>Ext. power ground</td></tr><tr><td>13</td><td>CW+</td><td>O</td><td>Positive pulse (+)</td><td>47</td><td>CW+</td><td>O</td><td>Positive pulse (+)</td></tr><tr><td>14</td><td>CW-</td><td>O</td><td>Positive pulse (-)</td><td>48</td><td>CW-</td><td>O</td><td>Positive pulse (-)</td></tr><tr><td>15</td><td>CCW+</td><td>O</td><td>Negative pulse (+)</td><td>49</td><td>CCW+</td><td>O</td><td>Negative pulse (+)</td></tr><tr><td>16</td><td>CCW-</td><td>O</td><td>Negative pulse (-)</td><td>50</td><td>CCW-</td><td>O</td><td>Negative pulse (-)</td></tr><tr><td>17</td><td>PEL1</td><td>I</td><td>Positive end limit signal</td><td>51</td><td>PEL3</td><td>I</td><td>Positive end limit signal</td></tr><tr><td>18</td><td>MEL1</td><td>I</td><td>Negative end limit signal</td><td>52</td><td>MEL3</td><td>I</td><td>Negative end limit signal</td></tr><tr><td>19</td><td>PSD1</td><td>I</td><td>Positive slow down signal</td><td>53</td><td>PSD3</td><td>I</td><td>Positive slow down signal</td></tr><tr><td>20</td><td>MSD1</td><td>I</td><td>Negative slow down signal</td><td>54</td><td>MSD3</td><td>I</td><td>Negative slow down signal</td></tr><tr><td>21</td><td>ORG1</td><td>I</td><td>Origin signal</td><td>55</td><td>ORG3</td><td>I</td><td>Origin signal</td></tr><tr><td>22</td><td>STP/EMG</td><td>I</td><td>Forced stop signal</td><td>56</td><td>STA</td><td>I</td><td>External start signal</td></tr><tr><td>23</td><td>DIN0</td><td>I</td><td>Digital Input 0</td><td>57</td><td>DOUT0</td><td>O</td><td>Digital Output 0</td></tr><tr><td>24</td><td>DIN1</td><td>I</td><td>Digital Input 1</td><td>58</td><td>DOUT1</td><td>O</td><td>Digital Output 1</td></tr><tr><td>25</td><td>DIN2</td><td>I</td><td>Digital Input 2</td><td>59</td><td>DOUT2</td><td>O</td><td>Digital Output 2</td></tr><tr><td>26</td><td>DIN3</td><td>I</td><td>Digital Input 3</td><td>60</td><td>DOUT3</td><td>O</td><td>Digital Output 3</td></tr><tr><td>27</td><td>DIN4</td><td>I</td><td>Digital Input 4</td><td>61</td><td>DOUT4</td><td>O</td><td>Digital Output 4</td></tr><tr><td>28</td><td>DIN5</td><td>I</td><td>Digital Input 5</td><td>62</td><td>DOUT5</td><td>O</td><td>Digital Output 5</td></tr><tr><td>29</td><td>DIN6</td><td>I</td><td>Digital Input 6</td><td>63</td><td>DOUT6</td><td>O</td><td>Digital Output 6</td></tr><tr><td>30</td><td>DIN7</td><td>I</td><td>Digital Input 7</td><td>64</td><td>DOUT7</td><td>O</td><td>Digital Output 7</td></tr><tr><td>31</td><td>VDD</td><td>-</td><td>Isolated +5V Output</td><td>65</td><td>DO_COM</td><td>-</td><td>Common for DO</td></tr><tr><td>32</td><td>VDD</td><td>-</td><td>Isolated +5V Output</td><td>66</td><td>DO_COM</td><td>-</td><td>Common for DO</td></tr><tr><td>33</td><td>EGND</td><td>-</td><td>Ext. power ground</td><td>67</td><td>EGND</td><td>-</td><td>Ext. power ground</td></tr><tr><td>34</td><td>EX+24V</td><td>I</td><td>+24V isolation power input</td><td>68</td><td>EX+24V</td><td>I</td><td>+24V isolation power input</td></tr></table>

Table 2-3: CN1 Pin Assignments

# 3 Signal Connections

Signal connections of all I/O's are described in this chapter. Refer to the contents of this chapter before wiring any cables between the PCI-8144 and any stepper drivers.

This chapter contains the following sections:

<table><tr><td>Section 3.1</td><td>Pulse Output Signals CW and CCW</td></tr><tr><td>Section 3.2</td><td>Origin Signal ORG</td></tr><tr><td>Section 3.3</td><td>Slow Down input signal</td></tr><tr><td>Section 3.4</td><td>End-Limit Signals PEL and MEL</td></tr><tr><td>Section 3.5</td><td>Simultaneous start/stop signals STA and STP</td></tr><tr><td>Section 3.6</td><td>Termination Board</td></tr><tr><td>Section 3.7</td><td>General-purposed DIO</td></tr><tr><td>Section 3.8</td><td>JP2 pin definition for stepping singal (Optional)</td></tr></table>

# 3.1 Pulse Output Signals CW and CCW

There are 4 axis pulse output signals on the PCI-8144. For each axis, two pairs of CW and CCW signals are used to transmit the pulse train and to indicate the direction. In this section, the electrical characteristics of the CW and CCW signals are detailed. Each signal consists of a pair of differential signals. For example, CW2 consists of $\mathrm{CW2 + }$ and CW2- signals. The following table shows all pulse output signals on CN1.

<table><tr><td>CN1 Pin No.</td><td>Signal Name</td><td>Description</td><td>Axis #</td></tr><tr><td>3</td><td>CW0+</td><td>Pulse signals (+)</td><td>1</td></tr><tr><td>4</td><td>CW0-</td><td>Pulse signals (-)</td><td>1</td></tr><tr><td>5</td><td>CCW0+</td><td>Direction signal (+)</td><td>1</td></tr><tr><td>6</td><td>CCW0-</td><td>Direction signal (-)</td><td>1</td></tr><tr><td>13</td><td>CW1+</td><td>Pulse signals (+)</td><td>2</td></tr><tr><td>14</td><td>CW1-</td><td>Pulse signals (-)</td><td>2</td></tr><tr><td>15</td><td>CCW1+</td><td>Direction signal (+)</td><td>2</td></tr><tr><td>16</td><td>CCW1-</td><td>Direction signal (-)</td><td>2</td></tr><tr><td>17</td><td>CW2+</td><td>Pulse signals (+)</td><td>3</td></tr><tr><td>18</td><td>CW2-</td><td>Pulse signals (-)</td><td>3</td></tr><tr><td>39</td><td>CCW2+</td><td>Direction signal (+)</td><td>3</td></tr><tr><td>40</td><td>CCW2-</td><td>Direction signal (-)</td><td>3</td></tr><tr><td>47</td><td>CW3+</td><td>Pulse signals (+)</td><td>4</td></tr><tr><td>48</td><td>CWT3-</td><td>Pulse signals (-)</td><td>4</td></tr><tr><td>49</td><td>CCW3+</td><td>Direction signal (+)</td><td>4</td></tr><tr><td>50</td><td>CCW3-</td><td>Direction signal (-)</td><td>4</td></tr></table>

The output of the CW or CCW signals can be configured by jumpers as either differential line drivers or open collector output. Users can select the output mode either by closing breaks between 1 and 2 or 2 and 3 of jumpers J1-J8 as follows:

<table><tr><td>Output Signal</td><td>For differential line driver output, close breaks between 1 and 2 of:</td><td>For open collector output, close breaks between 2 and 3 of:</td></tr><tr><td>CW0-</td><td>J1</td><td>J1</td></tr><tr><td>CCW0-</td><td>J2</td><td>J2</td></tr><tr><td>CW1-</td><td>J3</td><td>J3</td></tr><tr><td>CCW1-</td><td>J4</td><td>J4</td></tr><tr><td>CW2-</td><td>J5</td><td>J5</td></tr><tr><td>CCW2-</td><td>J6</td><td>J6</td></tr><tr><td>CW3-</td><td>J7</td><td>J7</td></tr><tr><td>CCW3-</td><td>J8</td><td>J8</td></tr></table>

The default setting of CW and CCW is set to differential line driver mode.

The following wiring diagram is for CW and CCW signals on the 4 axes.

PCI-8144:
![D5V\nR\nHP0631\nCW/CCW\nJ1~J8\n26LS31\nVDD\nCW+, CCW+\nCW-, CCW-\nEGND](.pci-8144-50-11144-1010-201/9af88508b4f3b798d4e04bf568ca03d0bc54b09406519f28806834f99d26c576.jpg)

Note: If the pulse output is set to open collector output mode, CW- and CCW- are used to transmit CW and CCW signals. The sink current must not exceed 20mA on the CW- and CCW-pins. The default setting of jumper is 1-2 shorted.

Suggest Usage: Jumper 2-3 shorted and connect CW+/CCW+ to a 470 ohm pulse input interface's COM of driver. See the following figure.

Choose one of CW/CCW+ and CW/CCW- to connect to driver's OUT/DIR

![VDD\nInside\nMotion\nController\n2631\nCW+\nCCW+\nCOM(+5V)\nR = 470 Ohm\nOUT/DIR\nInside\nMotor\nDriver\nCW-, CCW-\nEGND\nGND](.pci-8144-50-11144-1010-201/1a5fe7eee07176c8f1a4d320cf53902d1d6c6837d8229bdfd532b9833e3ceb9e.jpg)

Warning: The sink current must not exceed 20mA or the 2631 will be damaged!

# 3.2 Origin Signal ORG

The origin signals (ORG1-ORG4) are used as input signals for the origin of the mechanism. The following table lists signal names, pin numbers, and axis numbers:

<table><tr><td>CN1 Pin No</td><td>Signal Name</td><td>Axis #</td></tr><tr><td>11</td><td>ORG0</td><td>1</td></tr><tr><td>21</td><td>ORG1</td><td>2</td></tr><tr><td>45</td><td>ORG2</td><td>3</td></tr><tr><td>55</td><td>ORG3</td><td>4</td></tr></table>

The input circuit of the ORG signals is shown below. Usually, a limit switch is used to indicate the origin on one axis. The specifications of the limit switch should have contact capacity of +24V @ 10mA minimum. An internal filter circuit is used to filter out any high frequency spikes, which may cause errors in the operation.

![Inside 8144\nCN1\nD5V\nTo PCD 4541\n2.2K\nEX+24V\n0.5V max.\nPS2805-1\nDGND\nEGND\nORG\nSwitch](.pci-8144-50-11144-1010-201/01319c4d8aecee677c0194ae33b28d4b22fb831a4d40d450b93a041ac3b0e585.jpg)

When the motion controller is operated in the home return mode, the ORG signal is used to inhibit the control output signals (CW and CCW). For detailed operations of the ORG signal, refer to Section 4.

# 3.3 Slow Down input signal

The PCI-8144 provides slow down function through SD input pin. The signal names, pin numbers, and axis numbers are shown in the following table:

<table><tr><td>CN1 Pin No</td><td>Signal Name</td><td>Axis #</td><td>CN1 Pin No</td><td>Signal Name</td><td>Axis #</td></tr><tr><td>9</td><td>PSD0</td><td>1</td><td>43</td><td>PSD2</td><td>3</td></tr><tr><td>10</td><td>MSD0</td><td>1</td><td>44</td><td>MSD2</td><td>3</td></tr><tr><td>19</td><td>PSD1</td><td>2</td><td>53</td><td>PSD3</td><td>4</td></tr><tr><td>20</td><td>MSD1</td><td>2</td><td>54</td><td>MSD3</td><td>4</td></tr></table>

The SD input pin wiring diagram is as follows:

![Inside 8144\nCN1\nTo PCD 4541\nDGND\nPS2805-1\nD5V\n2.2K\nEX+24V\n0.5V max.\nEGND\nPSD / MSD\n← Switch](.pci-8144-50-11144-1010-201/69b9e997fb1578eccc3d09c02875f0db2f16b9a9e05ce2a083bbe41b3ab1d3a8.jpg)

# 3.4 End-Limit Signals PEL and MEL

There are two end-limit signals PEL and MEL for each axis. PEL indicates the end limit signal is in the plus direction and MEL indicates the end limit signal is in the minus direction. The signal names, pin numbers, and axis numbers are shown in the table below:

<table><tr><td>CN1 Pin No</td><td>Signal Name</td><td>Axis #</td><td>CN1 Pin No</td><td>Signal Name</td><td>Axis #</td></tr><tr><td>7</td><td>PEL0</td><td>1</td><td>41</td><td>PEL2</td><td>3</td></tr><tr><td>8</td><td>MEL0</td><td>1</td><td>42</td><td>MEL2</td><td>3</td></tr><tr><td>17</td><td>PEL1</td><td>2</td><td>51</td><td>PEL3</td><td>4</td></tr><tr><td>18</td><td>MEL1</td><td>2</td><td>52</td><td>MEL3</td><td>4</td></tr></table>

A circuit diagram is shown in the diagram below. The external limit switch should have a contact capacity of +24V @ 10mA minimum. EL logical can be configured by registers controlling. For more details on EL operation, refer to Section 4.

![Inside 8144\nCN1\nD5V\nTo PCD 4541\n2.2K\nEX+24V\n0.5V Max.\nPS2805-1\nDGND\nEGND\nPEL\nMEL\n← Switch](.pci-8144-50-11144-1010-201/c1d4f5c37d1d7fa0143ffc10a67661e6cbb554a8e408bf2ed220ef35ebca04fa.jpg)

# 3.5 Simultaneously Start/Stop Signals STA and STP

The PCI-8144 provides STA and STP signals, which enable simultaneous start/stop of motions on multiple axes. The STA and STP signals are on CN1, STP @ pin 22 and STA @ pin 56.

The diagram below shows the onboard circuit. The STA and STP signals of the four axes are tied together respectively.

![VCC\n4.7 K\nVCC\n10K\nInside PCI-8144\nCN1\nSTP\nSTA\nSTP\nSTA](.pci-8144-50-11144-1010-201/0c1659b0570a3d671ac8d297223d9fd7c87409b2083c627d3fdc2a63db8a25ca.jpg)

The STP and STA signals are input signals. To operate the start and stop action simultaneously, both software control and external control are needed. With software control, the signals must be generated from external event to the chip of PCD4541. Users can also use an external open collector or switch to drive the STA/STP signals for simultaneous start/stop.

If there are two or more PCI-8144 cards, tie all STA and all STP signals of all cards respectively for simultaneous start/stop control on all concerned axes. In this case, connect CN1 as below:

![**Labeled Blocks:**\n*   **PCI-8144 #3**: Contains labels 'CN1', 'STP', and 'STA'.\n*   **PCI-8144 #2**: Contains labels 'CN1', 'STP', and 'STA'.\n*   **PCI-8144 #1**: Contains labels 'CN1', 'STP', and 'STA'.\n*   **7406**: A logic gate (inverter).\n*   **STOP**: Labeled output with a pulse waveform icon.\n*   **START**: Labeled output with a pulse waveform icon.\n\n**Connections:**\n*   **Top Line**: A horizontal line connects the 'STP' section of PCI-8144 #3, PCI-8144 #2, and PCI-8144 #1. From PCI-8144 #1, the line extends to the right to the 'STOP' label.\n*   **Bottom Line**: A horizontal line connects the 'STA' section of PCI-8144 #3, PCI-8144 #2, and PCI-8144 #1. From PCI-8144 #1, the line goes down and connects to the input of the '7406' inverter.\n*   **Inverter Output**: The output of the '7406' inverter connects to the 'START' label.](.pci-8144-50-11144-1010-201/426683b26aa874365bebd99c9dbaa50b73821e1d8e72c537d28aeb676bcbfece.jpg)

# 3.6 Termination Board

CN1 of the PCI-8144 can be connected with a DIN-68S, including the ACL-10569-1 cable (a 68-pin SCSI-SCSI cable). The DIN-68S is a general purpose 68-pin SCSI-II DIN-socket. It has easy wiring screw terminals and an easily installed DIN socket that can be mounted onto the DIN rails

# 3.7 General Purpose DIO

PCI-8144 has 8 opto-isolated digital outputs and 8 open collector digital inputs for general purpose use. Pin assignments are illustrated in the table below:

<table><tr><td>CN1 Pin No</td><td>Signal Name</td><td>CN1 Pin No</td><td>Signal Name</td></tr><tr><td>23</td><td>DIN0</td><td>57</td><td>DOUT0</td></tr><tr><td>24</td><td>DIN1</td><td>58</td><td>DOUT1</td></tr><tr><td>25</td><td>DIN2</td><td>59</td><td>DOUT2</td></tr><tr><td>26</td><td>DIN3</td><td>60</td><td>DOUT3</td></tr><tr><td>27</td><td>DIN4</td><td>61</td><td>DOUT4</td></tr><tr><td>28</td><td>DIN5</td><td>62</td><td>DOUT5</td></tr><tr><td>29</td><td>DIN6</td><td>63</td><td>DOUT6</td></tr><tr><td>30</td><td>DIN7</td><td>64</td><td>DOUT7</td></tr><tr><td></td><td></td><td>65</td><td>DO_COM</td></tr><tr><td></td><td></td><td>66</td><td>DO_COM</td></tr></table>

# 3.7.1 Isolated Input channels

![VDD\n330 Ω\nPLD\nPHOTO PS2805-1-F3-A\nDIN\n2\nDGND](.pci-8144-50-11144-1010-201/520514c75c8689032fa2315e4422c363ef1f7bcdaeab39e2d181c6501730b160.jpg)

# 3.7.2 Isolated Output channels

![D3V\n220 Ω\nPLD\n2\nDOUT\nPHOTO PS2802-1-F3-A\nDO_COM](.pci-8144-50-11144-1010-201/198bf238cf3a596338eea33050666fc0b7c61f0154ddf472804a567d29474414.jpg)

# 3.7.3 Example of input connection

![VDD\n330Ω\nPLD\nPHOTO PS2805-1-F3-A\nDGND\nDIN\nDIN\n2](.pci-8144-50-11144-1010-201/d2cd3eafd416ad646ba96dc65fb3e450e71894885bca539fa9b4bacb80503526.jpg)

3.7.4 Example of output connection
![MPC-7632/64\nOutput Section\n1\n2\nPS2802\n4\n3\nDO0\nDOCOM0\nDC +5V\n2.7K~3.3K\n1\n2\nMPC-7632/64\nOutput Section\n1\n2\nPS2802\n4\n3\nDO0\nDOCOM0\n+V\nR\n1\n2\n4\n3\nMPC-7632/64\nOutput Section\n1\n2\nPS2802\n4\n3\nDO0\nDOCOM0\nINDUCTOR\n1\n2\nPS2802\n4\n3\nDO0\nDOCOM0\nV](.pci-8144-50-11144-1010-201/73a3f30a004a6e277280e1123799f4031ad92c21926da1ed8160de60179a85c5.jpg)

3.8 JP2 pin define for stepping singal (Optional)

PCI-8144 provides another optional JP2 pins for stepping motor signal. Pin definitions of JP2 and connection example are described as follow:

<table><tr><td>JP2 Pin No</td><td>Signal Name</td><td>JP2 Pin No</td><td>Signal Name</td></tr><tr><td>1</td><td> $\Phi 1x$ </td><td>2</td><td> $\Phi 2x$ </td></tr><tr><td>3</td><td> $\Phi 3x$ </td><td>4</td><td> $\Phi 4x$ </td></tr><tr><td>5</td><td> $\Phi 1y$ </td><td>6</td><td> $\Phi 2y$ </td></tr><tr><td>7</td><td> $\Phi 3y$ </td><td>8</td><td> $\Phi 4y$ </td></tr><tr><td>9</td><td> $\Phi 1z$ </td><td>10</td><td> $\Phi 2z$ </td></tr><tr><td>11</td><td> $\Phi 3z$ </td><td>12</td><td> $\Phi 4z$ </td></tr><tr><td>13</td><td> $\Phi 1u$ </td><td>14</td><td> $\Phi 2u$ </td></tr><tr><td>15</td><td> $\Phi 3u$ </td><td>16</td><td> $\Phi 4u$ </td></tr></table>

Pins 17 to 26 are not used

Connection example:

![φ1\nφ2\nφ3\nφ4\nINA VSA\nINB VSB\nINA\nINB\n+5 V\n47\nk-ohm\nGND\n470 pF\nGND\n+5 V\n820\nohm\n2.4 k-ohm\n100\nohm\n(Max. 1 A)\nGND\n2200 pF\nINA\nINB\nNP-\n7024M\nTdA\nTdB OUTA\nOUTA\nGA OUTB\nGB OUTB\nREFA\nREFB\nRSA RSB\nGND\n2W 0.5 ohm\nVM\n100 V\n220 μF\nGND\nPM\n(Unipolar)\n(Unipolar constant current drive)](.pci-8144-50-11144-1010-201/fd9f36c23131fa43e41015579c8d5865b2e4f45246420468ef521d43be5aaba4.jpg)

# 4 Operation Theory

This chapter describes the detail operation of the motion controller card. Contents of the following sections are as follows:

Section 4.1: Classifications of Motion Controller

Section 4.2: Motion Control Modes

Section 4.3: Motor Driver Interface

Section 4.4: Mechanical switch Interface

Section 4.5: The Counters

Section 4.6: The Comparators

Section 4.7: Other Motion Functions

Section 4.8: Interrupt Control

Section 4.9: Multiple Cards Operation

# 4.1 Classifications of Motion Controller

When motor/stepper control first started, motion control was widely discussed instead of motor control. Motor control was separated into two layers: motor control and motion control. Motor control relates to PWM, power stage, closed loop, hall sensors, vector space, etc. Motion control relates to speed profile generating, trajectory following, multi-axes synchronization, and coordinating.

# 4.1.1 Voltage motion control interface

The interfaces between motion and motor control are changing rapidly. Early on, a voltage singal was used as a command to the motor controller. The amplitude of the signal means how fast a motor is rotating and the time duration of the voltage changes means how fast a motor acceleration from one speed to the other speed. Voltage signal as a command to motor driver is so called “analog” motion controller. It is much eaiser to integrate into an analog circuit of motor controller; however noise is sometimes a big problem for this type of motion control. Also, to do positioning control of a motor, the analog motion controller must have a feedback signal with position information and use a closed loop control algorithm to make it possible. This increased the complexity of motion control and not easy to use for a beginner.

# 4.1.2 Pulse motion control interface

The second interface of motion and motor control is a pulse train type. As a trend of digital world, pulse trains represent a new concept to motion control. The counts of pulses show how many steps of a motor rotates and the frequency of pulses show how fast a motor runs. The time duration of frequency changes represent the acceleration rate of a motor. Because of this interface, a servo or stepper motor can be easier than an analog type for positioning applications. It means that motion and motor control can be separated more easily by this way.

Both of these two interfaces need to provide for gains tuning. For analog position controllers, the control loops are built inside and users must tune the gain from the controller. For pulse type position controllers, the control loops are built outside on the motor drivers and users must tune the gains on drivers.

For more than one axes' operation, motion control seems more important than motor control. In industrial applications, reliable is a very important factor. Motor driver vendors make good performance products and a motion controller vendors make powerful and variety motion software. Integrated two products make our machine go into perfect.

# 4.1.3 Network motion control interface

Recently, there was a new control interface was introduced--a network motion controller. The command between motor driver and motion controller is not analog or pulses signal any more. It is a network packet which contents position information and motor information. This type of controller is more reliable because it is digitized and packetized. Because a motion controller must be real-time, the nerowrk must have real-time capacity around a cycle time below 1 mini-second. This means that non-commercial networks cannot do this job. It must have a specific network, such as Mitsubishi SSCNET. The network may also be built with fiberoptics to increase communication reliability.

# 4.1.4 Software real-time motion control kernel

For motion control kernel, there are three ways to accomplish it: DSP, ASIC, and software real-time.

A motion control system needs an absolutely real-time control cycle and the calculation on controller must provide a control data at the same cycle. If not, the motor will not run smoothly. Many machine makers will use PC's computing power to do this. A feedback counter card can simply be used and a voltage output or pulse output card to make it. This method is very low-end and takes much software effort. For sure their realtime performance, they will use a real-time software on the system. It increases the complexity of the system too. But this method is the most flexible way for a professional motion control designers. Most of these methods are on NC machines.

# 4.1.5 DSP motion control kernel

A DSP-based motion controller kernel solves real-time software problem on computer. DSP is a micro-processor itself and all motion control calculations can be done on it. There is no real-time software problem because DSP has its own OS to arrange all the procedures. There is no interruption from other inputs or context switching problem like Windows based computer. Although it has such a perfect performance on real-time requirements, its calculation speed is not as fast as PC's CPU at this age. The software interfacing between DSP controller's vendors and users is not easy to use. Some controller vendors provide some kind of assembly languages for users to learn and some controller vendors provide only a handshake documents for users to use. Both ways are not easy to use. DSP based controller provide a better way than software kernel for machine makers to build they applications.

# 4.1.6 ASIC motion control kernel

An ASIC motion control kernel is falls between software kernel and DSP kernel in terms of difficulty. It has no real-time problem because all motion functions are done via the ASIC. Users or controller's vendors just need to set some parameters which the ASIC requires and the motion control will be done easily. This kind of motion control separates all system integration problems into 4 parts: Motor driver's performance, ASIC outputting profile, vendor's software parameters to the ASIC, and users' command to vendors' software. It makes motion controller co-operated more smoothly between devices.

# 4.1.7 Compare Table of all motion control types

<table><tr><td></td><td>Software</td><td>ASIC</td><td>DSP</td></tr><tr><td>Price</td><td>Fair</td><td>Cheap</td><td>Expensive</td></tr><tr><td>Functionality</td><td>Highest</td><td>Low</td><td>Normal</td></tr><tr><td>Maintenance</td><td>Hard</td><td>Easy</td><td>Fair</td></tr></table>

<table><tr><td></td><td>Analog</td><td>Pulses</td><td>Network</td></tr><tr><td>Price</td><td>High</td><td>Low</td><td>Normal</td></tr><tr><td>Signal Quality</td><td>Fair</td><td>Good</td><td>Reliable</td></tr><tr><td>Maintenance</td><td>Hard</td><td>Easy</td><td>Easy</td></tr></table>

# 4.1.8 PCI-8144 motion controller type

The PCI-8144 is an ASIC based, pulse type motion controller made into three blocks: motion ASIC, PCI card, software motion library. The motion ASIC can be accessed via our software motion libray under many kinds of Windows NT/2000/XP, Linux, and RTX driver. Our software motion library provides one-stop-function for controlling motors. All the speed parameter calculations are done via our library.

For example, to perform a one-axis point to point motion with a trapezoidal speed profile, only fill the target position, speed, and acceleration time in one function. Then the motor will run as the profile. It takes no CPU resources because every control cycle pulse generation is done by the ASIC. The precision of target position depends on motor drivers' closed loop control performance and mechanical parts, not on motion controller's command because the motion controller is only responsible for sending correct pulses counts via a desired speed profile. So it is much easier for programmers, mechanical or electrical engineers to find out problems.

# 4.2 Motion Control Modes

Motion control makes the motors run according to a specific speed profile, path trajectory and synchronous condition with other axes. The following sections describe the motion control modes of this motion controller could be performed.

# 4.2.1 Coordinate system

The Cartesian coordinate is used and pulses are in the unit of length. The physical length depends on mechanical parts and motor's resolution. For example, if a motor is on a screw ball, and the pitch of screw ball is 10mm and the pulses needed for a round of motor are 10,000 pulses. One pulse's physical unit is equal to 10mm/10,000p = 1 mm.

Just set a command with 15,000 pulses for motion controller if we want to move 15mm. How about if we want to move 15.0001mm?

Simple! The motion controller will keep the residue value less than 1 pulse and add it to next command.

![Simple 2D coordinate system with X and Y axes, no data points or labels](.pci-8144-50-11144-1010-201/a77b636d53616413b23d90a63bc0d8265366b1e420be2eca136afd1eb0ed117d.jpg)

The motion controller sends incremental pulses to motor drivers. It means that we can only send relative command to motor driver. But we can solve this problem by calculating the difference between current position and target position first. Then send the differences to motor driver. For example, if current position is 1000 and we want to move a motor to 9000, you can use an absolute command to set a target position of 9000. Inside the motion controller, it will get current position 1000 first then calculate the difference from target position. The result is +8000. So, the motion controller will send 8000 pulses to motor driver to move the position of 9000.

Sometimes, users need to install a linear scale or external encoder to check machine's position. But how do you to build this coordinate system? If the resolution of external encoder is 10,000 pulses per 1mm and the motor will move 1mm if the motion controller send 1,000 pulses, It means that when we want to move 1 mm, we need to send 1,000 pulses to motor driver then we will get the encoder feedback value of 10,000 pulses. If we want to use an absolute command to move a motor to 10,000 pulses position and current position read from encoder is 3500 pulses, how many pulses will it send to motor driver? The answer is (10000 - 3500) / (10,000 / 1,000)=650 pulses. The motion controller will calculate it automatically if users set “move ratio” already. The “move ratio” means the (feedback resolution/command resolution)

Note: The PCI-8144 provides only one dimension motion function.

![The diagram illustrates a mechanical control system with the following components and connections:\n\n**Labeled Blocks and Elements:**\n*   **Controller:** A rectangular box labeled with 'Pulses Cmd' above it.\n*   **Driver:** A rectangular box to the right of the controller.\n*   **Motor:** A rectangular box to the right of the driver.\n*   **Screw ball & guider:** A long, hatched rod extending to the right from the motor.\n*   **Encoder:** A lower rod/strip running parallel to the screw, pointed to by an arrow.\n*   **Moving:** A label above a coupling nut on the screw, accompanied by a double-headed horizontal arrow.\n\n**Connections:**\n*   An arrow points from the **Controller** to the **Driver**.\n*   An arrow points from the **Driver** to the **Motor**.\n*   The **Motor** is mechanically connected to the **Screw ball & guider**.\n*   A feedback loop originates from the **Encoder** area (bottom rod) and points back to the **Controller**. This path is labeled **Pulses F/B**.](.pci-8144-50-11144-1010-201/618b86f784740d8a19f87787312cc0520db2cf2393c3097ad99e659b818d6296.jpg)

# 4.2.2 Absolute and relative position move

In the coordinate system, we have two kinds command for users to locate the target position. One is absolute and the other is relative. Absolute command means that user give the motion controller a position, then the motion controller will move a motor to that position from current position. Relative command means that user give the motion controller a distance, then the motion controller will move motor by the distance from current position. During the movement, users can specify the speed profile. It means user can define how fast and at what speed to reach the position.

The PCI-8144 provides only relative position move because it is designed for stepper motor. It is meaningless for a stepper motor controller to have the encoder feedback interface for absolute motion.

# 4.2.3 Trapezoidal speed profile

Trapezoidal speed profile means the acceleration/deceleration area follows a 1st order linear velocity profile (constant acceleration rate). The profile chart is shown as below:

![| Time (seconds) | Velocity (pps) |\n| -------------- | -------------- |\n| Tacc           | 0              |\n| Tdec           | 0              |\n| MaxVel         | 100            |\n| StrVel         | 0              |](.pci-8144-50-11144-1010-201/1d0de3e524f907ba8920b9d6ee5db9fe0a95359e5ad110e9437b3b0190f76f2b.jpg)

The area of the velocity profile represents the distance of this motion. Sometimes, the profile looks like a triangle because the desired distance from user is smaller than the area of given speed parameters. When this situation happens, the motion controller will lower the maximum velocity but keep the acceleration rate to meet user's distane requirement. The chart of this situation is shown as below:

![| Time (seconds) | Velocity (pps) |\n| -------------- | -------------- |\n| Tacc           | StrVel         |\n| Tdec           | MaxVel         |\n| Tdec           | StrVel         |](.pci-8144-50-11144-1010-201/56bacde3a93e7ede1914b7c69c07aa8ff26fca6a0241484fea3dcb195266f16f.jpg)

This kind of speed profile could be applied on velocity mode, position mode in one axis or multi-axes linear interpolation and two axes circular interpolation modes.

The PCI-8144 Tacc and Tdec are always the same.

# 4.2.4 S-curve and Bell-curve speed profile

S-curve means the speed profile in accelerate/decelerate area follows a 2nd order curve. It can reduce vibration at the beginning of motor start and stop. In order to speed up the acceleration/deceleration during motion, we need to insert a linear part into these areas. We call this shape as “Bell” curve. It adds a linear curve between the upper side of s-curve and lower side of s-curve. This shape improves the speed of acceleration and also reduces the vibration of acceleration.

a) For a purse S-curve, we define its shape's parameter as below:

![| Time (Second) | Velocity (PPS) |\n| ------------- | -------------- |\n| Tacc          | Low            |\n| Tdec          | High           |](.pci-8144-50-11144-1010-201/092e7fc35e20c49cdab35a25294c53b78e54a90e7b2ac27dfe9a1ca179facf98.jpg)

▶ Tacc: Acceleration time in second
▶ Tdec: Deceleration time in second
▶ StrVel: Starting velocity in PPS
▶ MaxVel: Maximum velocity in PPS

The PCI-8144 Tacc and Tdec are always the same.

b) For a bell curve, we define its shape parameters as below: (the PCI-8144 doesn't support this mode)

![| Time (Second) | Velocity (PPS) |\n| ------------- | -------------- |\n| Tacc          | MaxVel         |\n| Tdec          | MaxVel         |\n| MaxDel        | VSacc          |\n| MaxDel        | VSdec          |\n| MaxDel        | VSdec          |](.pci-8144-50-11144-1010-201/f85eb3e55321cf8bdf2e2cd3158dde13677be253bc11840a949c7622529d3fab.jpg)

▶ Tacc: Acceleration time in second
▶ Tdec: Deceleration time in second
▶ StrVel: Starting velocity in PPS
▶ MaxVel: Maximum velocity in PPS
▶ VSacc: S-curve part of a bell curve in deceleration in PPS
▶ VSdec: S-curve part of a bell curve in deceleration in PPS

If VSacc or VSdec=0, it means acceleration or deceleration use pure S-curve without linear part. The Acceleration chart of bell curve is shown below:

![| Time (Second) | Acc. (PPS/S) |\n| ------------- | ------------ |\n| 0             | 0            |\n| Tacc          | 0            |\n| Tdec          | 0            |\n| End           | 0            |](.pci-8144-50-11144-1010-201/e3bbe1c6a935b439f40f9c34b713613815a715b3d1df2f1c71001e7af75e5c23.jpg)

# 4.2.5 Velocity mode

Velocity mode means the pulse command is continuously output-ing until a stop command is issued. The motor will run without a target position or desired distance unless it is stopped by other reasons. The output pulse accelerates from a starting velocity to a specified maximum velocity. It can be follow a linear or S-curve acceleration shape. The pulse output rate is kept at maximum velocity until another velocity command is set or a stop command is issued. The velocity could be overridden by a new speed setting. Notice that the new speed could not be a reversed speed of original running speed. The speed profile of this kind of motion is shown as below:

![| Time (Second) | Velocity (PPS) |\n| ------------- | -------------- |\n| Start         | 0              |\n| Speed Override | High           |\n| Stop Function | Low            |](.pci-8144-50-11144-1010-201/1533609e97fa85bdee5b313c820689bb669ec5035120b9e5d1dfa012d320bd1b.jpg)

# 4.2.6 One axis position mode

Position mode means the motion controller will output a specific amount of pulses which is equal to users' desired position or distance. The unit of distance or position is pulse internally on the motion controller. The minimum length of distance is one pulse. However, in PCI-8144, we provide a floating point function for users to transform a physical length to pulses. Inside our software library, we will keep those distance less than one pulse in register and apply them to the next motion function. Besides positioning via pulse counts, our motion controller provides three types of speed profile to accomplish positioning. There are 1st order trapezoidal, 2nd order S-curve, and mixed bell curve. Users can call respective functions to perform that. The following char shows the relationship between distance and speed profile. We use trapezoidal shape to show it.

![| Time (second) | Velocity (fps) |\n| ------------- | -------------- |\n| 0             | MaxVel         |\n| 1             | StrVel         |\n| 2             | StrVel         |\n| Tacc          | -              |\n| Tdec          | -              |](.pci-8144-50-11144-1010-201/ff436861f3c66eeb395184281b302f481b05a8ebc753ee415d99cc80be293645.jpg)

The distance is the area of the V-t diagram of this profile.

The PCI-8144 Tacc and Tdec are always the same.

# 4.2.7 Home Return Mode

Home return means searching a zero position point on the coordinate. Sometimes, users use ORG pin as a zero position on the coordinate. At the beginning of machine power on, the program needs to find a zero point of this machine. Our motion controller provides following functions to make it.

```txt
_8144_enable_sd_signal
_8144_enable_org_stop,
_8144_tv_move,
_8144_sv_move.
```

When ORG signal control is enabled (home return operation), the ORG signal is turned ON and the motor will stop immediately. After that, if the ORG signal goes OFF, the motor will remain stopped. Those signal statues can be used by the function, “\_8144\_get\_mio\_status”.

▶ When SD is not installed
![| Event | Value |\n|-------|-------|\n| ORG   | High  |\n| EL    | High  |\n| Case 1| Low   |\n| Case 2| Low   |](.pci-8144-50-11144-1010-201/32fc7e007f447789b3e7b9b8c7f0da28817a8a45b7a53a93b7396bd5620eb25e.jpg)

▶ When SD is installed and SD is not latched

![The diagram displays a series of horizontal tracks labeled on the left as **ORG**, **SD**, **EL**, **Case 1**, **Case 2**, **Case 3**, and **Case 4**.\n\nThere are three rectangular blocks containing text:\n*   **R&E** (top position)\n*   **R&E** (middle position)\n*   **stop** (bottom position)\n\nThe connections (arrows) are as follows:\n*   An arrow points from the top **R&E** block to the **Case 1** line.\n*   Two arrows originate from the middle **R&E** block: one points to the **Case 2** line and the other points to the **Case 3** line (specifically to a black dot).\n*   Two arrows originate from the **stop** block: one points to the **Case 2** line and the other points to the **Case 3** line (specifically to the same black dot).](.pci-8144-50-11144-1010-201/f19fad2054ba02a2e701a204580a45dce8a4227709e04ff254b518a8e082e89c.jpg)

# Example.

```c
_8144_enable_sd_signal(AxisNo, Enable); //Enable SD signal control
_8144_enable_org_stop(AxisNo, Enable); //Enable ORG signal stop
_8144_sv_move(AxisNo, StrVel, MaxVel, Tacc); // perform a sv-move
```

# 4.2.8 Synchronous Start Function

Synchronous motion means more than one axis can be started by a synchronous signal (STA) which could be external or internal signals. For external signal, users must set move parameters first for all axes then these axes will wait an extern start/stop command to start or stop. For internal signal, the start command could be from a software start function. Once it is issued, all axes which are in waiting synchronous mode will start at the same time.

![The diagram illustrates a control signal branching to two axes and their corresponding motion profiles.\n\n**Labeled Blocks and Text:**\n*   **Start/Stop Signal** (Text label on the far left)\n*   **Axis0** (Rectangular block)\n*   **Axis1** (Rectangular block)\n\n**Connections:**\n*   A line originates from the **Start/Stop Signal** and splits into two branches.\n*   The upper branch has an arrow pointing to the **Axis0** block.\n*   The lower branch has an arrow pointing to the **Axis1** block.\n\n**Additional Elements:**\n*   To the right of the blocks, separated by a vertical dashed line, are two graphs.\n*   The top graph shows a larger trapezoidal profile with a right-pointing arrow above it, aligned with **Axis0**.\n*   The bottom graph shows a smaller trapezoidal profile with a right-pointing arrow above it, aligned with **Axis1**.](.pci-8144-50-11144-1010-201/3485539dd44341059b3f6ee960a733dd13bd584d7939a7724996a66d5b54d1eb.jpg)

The PCI-8144 card suports external start function. When the user sets the external start by \_8144\_external\_start function for each axis which the user want to perform external start, then set the move function for those axes. Thoes axis will start at the same time when STA signal goes ON.

# 4.2.9 Auto Home Move Mode

Depending on the software homing mode design, the PCI-8144 offers an auto homing move function which means the axis will move to a zero position point on the coordinate. This mode is used to add an auto home moving function on the normal home return mode described in the previous section no matter which position the axis is. The following diagram shows an example for normal home mode usage for which the start point is between the ORG and EL signal or exists in the ORG signal. The ORG offset can't be zero because the motion ASIC of the PCI-8144 offers a level trigger for the ORG signal. The suggested value is the double length of the ORG area. A homing status function can be used to monitor the current status of the homing operation.

Case 1: SD (Slow down) > Stop at ORG

Case 2: EL (End Limit) > SD (Slow down) > Stop at ORG

Case 3: Inversed direction moving > EL (End Limit) > Return > SD (Slow down) > Stop at ORG

Case 4: Stop at ORG

Case 5: SD (Slow down) > Stop at ORG

Case 6: EL (End Limit) > SD (Slow down) > Stop at ORG

Case 7: Inversed direction moving > EL (End Limit) > Return > SD (Slow down) > Stop at ORG

![| Case   | SD signal | ORG signal | EL signal |\n|--------|-----------|------------|-----------|\n| Case 1 | Yes       | No         | Yes       |\n| Case 2 | Yes       | No         | Yes       |\n| Case 3 | Yes       | No         | Yes       |\n| Case 4 | Yes       | Yes        | Yes       |\n| Case 5 | Yes       | Yes        | Yes       |\n| Case 6 | Yes       | Yes        | Yes       |\n| Case 7 | Yes       | Yes        | Yes       |](.pci-8144-50-11144-1010-201/360cd0529e31850da7a2f683112d43200b037ae3a375aad140d9c6dbb93c9c55.jpg)

# 4.3 The motor driver interface

We provide several dedicated I/Os which can be connected to motor driver directly and have their own functions. Motor drivers have many kinds of I/O pins for external motion controller to use. We classify them to two groups. One is pulse I/O signals including pulse command and encoder interface. The other is digital I/O signals including servo ON, alarm, INP, servo ready, alarm reset and emergency stop inputs. The following sections will describe the functions these I/O pins.

The PCI-8144 has only pulse command interface.

# 4.3.1 Pulse Command Output Interface

The motion controller uses pulse command to control servo/stepper motors via motor drivers. Please set the drivers to position mode which can accept pulse trains as position command. The pulse command consists of two signal pairs. It is defined as CW and CCW pins on connector. Each signal has two pins as a pair for differential output.

# Dual Pulse Output Mode (CW/CCW Mode)

The waveform of the CW and CCW pins represent CW (clockwise) and CCW (counter clockwise) pulse output respectively. The numbers of pulse represent distance in pulse. The frequency of the pulses represents speed in pulse per second. Pulses output from the CW pin makes the motor move in positive direction, whereas pulse output from the CCW pin makes the motor move in negative direction. The following diagram shows the output waveform of positive (+) commands and negative (-) commands.

Pulse outmode = 0: (Pulse is normally high)
![OUT\nDIR\n(+)          (-)\nCW\nCCW](.pci-8144-50-11144-1010-201/6f22bf751092c3f8535cdc8f6b93a20e45a0047f1eb473009f8b9cbf71cc777f.jpg)

Pulse outmode = 1: (Pulse is normally low)

![OUT\n(+)\n(-)\nCW\nDIR\nCCW](.pci-8144-50-11144-1010-201/a5fbea9cd09d8598e20eb9a0cd1d88fba6f776d371b72f9d168361b00ab6c4ec.jpg)

The command pulses are counted by a 24-bit preset countdown counter. The preset counter can store a value of total pulses outputting from controller.

# 4.4 Mechanical switch interface

We provide some dedicated input pins for mechanical switches like original switch (ORG), plus and minus end-limit switch ( $\pm$ EL), slow down switch (SD). These switches' response time is very fast, only a few ASIC clock times. There is no real-time problem when using these signals. All functions are done by motion ASIC. The software can just do nothing and only need to wait the results.

# 4.4.1 Original or home signal

Our controller provides one original or home signal for each axis. This signal is used for defining zero position of this axis. The logic of this signal must be set properly before doing home procedure. Please refer to home mode section for details.

# 4.4.2 End-Limit switch signal

The end-limit switches are usually installed on both ending sides of one axis. We must install plus EL at the positive position of the axis and minus EL at the negative position of the axis. These two signals are for safety reason. If they are installed reversely, the protection will be invalid. Once the motor's moving part touches one of the end-limit signals, the motion controller will stop sending pulses and output an ERC signal. It can prevent machine crash when miss operation.

# 4.4.3 Slow down switch

The slow down signals are used to force the command pulse to decelerate to the starting velocity when it is active. This signal is used to protect a mechanical moving part under high speed movement toward the mechanism's limit. The SD signal is effective for both plus and minus directions.

# 4.5 The Counters

# 4.5.1 Preset Command position counter

The preset command position counter is a 24-bit binary down-count counter. It provides the information of the current command counts which are not outputted.

# 4.6 Interrupt Control

The motion controller can generate an interrupt signal to the host PC. It is much useful for event-driven software application. There are two kinds of interrupt sources on PCI-8144. One is motion interrupt source and the other is GPIO interrupt sources. Motion and GPIO interrupt sources can be maskable. Motion interrupt sources can be maskable by

\_8144\_set\_motion\_interrupt\_factor(). Its mask bits are shown as following table:

Motion Interrupt Source Bit Settings (1=Enable,0=Disable)

<table><tr><td>Bit</td><td>Description</td></tr><tr><td>0</td><td>Motion Stop</td></tr><tr><td>1-15</td><td>(reserve)</td></tr></table>

The GPIO interrupt sources are maskable. The mask bits table is shown below:

GPIO Interrupt Source Bit Settings (1=Enable,0=Disable)

<table><tr><td>Bit</td><td>Description</td></tr><tr><td>0</td><td>DI0 falling edge</td></tr><tr><td>1</td><td>DI1 falling edge</td></tr><tr><td>2</td><td>DI2 falling edge</td></tr><tr><td>3</td><td>DI3 falling edge</td></tr><tr><td>4</td><td>DI4 falling edge</td></tr><tr><td>5</td><td>DI5 falling edge</td></tr><tr><td>6</td><td>DI6 falling edge</td></tr><tr><td>7</td><td>DI7 falling edge</td></tr><tr><td>8</td><td>DI0 rising edge</td></tr><tr><td>9</td><td>DI1 rising edge</td></tr><tr><td>10</td><td>DI2 rising edge</td></tr><tr><td>11</td><td>DI3 rising edge</td></tr><tr><td>12</td><td>DI4 rising edge</td></tr><tr><td>13</td><td>DI5 rising edge</td></tr><tr><td>14</td><td>DI6 rising edge</td></tr><tr><td>15</td><td>DI7 rising edge</td></tr></table>

After setting the factors of interrupt, users can use wait functions to wait the interrupts, it uses no processor time while waiting for the specified interrupt to become signaled or the time-out interval to elapse.

# The steps for using interrupts:

1. Set interrupt sources for Motion or GPIO interrupts.

```c
_8144_set_motion_interrupt_factor(AXISO, 0x01); // Axis0 stop
_8144_set_gpio_interrupt_factor(CARD0, 0x01); // DI0 falling edge
```

2. Using wait function to wait the specified interrupt

```c
_8144_wait_single_motion_interrupt(AXISO, 0x01, 1000);
// Wait 1000ms for normally stop interrupt
_8144_wait_single_gpio_interrupt(CARD0, 0x01, 1000)
// Wait 1000ms for DI0 falling edge interrupt
```

3. Disable interrupt sources

```c
_8144_set_motion_interrupt_facor(AXISO, 0x0);
_8144_set_gpio_interrupt_factor(CARD0, 0x0);
```

# 4.7 Multiple Card Operation

The motion controller allows more than one card in one system. Since the motion controller is plug-and-play compatible, the base address and IRQ setting of the card are automatically assigned by the PCI BIOS at the beginning of system booting. Users don't need and can't change the resource settings.

When multiple cards are applied to a system, the number of card must be noted. The card number depends on the card ID switch setting on the board. The axis number is depends on the card ID. For example, if three motion controller cards are plugged in to PCI slots, and the corresponding card ID is set, then the axis number on each card will be:

<table><tr><td></td><td>Axis No.</td><td>X</td><td>Y</td><td>Z</td><td>U</td></tr><tr><td>Card ID</td><td rowspan="4" colspan="5"></td></tr><tr><td>0</td></tr><tr><td>2</td></tr><tr><td>3</td></tr></table>

Notice that if there has the same card ID on multiple cards, the function will not work correctly.

# 5 MotionCreatorPro

After installing the hardware (Chapters 2 and 3), it is necessary to correctly configure all cards and double check the system before running. This chapter gives guidelines for establishing a control system and manually testing the 8144 cards to verify correct operation. The MotionCreatorPro software provides a simple yet powerful means to setup, configure, test, and debug a motion control system that uses 8144 cards.

Note that MotionCreatorPro is only available for Windows 2000/XP with a screen resolution higher than 1024x768. Recommended screen resolution is 1024x768. It cannot be executed under the DOS environment.

# 5.1 Run MotionCreatorPro

After installing the software drivers for the 8144 in Windows 2000/XP, the MotionCreatorPro program can be located at &lt;chosen path&gt; \PCI-Motion\MotionCreatorPro. To execute the program, double click on the executable file or use Start>Program Files>PCI-Motion>MotionCreatorPro.

# 5.2 About MotionCreatorPro

Before Running MotionCreatorPro, the following issues should be kept in mind.

1. MotionCreatorPro is a program written in VB.NET 2003, and is available only for Windows 2000/XP with a screen resolution higher than 1024x768. It cannot be run under DOS.
2. MotionCreatorPro allows users to save settings and configurations for 8144 cards. Saved configurations will be automatically loaded the next time MotionCreatorPro is executed. Two files, 8144.ini and 8144MC.ini, in the windows root directory are used to save all settings and configurations.
3. To duplicate configurations from one system to another, copy 8144.ini and 8144MC.ini into the windows root directory.
4. If multiple 8144 cards use the same MotionCreatorPro saved configuration files, the DLL function call \_8144\_config\_from\_file() can be invoked within a user developed program. This function is available in a DOS environment as well.

# 5.3 MotionCreatorPro Form Introducing

# 5.3.1 Main Menu

The main menu appears after running MotionCreatorPro. It is used to:

![Reload all Menu\nOpen Help menus\nExit MotionCreatorPro\nFile Edit View 1.06\nFile Edit View 1.06\nFile Edit View 1.06\nFile Edit View 1.06\nFile Edit View 1.06\nFile Edit View 1.06\nFile Edit View 1.06\nFile Edit View 1.06\nFile Edit View 1.06\nFile Edit View 1.06\nFile Edit View 1.06\nFile Edit View 1.06](.pci-8144-50-11144-1010-201/8d164da008d4e48bdd3fbeb8432b69058af78ea587a433382df66dd54b59adb8.jpg)

# 5.3.2 Select Menu

The select menu appears after running MotionCreatorPro. It is used to:

- Select operating card and axis
- Open Card Information Menu (refer to section 5.3.3)
- Open Configuration Menu (refer to section 5.3.4)
- Open Single Axis Operation Menu (refer to section 5.3.5)
- Open Four-Axis Operation Menu (refer to section 5.3.6)
- Show card information. Related function are : \_8144\_get\_version(),
- Version Information

![frmTreeView\nADLINK\nMotion\nPCI-8144\nHardware\nCard 0\nAxis 0\nAxis 1\nAxis 2\nAxis 3\nFunctions\n1-Axes Operate\n4-Axes Operate\nCard Information :\nBase Address (HEX) :\nIRQ Level :\nVersion Information :\nHardware version :\nLibrary version :\nDriver version :\nLibrary2 version :](.pci-8144-50-11144-1010-201/9b906fe2195d963c6a4a074d84e9993ebc6582b78546b85b37f3dad1c4171a0c.jpg)

# 5.3.3 Card Information Menu

This menu shows Information about this card.

![Green PCI computer card with various electronic components and connectors (no visible text or symbols)](.pci-8144-50-11144-1010-201/1263b5176a5d7249b09e134333add6218f8bfeddff0767fcaa943e2bee9fb063.jpg)

# 5.3.4 Configuration Menu

In this menu, users can configure EL, M\_IO\_Sensitivity, PulseLogic, SD\_Singal and ORG\_Stop.

![Configurations\nPCI-8144 Card no : Card 0 Axis no : Axis 0\nIO_Config_1 | Interrupt_Config |\nMech Signal\nEL\nLogic 1 Active Low Active High\nM_IO_Sensitivity\nHighLow 2 Low Sensitivity High Sensitivity\nPulseLogic 3 Logic Active Low Active High\nSD_Singal 4 Enable/Disable Enable\nReturn Home Mode\nORG_Stop 5 Enable/Disable Enable\nNext Card\n6 Next Axis\nSave Config](.pci-8144-50-11144-1010-201/855713d50526d43ff86e8be125c7ca51b3504590615bf4a8fe28b27ac8360e6a.jpg)

1. EL Logic: Select the logic of the EL signal. The related function call is \_8144\_set\_limit\_logic().
2. M\_IO\_Sensitivity: Select the configurations of the IO Sensitivity. The related function call is \_8144\_set\_mio\_sensitivity().
3. Pulse Logic: Select the logic of the pulse mode. The related function call is \_8144\_set\_pls\_outmode().
4. SD\_Singal: Select the configuration of the SD singal.
The related function call is \_8144\_enable\_sd\_signal().
5. ORG\_Stop: Select the configurations of the ORG\_Stop.

The related function call is \_8144\_enable\_org\_stop().

# 6. Buttons:

▷ Next Card: Change operating card.
▷ Next Axis: Change operating axis.
Save Config: Save current configuration to 8144.ini and 8144MC.ini.

In this menu, users can configure motion INT factor and gpio INT factor.

![Configuration\nPCI-8144 Card no : Card 0 Axis no : Axis 0\nIO_Config_1 Interrupt_Config\nGPIO INT Factor\nBit 0 ✓ D00 Rating\nBit 1 ✓ D11 Rating\nBit 2 ✓ D12 Rating\nBit 3 ✓ D13 Rating\nBit 4 ✓ D14 Rating\nBit 5 ✓ D15 Rating\nBit 6 ✓ D16 Rating\nBit 7 ✓ D17 Rating\nBit 8 ✓ D18 Felling\nBit 9 ✓ D19 Felling\nBit 10 ✓ D20 Felling\nBit 11 ✓ D21 Felling\nBit 12 ✓ D22 Felling\nBit 13 ✓ D23 Felling\nBit 14 ✓ D24 Felling\nBit 15 ✓ D25 Felling\nMotion INT Factor\nBit 0 ✓ Motion Stop 2\nNext Card\n3\nNext Axis\nSave Config](.pci-8144-50-11144-1010-201/4a317495225c67836155eaf0bbd7452b2477b6a085b168099f00a39f25ea2b4c.jpg)

1. GPIO INT Factor: Select factors to initiate the gpio event interrupt. The related function call is \_8144\_set\_gpio\_interrupt\_factor().
2. Motion INT Factor: Select factors to initiate the event interrupt. The related function call is \_8144\_set\_motion\_interrupt\_factor().
3. Buttons:

▷ Next Card: Change operating card.
▷ Next Axis: Change operating axis.
Save Config: Save current configuration to 8144.ini and 8144MC.ini.

# 5.3.5 Single Axis Operation Menu

In this menu, users can change the settings a selected axis, including velocity mode motion, preset relative motion.

![Single Axis Operation\nPCI-8144 Card no : Card 0 Axis no : Axis 0\nGet Remain Pulse\nRemain Pulse 0\nSet Remain Pulse\nSet 2 0\nAxis Status\nNormal INT Status\nSet Factor hit No 3 0\nInt Occur - No Clear\nInt Count 5 0 Clear\nGPIO INT Status\nSet Factor hit No 6 0 (0-1.5)\nInt Occur -7 No Clear\nInt Count 8 0 Clear\nPlay key\nForward Move 14 Backward Move 15 STOP\nOperation Mode\nRelative Mode Coat Move\n9 Distance Repeat Mode 10 ON 11 Vel Profile 12 S-curve\nSpeed Parameter\nStart Velocity(pps) : 0\nMaximum Velocity(pps) : 10000\nAccel. Time(sec) : 13\nMove Delay (sec) : 2\nI/O Status\nEL+\nEL-\nORG\nSTR\nSTA\nSD+\nSD-\nMotion Status\nSTOP 17\nPre-Count\nP_C ) RS Accel Decel\nNext Card\nNext Axis Save Config](.pci-8144-50-11144-1010-201/41e9dd2a1750f078ef0148698596f00dba4953301e65069b75f785fafadd57f8.jpg)

1. Get Remain Pulse: Display the value of the remaining pulse. The related function is \_8144\_get\_remaining\_pulse()
2. Set Remain Pulse: Set the value of the remaining pulse.
The related function is \_8144\_set\_remaining\_pulse()
3. Set Factor bit No:Set int\_factor bit for normal motion interrupt. The related function call is \_8144\_set\_motion\_interrupt\_factor()
4. Int Occur: Display if the interrupt happened. Show "Yes" If happened. Otherwise, show "No".

5. Int Count: The counter would plus 1 if interrupt happened.
6. Set Factor bit No: Set int\_factor bit for GPIO interrupt.
The related function call is \_8144\_set\_gpio\_interrupt\_factor().
7. Int Occur: Display if the interrupt happened. Show "Yes" If happened. Otherwise, show "No".
8. Int Count: The counter plus 1 if interrupt happened.
9. Operation Mode: Select operation mode.

$\triangleright$ Relative Mode: "Distance" will be used as relative displacement for motion. The related function is \_8144\_start\_tr\_move(), \_8144\_start\_sr\_move().

Cont. Move: Velocity motion mode. The related function is \_8144\_tv\_move(), \_8144\_start\_sv\_move().

10. Distance: Set the relative distance for "Relative Mode." It is only effective when "Relative Mode" is selected.
11. Repeat Mode: When “On” is selected, the motion will become repeat mode (forward&lt;--&gt;backward). It is only effective when “Relative Mode” is selected.
12. Vel. Profile: Select the velocity profile. Both Trapezoidal and S-Curve are available for “Relative Mode,” and “Cont. Move.”
13. Motion Parameters: Set the parameters for single axis motion.

▷ Start Velocity: Set the start velocity of motion in units of PPS. In “Relative Mode,” only the value is effective. For example, -100.0 is the same as 100.0. In “Cont. Move,” both the value and sign are effective. -100.0 means 100.0 in the minus direction.

▷ Maximum Velocity: Set the maximum velocity of motion in units of PPS. In “Relative Mode,” only the value is effective. For example, -5000.0 is the same as 5000.0.

In “Cont. Move,” both the value and sing is effective. – 5000.0 means 5000.0 in the minus direction.

Accel. Time: Set the acceleration time in units of second. Tdec is the same as tacc.
Move Delay: This setting is effective only when repeat mode is set "On." It will cause the 8144 to delay for a specified time before it continues to the next motion.

# 14. Play Key:

▶ Left play button: Clicking this button will cause the 8144 start to outlet pulses according to previous setting.
In “Relative Mode,” it causes the axis to move forward.
In “Cont. Move,” it causes the axis to start to move according to the velocity setting.
▶ Right play button: Clicking this button will cause the 8144 start to outlet pulses according to previous setting.
In “Relative Mode,” it causes the axis to move backwards.
In “Cont. Move,” it causes the axis to start to move according to the velocity setting, but in the opposite direction.

15. Stop Button: Clicking this button will cause the 8144 to stop. The related function is \_8144\_emg\_stop().

16.I/O Status: The status of motion I/O. Light-On means Active, while Light-Off indicates inactive. The related function is \_8144\_get\_mio\_status().

17. Motion Status: The status of motion when running. Light-On means Active, while Light-Off indicates inactive. The related function is \_8144\_motion\_status().

18. Digital I/O: Display and set Digital I/O. The related function is:

\_8144\_get\_gpio\_output(),
\_8144\_get\_gpio\_input(),
\_8144\_set\_gpio\_output().

19. Buttons:

▷ Next Card: Change operating card.
▷ Next Axis: Change operating axis.
Save Config: Save current configuration to 8144.ini and 8144MC.ini.

# 5.3.6 Four-Axis Operation Menu

In this menu, users can change the settings four selected axis, including velocity mode motion, preset relative motion.

![0144 Four-Axis Operation\nCard 0 Axis 0\nDistance 1 100000 Relative 3\nStart Velocity(pps) 0 Max Velocity(pps) 10000\nTacc(s) 1 Move Delay (sec): 2\nRepeat Mode 4 ON Val. Profile 5\nStop Pre-Count P C ) R5 Acele Dcele\nEL+ EL- ORG STP STA SD+ SD-\nStop Pre-Count P_C ) R5 Acele Dcele\nEL+ EL- ORG STP STA SD+ SD-\nCard 0 Axis 1\nDistance 100000 Relative\nStart Velocity(pps) 0 Max Velocity(pps) 10000\nTacc(s) 1 Move Delay (sec): 2\nRepeat Mode  Off ON Val. Profile 6\nStop Pre-Count P_C ) R5 Acele Dcele\nEL+ EL- ORG STP STA SD+ SD-\nStop Pre-Count P_C ) R5 Acele Dcele\nEL+ EL- ORG STP STA SD+ SD-\nCard 0 Axis 2\nDistance 100000 Relative\nStart Velocity(pps) 0 Max Velocity(pps) 10000\nTacc(s) 1 Move Delay (sec): 2\nRepeat Mode  Off ON Val. Profile 7\nStop Pre-Count P_C ) R5 Acele Dcele\nEL+ EL- ORG STP STA SD+ SD-\nStop Pre-Count P_C ) R5 Acele Dcele\nEL+ EL- ORG STP STA SD+ SD-\nRemaining Pulse\nAxis 0: 0 Reset\nAxis 1: 0 Reset\nAxis 2: 0 Reset\nAxis 3: 0 Reset\nOperate\nAxis 0\n(( + STOP - ))\nAxis 2\n(( + STOP - ))\nAxis 1\n(( + STOP - ))\nAxis 3\n(( + STOP - ))\nNext Card\n10 Save](.pci-8144-50-11144-1010-201/23b23108c55efed7994c14e5746357b9a4e319899e84034bc0c9eaaaed6b1ed8.jpg)

1. Distance: Set the relative distance for "Relative Mode." It is only effective when "Relative Mode" is selected.
2. Motion Parameters: Set the parameters for single axis motion.

▷ Start Velocity: Set the start velocity of motion in units of PPS. In “Relative Mode”, only the value is effective. For example, -100.0 is the same as 100.0.
Maximum Velocity: Set the maximum velocity of motion in units of PPS. In "Relative Mode", only the value is effective. For example, -5000.0 is the same as 5000.0.

▷ Tacc: Set the acceleration time in units of second and tdec is the same as tacc.

3. Operation Mode: Select operation mode.

$\triangleright$ Relative Mode: "Distance" will be used as relative displacement for motion. The related function is \_8144\_start\_tr\_move(), \_8144\_start\_sr\_move().

4. Repeat Mode: When "On" is selected, the motion will become repeat mode (forward&lt;--&gt;backward). It is only effective when "Relative Mode" is selected

5. Vel. Profile: Select the velocity profile. Both Trapezoidal and S-Curve are available for Relative Mode.

6. Motion Status: The status of motion. Light-On means Active, while Light-Off indicates inactive. The related function is \_8144\_motion\_status().

7. I/O Status: The status of motion I/O. Light-On means Active, while Light-Off indicates inactive. The related function is \_8144\_get\_mio\_status().

8. Remaining Pulse: Display the value of the remaining pulse. The related function is \_8144\_get\_remaining\_pulse()

9. Play Key:

▶ Left play button: Clicking this button will cause the 8144 start to outlet pulses according to previous setting.

▷ In “Relative Mode,” it causes the axis to move forward.

▶ Right play button: Clicking this button will cause the 8144 start to outlet pulses according to previous setting.

In "Relative Mode," it causes the axis to move backwards.

▶ Stop Button: Clicking this button will cause the 8144 to stop. The related function is \_8144\_emg\_stop().

# 10. Buttons:

▷ Next Card: Change operating card.
▷ Save Config: Save current configuration to 8144.ini and 8144MC.ini.

# 5.3.7 Help Menu

In this menu, users can Click Mouse Right Key to show Help Information.

![Doubleysis_Survey_spend_window(Satlon/InfoNo) = C:\Auto\Stop_Velocity Test](.pci-8144-50-11144-1010-201/8cdb336a31b7ae1b77638bd251c4f9199646aaccc0e6dc9995565bd220a51460.jpg)

# 6 Function Library

This chapter describes the supporting software for the 8144 card. User can use these functions to develop programs in C, C++, or Visual Basic. If Delphi is used as the programming environment, it is necessary to transform the header files, 8144.h manually.

# 6.1 List of Functions

<table><tr><td>Sec.</td><td>Function name</td><td>Description</td><td>Page</td></tr><tr><td rowspan="8">6.3</td><td colspan="2">System &amp; Initialization</td><td>72</td></tr><tr><td>_8144_initial</td><td>Device initialization</td><td>72</td></tr><tr><td>_8144_close</td><td>Device close</td><td>74</td></tr><tr><td>_8144_get_version</td><td>Get version numbers</td><td>75</td></tr><tr><td>_8144_set_security_key</td><td>Set the security password</td><td>76</td></tr><tr><td>_8144_check_security_key</td><td>Varily the security password</td><td>78</td></tr><tr><td>_8144_reset_security_key</td><td>Reset the security password to default value</td><td>80</td></tr><tr><td>_8144_config_from_file</td><td>Configure settings from file</td><td>82</td></tr><tr><td rowspan="7">6.4</td><td colspan="2">Motion Interface I/O</td><td>83</td></tr><tr><td>_8144_set_limit_logic</td><td>Set the logic of PEL/MEL input signals</td><td>83</td></tr><tr><td>_8144_get_limit_logic</td><td>Get the logic of PEL/MEL input signals</td><td>85</td></tr><tr><td>_8144_get_mio_status</td><td>Get the status of motion I/O signals</td><td>87</td></tr><tr><td>_8144_set_mio_sensitivity</td><td>Set the sensitive of motion I/O signals</td><td>89</td></tr><tr><td>_8144_set_pls_outmode</td><td>Set the logic of pulse output signal</td><td>91</td></tr><tr><td>_8144_set_pls_outmode2</td><td>Set the output pulse mode and it's logic</td><td>93</td></tr><tr><td rowspan="17">6.5</td><td colspan="2">Motion</td><td>94</td></tr><tr><td>_8144_tv_move</td><td>Accelerate an axis to a constant velocity with trapezoidal profile</td><td>94</td></tr><tr><td>_8144_sv_move</td><td>Accelerate an axis to a constant velocity with S-curve profile</td><td>96</td></tr><tr><td>_8144_start_tr_move</td><td>Begin a relative trapezoidal profile move</td><td>98</td></tr><tr><td>_8144_start_sr_move</td><td>Begin a relative S-curve profile move</td><td>101</td></tr><tr><td>_8144_set_external_start</td><td>Set inhibit start by STA input signal</td><td>107</td></tr><tr><td>_8144_emg_stop</td><td>Immediately stop</td><td>109</td></tr><tr><td>_8144_dec_stop</td><td>Decelerate to stop</td><td>111</td></tr><tr><td>_8144_slow_down</td><td>Slow down</td><td>114</td></tr><tr><td>_8144_enable_org_stop</td><td>Enable the stop when org signal active</td><td>116</td></tr><tr><td>_8144_enable_sd_signal</td><td>Enable the slow down when SD signal is active</td><td>118</td></tr><tr><td>_8144_speed_up</td><td>Re-accelerate an axis to maximum velocity with a trapezoidal or S-curve profile</td><td>113</td></tr><tr><td>_8144_enable_get_command</td><td>Enable the “get_command()” function</td><td>104</td></tr><tr><td>_8144_get_command</td><td>Get command position of an axis</td><td>105</td></tr><tr><td>_8144_set_command</td><td>Set command position of an axis</td><td>106</td></tr><tr><td>_8144_home_move</td><td>Perform a software based home return operation</td><td>120</td></tr><tr><td>_8144_home_status</td><td>Get homing status</td><td>122</td></tr><tr><td rowspan="3">6.6</td><td colspan="2">Motion status</td><td>125</td></tr><tr><td>_8144_motion_done</td><td>Get the motion stop or not</td><td>125</td></tr><tr><td>_8144_motion_status</td><td>Get the motion status</td><td>127</td></tr><tr><td rowspan="6">6.7</td><td colspan="2">Interrupt</td><td>129</td></tr><tr><td>_8144_set_motion_interrupt_factor</td><td>Set factors of motion related interrupts</td><td>129</td></tr><tr><td>_8144_wait_single_motion_interrupt</td><td>Wait a single motion related interrupt</td><td>131</td></tr><tr><td>_8144_set_gpio_interrupt_factor</td><td>Set factors of digital input interrupt</td><td>134</td></tr><tr><td>_8144_wait_single_gpio_interrupt</td><td>Wait a single digital input interrupt</td><td>136</td></tr><tr><td>_8144_wait_multiple_gpio_interrupt</td><td>Wait multiple digital input interrupts</td><td>138</td></tr><tr><td rowspan="7">6.8</td><td colspan="2">General purpose I/O</td><td>141</td></tr><tr><td>_8144_get_gpio_input</td><td>Get all DIN digital input signals</td><td>141</td></tr><tr><td>_8144_get_gpio_input_channel</td><td>Get a specified DINn digital input signal</td><td>142</td></tr><tr><td>_8144_set_gpio_output</td><td>Set all DOUT digital output signal</td><td>143</td></tr><tr><td>_8144_set_gpio_output_channel</td><td>Set a specified DOUTn digital output signal</td><td>144</td></tr><tr><td>_8144_get_gpio_output</td><td>Get all DOUT digital output signal</td><td>145</td></tr><tr><td>_8144_get_gpio_output_channel</td><td>Get a specified DOUTn digital output signal</td><td>146</td></tr><tr><td rowspan="5">6.9</td><td colspan="2">Speed profile calculation</td><td>147</td></tr><tr><td>_8144_get_tv_move_profile</td><td>Get tv_move speed profile</td><td>147</td></tr><tr><td>_8144_get_sv_move_profile</td><td>Get sv_move speed profile</td><td>149</td></tr><tr><td>_8144_get_start_tr_move_profile</td><td>Get start_tr_move speed profile</td><td>151</td></tr><tr><td>_8144_get_start_sr_move_profile</td><td>Get start_sr_move speed profile</td><td>153</td></tr></table>

# 6.2 C/C++ Programming Library

This section details all the functions. The function prototypes and some common data types are declared in pci\_8144.h. We suggest you use these data types in your application programs. The following table shows the data type names and their range.

<table><tr><td>Type Name</td><td>Description</td><td>Range</td></tr><tr><td>U8</td><td>8-bit ASCII character</td><td>0 to 255</td></tr><tr><td>I16</td><td>16-bit signed integer</td><td>-32768 to 32767</td></tr><tr><td>U16</td><td>16-bit unsigned integer</td><td>0 to 65535</td></tr><tr><td>I32</td><td>32-bit signed long integer</td><td>-2147483648 to 2147483647</td></tr><tr><td>U32</td><td>32-bit unsigned long integer</td><td>0 to 4294967295</td></tr><tr><td>F32</td><td>32-bit single-precision floating-point</td><td>-3.402823E38 to 3.402823E38</td></tr><tr><td>F64</td><td>64-bit double-precision floating-point</td><td>-1.797683134862315E308 to 1.797683134862315E309</td></tr><tr><td>Boolean</td><td>Boolean logic value</td><td>TRUE, FALSE</td></tr></table>

Table 6-1: Data type definitions

The functions of the PCI-8144 software drivers use full-names to represent the functions real meaning. The naming convention rules are:

In a 'C' programming environment:

\_{hardware\_model}\_{action\_name}. e.g. \_8144\_initial().

In order to recognize the difference between a C library and a VB library, a capital "B" is placed at the beginning of each function name e.g. B\_8144\_initial().

# 6.3 System and Initialization

# \_8144\_initial

Device initialization

# Description:

This function is used to initialize PCI-8144 cards and assign hardware resources. All 8144 cards must be initialized by this function before calling other functions in your applications. By setting the parameter "ManualId", user can choose the type that the card's ID is assigned manually or automatically. In the end of your application, you should use the function, \_8144\_close(), to release its resources.

# Syntax:

I16 \_8144\_initial( I32 \*CardIdInBit, I16 ManualId );

B\_8144\_initial( CardIdInBit As Long, ByVal ManualId As Integer) As Integer

# Parameters:

I32 \*CardIdInBit: Card ID information in bit format.

Note: if the value of CardIdInBit is 0x3, that means there are 2 cards in your system and those card ID are 0 and 1 respectively.

I16 ManualId: Enable the On board dip switch (SW1) to decide the Card ID. [0:By system assigned, 1:By dip switch]

# Return Values:

```txt
ERR_NoError
ERR_OpenDriverFailed
ERR_InsufficientMemory
ERR_CardIdDuplicate
ERR_NoDeviceFound
```

# Example:

```javascript
I16 ret; // return value
I32 CardIdInBit;
```

```c
I16 ManualId = 0; //By system assigned
ret = _8144_initial( &CardIdInBit, ManualId );
...// Do something
ret = _8144_close(); //Close all PCI-8144 cards in the system
```

# See also:

```c
_8144_close();
```

# \_8144\_close

Devices close

# Description:

This function is used to close all PCI-8144 cards in the system and release its' resources, which must be called at the end of your applications.

# Syntax:

```txt
I16 _8144_close()
B_8144_close() As Integer
```

# Parameters:

# Return Values:

```txt
ERR_NoError : Success.
```

# Example:

```c
I16 ret; // return value
I32 CardIdInBit;
I16 ManualId = 0; //By system assigned
ret = _8144_initial( &CardIdInBit, ManualId );
...// Your applications
ret = _8144_close(); //Close all PCI-8144 cards in the system
```

# See also:

```c
_8144_initial();
```

# \_8144\_get\_version

Get software and hardware version numbers

# Description:

The user can get software and hardware versions by this function.

# Syntax:

```txt
I16 _8144_get_version( I16 CardId, I32 *Dll_1, I32 *Dll_2, I32 *FirmwareVersion, I32 *DriverVersion );
B_8144_get_version( ByVal CardId As Integer, Dll_1 As Long, Dll_2 As Long, FirmwareVersion As Long, DriverVersion As Long ) As Integer
```

# Parameters:

I16 CardId: The card ID number
I32 \*D11\_1: The 8144.DLL version information
I32 \*D11\_2: The MC4541.DLL version information
I32 \*FirmwareVersion: The information of 8144 card firmware version
I32 \*DriverVersion: The information of WDM driver.

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_Win32Error
ERR_NoError
```

# Example:

```txt
I16 CardId = 0;
I32 DLL_1, DLL_2, FirmwareVersion, DriverVersion;
I16 ret = _8144_get_version(CardId, &Dll_1, &Dll_2, &FirmwareVersion, &DriverVersion);
...
```

# See also:

# \_8144\_set\_security\_key

Set the security password

# Description:

This function is used to set a security code to the PCI card in EEPROM. The security code will never dispear even if the system is powered off.

# Syntax:

```txt
I16 _8144_set_security_key(I16 CardId, U16 OldPassword, U16 NewPassword)
B_8144_set_security_key(ByVal CardId As Integer, ByVal OldPassword As Integer, ByVal NewPassword As Integer) As Integer
```

# Parameters:

I16 CardId: The card ID number.

U16 OldPassword: The current password stored in card.

U16 NewPassword: New password.

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_GetEEPROM
ERR_SetEEPROM
ERR_NoError
```

# Example:

```c
I16 ret; //return code
I16 CardId = 0; // card ID
U16 OldPassword = 0; // current password stored in card
U16 NewPassword = 0x1234; //new password
If(_8144_reset_security_key(CardId)) //reset the password to default value (0)
{// return error}
if(_8144_set_security_key(CardId, OldPassword, NewPassword)) //set a new password
{//return error}
```

```c
ret = _8144_check_security_key(CardId, NewPassword); // verify the new password if( ret == ERR_NoError )
    // security pass
else
    // security failed
```

# See also:

```txt
_8144_check_security_key
_8144_reset_security_key
```

# \_8144\_check\_security\_key

Varily the security password

# Description:

This function is used to verify the security code which the user set by the function “\_8144\_set\_security\_key”.

# Syntax:

```txt
I16 _8144_check_security_key(I16 CardId, U16 Password)
B_8144_check_security_key(ByVal CardId As Integer, ByVal Password As Integer) As Integer
```

# Parameters:

I16 CardId: The card ID number.

U16 Password: The password number

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_GetEEPROM
ERR_NoError
```

# Example:

```c
I16 ret; //return code
I16 CardId = 0; // card ID
U16 OldPassword = 0; // current password stored in card
U16 NewPassword = 0x1234; //new password
If(_8144_reset_security_key(CardId)) //reset the password to default value (0)
{// return error}
if(_8144_set_security_key(CardId, OldPassword, NewPassword)) //set a new password
{//return error}
ret = _8144_check_security_key(CardId, NewPassword); //verify the new password
if(ret == ERR_NoError)
// security pass
```

else

// security failed

# See also:

```txt
_8144_set_security_key
_8144_reset_security_key
```

# \_8144\_reset\_security\_key

Reset the security password to default value

# Description:

By this function, Users can reset the security code which is stored on the PCI card to default value. The default security code is0.

# Syntax:

```txt
I16 _8144_reset_security_key(I16 CardId)
B_8144_reset_security_key(ByVal CardId As Integer) As Integer
```

# Parameters:

I16 CardId: The card ID number

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_SetEEPROM
ERR_NoError
```

# Example:

```c
I16 ret; //return code
I16 CardId = 0; // card ID
U16 OldPassword = 0; // current password stored in card
U16 NewPassword = 0x1234; // new password
If(_8144_reset_security_key(CardId)) // reset the password to default value (0)
{// return error}
if(_8144_set_security_key(CardId, OldPassword, NewPassword)) // set a new password
{// return error}
ret = _8144_check_security_key(CardId, NewPassword); // verify the new password
if(ret == ERR_NoError)
// security pass
else
// security failed
```

# See also:

\_8144\_set\_security\_key
\_8144\_check\_security\_key

# \_8144\_config\_from\_file

Configure settings from file

# Description:

This function is used to load the configuration of the PCI-8144 according to specified file. By using Motion Creator Rro, user could test and configure the 8144 correctly. After saving the configuration, the file would be existed in user's system directory as 8144.ini.

When this function is executed, all 8144 cards in the system will be configured as the following functions were called according to parameters recorded in 8144.ini.

```txt
_8144_set_limit_logic
_8144_set_mio_sensitivity
_8144_set_pls_outmode,
_8144_enable_sd_signal
```

# Syntax:

```txt
I16 _8144_config_from_file()
B_8144_config_from_file() As Integer
```

# Parameters:

# Return Values:

```txt
ERR_NoError
```

# Example:

# See also:

```txt
_8144_set_limit_logic
_8144_set_mio_sensitivity
_8144_set_pls_outmode
_8144_enable_sd_signal
```

# 6.4 Motion Interface I/O

# \_8144\_set\_limit\_logic

Set the logic of PEL/MEL input signals

# Description:

Set the active logic of specified axis's PEL/MEL input signal.

# Syntax:

```txt
I16 _8144_set_limit_logic(I16 AxisNo, I16 LimitLogic)
B_8144_set_limit_logic(ByVal AxisNo As Integer, ByVal LimitLogic As Integer) As Integer
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

I16 LimitLogic: The logic of PEL/MEL input signal

▷ 0: Negative logic
▷ 1: Positive logic

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

Example:
```c
I16 ret; // return value
I16 AxisNo = 0; //Axis number
I16 LimitLogic = 1; //Positive logic
ret = _8144_set_limit_logic(AxisNo, LimitLogic);
//EL logic setting
```

See also:
```txt
_8144_get_limit_logic
_8144_get_mio_status
_8144_set_mio_sensitivity
```

# \_8144\_get\_limit\_logic

Get the logic of PEL/MEL input signals

# Description:

Get the information of PEL/MEL input signal logic setting.

# Syntax:

```txt
I16 _8144_get_limit_logic(I16 AxisNo, I16 *LimitLogic)
B_8144_get_limit_logic(ByVal AxisNo As Integer, LimitLogic As Integer)
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

I16 \*LimitLogic: The information of logic of PEL/MEL input signal.

▷ 0: Negative logic
▷ 1: Positive logic

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

Example:
```c
I16 ret; //return code
I16 AxisNo = 0;
I16 LimitLogic;
ret = _8144_get_limit_logic(I16 AxisNo, &LimitLogic);
```

See also:
```txt
_8144_set_limit_logic
_8144_get_mio_status
_8144_set_mio_sensitivity
```

# \_8144\_get\_mio\_status

Get the status of motion I/O signals

# Description:

Get all of motion I/O, status of each axis

# Syntax:

```txt
I16 _8144_get_mio_status(I16 AxisNo, I16 *MotionIoStatusInBit)
B_8144_get_mio_status(ByVal AxisNo As Integer, MotionIoStatusInBit As Integer) As Integer
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

I16 \*MotionIoStatusInBit: Statuses of Motion I/O. The definition of each bit as follow

<table><tr><td>Bit</td><td>Name</td><td>Description</td></tr><tr><td>0</td><td>MEL</td><td>Negative Limit Switch</td></tr><tr><td>1</td><td>PEL</td><td>Positive Limit Switch</td></tr><tr><td>2</td><td>ORG</td><td>Origin Switch</td></tr><tr><td>3</td><td>STP</td><td>STP pin status(EMG)</td></tr><tr><td>4</td><td>STA</td><td>STA pin status</td></tr><tr><td>5</td><td>MSD</td><td>Negative Slow Down signal input</td></tr><tr><td>6</td><td>PSD</td><td>Positive Slow Down signal input</td></tr><tr><td>7~</td><td>-</td><td>Reserve</td></tr></table>

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

# Example:

```rust
I16 ret;
I16 AxisNo = 0; //axis number
I16 MotionIoStatusInBit; //The information of motion I/O in bit
ret = _8144_get_mio_status(AxisNo, &MotionIoStatusInBit);
...
```

# See also:

```txt
_8144_get_limit_logic
_8144_set_limit_logic
_8144_set_mio_sensitivity
```

# \_8144\_set\_mio\_sensitivity

Set the sensitive of motion I/O signals

# Description:

By this function, to set “low sensitivity” to reduce the sensitivity to signals on the ORG, P/MEL and STP signal. Pulse signals shorter than 4 reference clock cycles( approx. 800ns) will be ignored.

# Syntax:

```txt
I16 _8144_set_mio_sensitivity( I16 AxisNo, I16 HighOrLow )
B_8144_set_mio_sensitivity( ByVal AxisNo As Integer, ByVal HighOrLow As Integer ) As Integer
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

I16 HighOrLow: Sensitivity setting

▷ 0: HIGH\_SENSITIVITY
▷ 1: LOW\_SENSITIVITY

# Return Values:

ERR\_ParametersInvalid

ERR\_DeviceNotInitial

ERR\_NoError

Example:
```c
I16 ret; //return value
I16 AxisNo = 0; //axis number
I16 HighOrLow = 1; //set to low sensitivity
ret = _8144_set_mio_sensitivity(AxisNo, HighOrLow);
...
```

See also:
```txt
_8144_get_limit_logic
_8144_set_limit_logic
_8144_get_mio_status
```

# \_8144\_set\_pls\_outmode

Set the logic of pulse output signal

# Description:

By this function, you can change the logic of pulse output signal.

# Syntax:

I16 \_8144\_set\_pls\_outmode( I16 AxisNo, I16 PulseLogic )

B\_8144\_set\_pls\_outmode( ByVal AxisNo As Integer, ByVal PulseLogic As Integer ) As Integer

# Parameters:

I16 AxisNo: Axis number of Target Axis.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

I16 PulseLogic: The setting of logic of pulse output signal

▷ 0: Negative logic
▷ 1: Positive logic

<table><tr><td rowspan="2">Direction</td><td colspan="2">0: Negative logic</td><td colspan="2">1: Positive logic</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>(+)</td><td></td><td>&lt;img src="images/da2d546d27f2b8e6dd41f3b0cf50fbdd8cf3951d2d67b3df3090563a30aec574.jpg"/&gt;</td><td>&lt;img src="images/f4247e1b8fd3910be94d2867a817c30fde2f91126879cb7e5968a78fd629d802.jpg"/&gt;</td><td>&lt;img src="images/bf783afc04cb9be9c1c705befc0aeee42708054ff5c3c81bfb6715dc35e71a54.jpg"/&gt;</td></tr><tr><td>(-)</td><td>H</td><td></td><td>L</td><td></td></tr></table>

(\*) H: High, L: Low

# Return Values:

```txt
ERR_AxisNumber
ERR_DeviceNotInitial
ERR_ParametersInvalid
ERR_NoError
```

# Example:

```txt
I16 AxisNo = 0; //Axis 0
I16 PulseLogic = 1; //Positive logic
I16 ret = _8144_set_pls_outmode(AxisNo, PulseLogic); //Set command to the card.
...
```

# See also:

# \_8144\_set\_pls\_outmode2

# Description:

This function is used to set the output pulse mode and its logic.

# Syntax:

```txt
I16 _8144_set_pls_outmode2 ( I16 AxisNo, I16 PulseMode, I16 PulseLogic );
B_8144_enable_get_command( ByVal AxisNo As Integer, ByVal PulseMode As Integer ByVal PulseLogic As Integer ) As Integer
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.
I16 PulseMode: Output pulse mode.

0: CW/CCW

1: OUT/DIR

I16 PulseLogic: Pulse output logic.

0: Negative logic

1: Positive logic

# Return Values:

I16 Error code. Refer to error code table.

# Example:

```txt
I16 ret; //Return code
I16 PulseMode = 0; //CW/CCW
I16 PulseLogic = 0; //Negative logic
ret = _8144_set_pls_outmode2( AxisNo, PulseMode,
    PulseLogic );
...
```

# See also:

```cmake
_8144_set_pls_outmode()
```

# 6.5 Motion

# \_8144\_tv\_move

Accelerate an axis to a constant velocity with trapezoidal profile

# Description:

This function is to accelerate an axis to the specified constant velocity with a trapezoidal profile. The axis will continue to travel at a constant velocity until the velocity is changed or the axis is commanded to stop. The direction is determined by the sign of the velocity parameter (MaxVel).

This function has warning return code. It means that the speed profile that users specified doesn't make sense or out of ASIC can do. It will adjust the parameter automatically and return a warning code, and the motion card still output pulses to control the axis.

# Syntax:

I16 \_8144\_tv\_move( I16 AxisNo, F64 StrVel, F64 MaxVel, F64 Tacc )

B\_8144\_tv\_move( ByVal AxisNo As Integer, ByVal StrVel As Double, ByVal MaxVel As Double, F64 Tacc As Double) As Integer

# Parameters:

I16 AxisNo: The axis number is designated to receive the command.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

F64 StrVel: Starting velocity (pulse/sec)

F64 MaxVel: Maximum velocity (pulse/sec)

F64 Tacc: Specified acceleration and deceleration time (sec)

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
WAR_AccDecTimeToSmall
WAR_AccDecTimeToLarge
ERR_NoError
```

# Example:

```c
I16 ret; //return code
I16 AxisNo = 0; // axis number
F64 StrVel = 500; // starting velocity
F64 MaxVel = 50000; // maximum velocity
F64 Tacc = 0.5; // acceleration/deceleration time (sec)
ret = _8144_tv_move( AxisNo, StrVel, MaxVel, Tacc );
```

# See also:

```txt
_8144_sv_move
_8144_emg_stop
_8144_dec_stop
_8144_slow_down
_8144_enable_org_stop
_8144_enable_sd_signal
_8144_set_external_start
```

# \_8144\_sv\_move

Accelerate an axis to a constant velocity with S-curve profile

# Description:

This function is to accelerate an axis to the specified constant velocity with a S-curve profile. The axis will continue to travel at a constant velocity until the velocity is changed or the axis is commanded to stop. The direction is determined by the sign of velocity parameter.

This function has warning return code. It means that the speed profile that users specified doesn't make sense or out of ASIC can do. It will adjust the parameter automatically and return a warning code, and the motion card still output pulses to control the axis.

# Syntax:

I16 \_8144\_sv\_move( I16 AxisNo, F64 StrVel, F64 MaxVel, F64 Tacc )

B\_8144\_sv\_move( ByVal AxisNo As Integer, ByVal StrVel As Double, ByVal MaxVel As Double, F64 Tacc As Double) As Integer

# Parameters:

I16 AxisNo: The axis number is designated to receive the command.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

F64 StrVel: Starting velocity (pulse/sec)

F64 MaxVel: Maximum velocity (pulse/sec)

F64 Tacc: Specified acceleration and deceleration time (sec)

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
WAR_AccDecTimeToSmall
WAR_AccDecTimeToLarge
ERR_NoError
```

# Example:

```c
I16 ret; //return code
I16 AxisNo = 0; // axis number
F64 StrVel = 500; // starting velocity
F64 MaxVel = 50000; // maximum velocity
F64 Tacc = 0.5; // acceleration/deceleration time (sec)
ret = _8144_sv_move( AxisNo, StrVel, MaxVel, Tacc );
```

# See also:

```txt
_8144_tv_move
_8144_emg_stop
_8144_dec_stop
_8144_slow_down
_8144_enable_org_stop
_8144_enable_sd_signal
_8144_set_external_start
_8144_get_remaining_pulse
_8144_set_remaining_pulse
_8144_get_tv_move_profile
```

# \_8144\_start\_tr\_move

Begin a relative trapezoidal profile move

# Description:

This function causes the axis to accelerate form a starting velocity (StrVel), rotate at constant velocity (MaxVel), and decelerate to stop at the relative distance with symmetrical trapezoidal profile. The acceleration and deceleration time is specified by a parameter “Tacc”. The moving direction is determined by the sign of the Distance parameter. It does not let the program wait for motion completion but immediately returns control to the program.

This function has warning return code. It means that the speed profile that users specified doesn't make sense or out of ASIC can do. It will adjust the parameter automatically and return a warning code, and the motion card still output pulses to control the axis.

# Syntax:

```txt
I16 _8144_start_tr_move( I16 AxisNo, F64 Distance, F64 StrVel, F64 MaxVel, F64 Tacc );
B_8144_start_tr_move( ByVal AxisNo As Integer, ByVal Distance As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal Tacc As Double ) As Integer
```

# Parameters:

I16 AxisNo: The axis number is designated to receive the command.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

F64 Distance: Specified relative distance to move ( pulse)

F64 StrVel: Starting velocity (pulse/sec)

F64 MaxVel: Maximum velocity (pulse/sec)

F64 Tacc: Specified acceleration and deceleration time (sec)

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
WAR_AccDecTimeToSmall
WAR_AccDecTimeToLarge
WAR_RampDownPointExceed
ERR_NoError
```

# Example:

```txt
I16 ret;
I16 AxisNo = 0; // axis number
F64 Distance = 50000.0; //reletive distance
F64 StrVel = 500.0; // starting velocity
F64 MaxVel = 10000.0; // maximum velocity
F64 Tacc = 0.5; // acceleration/deceleration time (sec)
ret = _8144_start_tr_move( AxisNo, Distance, StrVel, MaxVel, Tacc );
```

# See also:

```txt
_8144_start_sr_move
_8144_set_external_start
_8144_emg_stop
_8144_dec_stop
_8144_slow_down
_8144_enable_org_stop
```

\_8144\_enable\_sd\_signal
\_8144\_get\_remaining\_pulse
\_8144\_set\_remaining\_pulse
\_8144\_get\_sv\_move\_profile

# \_8144\_start\_sr\_move

Begin a relative S-curve profile move

# Description:

This function causes the axis to accelerate from a starting velocity (StrVel), rotate at constant velocity (MaxVel), and decelerates to stop at the relative distance with S-curve profile. The acceleration and deceleration time is specified by a parameter “Tacc”. The moving direction is determined by the sign of the Distance parameter. This command does not let the program wait for motion completion, but immediately returns control to the program.

This function has warning return code. It means that the speed profile that users specified doesn't make sense or out of ASIC can do. It will adjust the parameter automatically and return a warning code, and the motion card still output pulses to control the axis.

# Syntax:

```txt
I16 _8144_start_sr_move( I16 AxisNo, F64 Distance, F64 StrVel, F64 MaxVel, F64 Tacc );
B_8144_start_sr_move( ByVal AxisNo As Integer, ByVal Distance As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal Tacc As Double ) As Integer
```

# Parameters:

I16 AxisNo: The axis number is designated to receive the command.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

F64 Distance: Specified relative distance to move ( pulse)

F64 StrVel: Starting velocity (pulse/sec)

F64 MaxVel: Maximum velocity (pulse/sec)

F64 Tacc: Specified acceleration and deceleration time (sec)

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
WAR_AccDecTimeToSmall
WAR_AccDecTimeToLarge
WAR_RampDownPointExceed
ERR_NoError
```

# Example:

```txt
I16 ret;
I16 AxisNo = 0; // axis number
F64 Distance = 50000.0; //reletive distance
F64 StrVel = 500.0; // starting velocity
F64 MaxVel = 10000.0; // maximum velocity
F64 Tacc = 0.5; // acceleration/deceleration time (sec)
ret = _8144_start_sr_move( AxisNo, Distance, StrVel, MaxVel, Tacc );
```

# See also:

```txt
_8144_start_tr_move
_8144_set_external_start
_8144_emg_stop
_8144_dec_stop
_8144_slow_down
_8144_enable_org_stop
```

\_8144\_enable\_sd\_signal
\_8144\_get\_remaining\_pulse
\_8144\_set\_remaining\_pulse

# \_8144\_enable\_get\_command

# Description:

This function is used to enable "get\_command()" function. If users enable "get\_command" function, users can use \_8144\_get\_command() function to get current command position.

When the axis is in motion, you can not issue this function. When “get command” is enabled, the command position will be reset to zero and you can not change speed of axes on the fly.

# Syntax:

```c
I16 _8144_enable_get_command( I16 AxisNo, I16 Enable );
B_8144_enable_get_command( ByVal AxisNo As Integer, ByVal Enable As Integer ) As Integer
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.

I16 Enable:

0: Disable get command position function.
1: Enable get command position function.

# Return Values:

I16 Error code. Refer to error code table.

# Example:

```txt
I16 ret;
ret = _8144_enable_get_command(AxisNo, 1); // Enable get command function.
...
```

# See also:

```txt
_8144_get_command
_8144_set_command
```

# \_8144\_get\_command

# Description:

This function is used to get command position of an axis. The command position is calculated from hardware preset counter (Get by \_8144\_enable\_get\_command). Users must enable this function before use it by the function: “\_8144\_enable\_get\_command”.

# Syntax:

```c
I16 _8144_get_command( I16 AxisNo, I32 *Cmd );
B_8144_get_command( ByVal AxisNo As Integer, Cmd As Long ) As Integer
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.

I32 \*Cmd: Retrieve command position.

# Return Values:

```txt
I16 Error code. Refer to error code table.
```

# Example:

```c
I16 ret;
I32 cmd = 0;
ret = _8144_get_command(AxisNo, &cmd);
if( ret == ERR_NoError )
{
    //...do something
}
```

# See also:

```txt
_8144_enable_get_command
_8144_set_command
_8144_get_remaining_pulse
```

# \_8144\_set\_command

# Description:

This function is used to set command position of an axis when “get command” function has been enabled.

# Syntax:

```txt
I16 _8144_set_command( I16 AxisNo, I32 Cmd );
B_8144_set_command( ByVal AxisNo As Integer,
    ByVal Cmd As Long ) As Integer
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.

I32 Cmd: set command position.

# Return Values:

I16 Error code. Refer to error code table.

# Example:

```txt
I16 ret;
I32 cmd = 0;
ret = _8144_set_command(AxisNo, cmd);
if( ret == ERR_NoError )
{
    //...
}
```

# See also:

```txt
_8144_enable_get_command
_8144_get_command
```

# \_8144\_set\_external\_start

Set inhibit start by STA input signal

# Description:

By this function, the operation start can be inhibited. When a motion command is issued, the axis will remain stopped. Then, when the STA input signal is active, the inhibit is released, and the axis will start move. Disable this function, the axis will start immediately. Notice that, all axes use only one STA input signal.

# Syntax:

```txt
I16 _8144_set_external_start( I16 AxisNo, I16 Enable )
B_8144_set_external_start( ByVal AxisNo As Integer, ByVal Enable As Integer )As Integer
```

# Parameters:

I16 AxisNo: The axis number is designated to receive the command.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

# I16 Enable:

▷ 0: disable (start move immediately)
▷ 1: enable(start move by STA input signal)

Return Values:
```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

Example:
```c
I16 AxisNo = 0;
I16 Enable = 1; //Enable STA start
_8144_set_external_start(AxisNo, Enable); //Enable STA start
_8144_start_sr_move( AxisNo, Distance, StrVel, MaxVel, Tacc );
// motion will not start until STA signal active...
Enable = 0; //Disable STA start
_8144_set_external_start(AxisNo, Enable); //Dsiable STA start
```

See also:
```txt
_8144_tv_move
_8144_sv_move
_8144_start_tr_move
_8144_start_sr_move
```

# \_8144\_emg\_stop

Immediately stop

# Description:

This function is used to immediately stop an axis.

# Syntax:

```txt
I16 _8144_emg_stop( I16 AxisNo )
B_8144_emg_stop( ByVal AxisNo As Integer) As Integer
Integer
```

# Parameters:

I16 AxisNo: The axis number is designated to receive the command.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

# Example:

```txt
ret = _8144_tv_move( AxisNo, StrVel, MaxVel, Tacc ); //perform a tv move.
...
ret = _8144_emg_stop( AxisNo ); //immediately stop
```

# See also:

\_8144\_dec\_stop

# \_8144\_dec\_stop

Decelerate to stop

# Description:

This function is used to decelerate an axis to stop with a trapezoidal or S-curve profile. This function is also useful when a preset move (start\_tr\_move, start\_sr\_move) is performed. Note: The velocity profile is decided by original motion profile.

# Syntax:

```txt
I16 _8144_dec_stop( I16 AxisNo )
B_8144_dec_stop( ByVal AxisNo As Integer )As Integer
Integer
```

# Parameters:

I16 AxisNo: The axis number is designated to receive the command.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

# Example:

```txt
ret = _8144_tv_move(AxisNo, StrVel, MaxVel, Tacc); //perform a tv move.
```

```txt
...
ret = _8144_dec_stop( AxisNo ); //slow down to
the start velocity then stop
```

# See also:

```txt
_8144_emg_stop
```

# \_8144\_speed\_up

# Description:

This function is used to re-accelerate an axis to maximum velocity with a trapezoidal or S-curve profile. This function is also useful when a preset move (start\_tr\_move, start\_sr\_move) is performed. Note: The velocity profile is decided by original motion profile.

![| T       | V        |\n| ------- | -------- |\n| Slow-down | 8144     |\n| Speed-up | 8144     |](.pci-8144-50-11144-1010-201/5b205a1ae22728eb31a13562294abb17e5bd584eb0a7edf42953a6e347be62b9.jpg)

# Syntax:

```txt
I16 _8144_speed_up( I16 AxisNo )
B_8144_speed_up( ByVal AxisNo As Integer ) As Integer
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.

# Return Values:

I16 Error code. Refer to error code table.

# Example:

```txt
I16 ret; //Return code
// perform a move function. Eg. _8144_tv_move()
_8144_slow_down( AxisNumber ); //Deceleration to start velocity.
//...
ret = _8144_speed_up( AxisNumber ); //Re-acceleration to max. velocity
...
```

# See also:

```cmake
_8144_slow_down()
```

# \_8144\_slow\_down

Slow down to start velocity

# Description:

This function is used to decelerate an axis with a trapezoidal or S-curve profile. This function is also useful when a preset move (start\_tr\_move, start\_sr\_move) is performed. Note: The velocity profile is decided by original motion profile.

# Syntax:

I16 \_8144\_slow\_down( I16 AxisNo )

B\_8144\_slow\_down(ByVal AxisNo As Integer) As Integer

# Parameters:

I16 AxisNo: The axis number is designated to receive the command.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

# Return Values:

ERR\_ParametersInvalid

ERR\_DeviceNotInitial

ERR\_NoError

# Example:

ret = \_8144\_tv\_move(AxisNo, StrVel, MaxVel, Tacc); //perform a tv move.

```txt
...
ret = _8144_ slow_down (AxisNo); //slow down to the start velocity
...
_8144_tv_move( AxisNo, StrVel, MaxVel, Tacc ); // acceleration to previous maximum velocity on the fly
```

# See also:

# \_8144\_enable\_org\_stop

Enable the stop when org signal is active

# Description:

By this function, the user can enable/disable the ORG stop function. When this function is enable, the axis will stop instantly when ORG signal is turn ON. With those motion functions, user can perform a homing return move.

Regardless of whether or not ORG stop is enable or disable. The user can monitor the ORG input signal's status by “\_8144\_get\_mio\_status” function, and set the sensitivity of ORG input signal by “\_8144\_set\_mio\_sensitivity”.

# Syntax:

I16 \_8144\_enable\_org\_stop( I16 AxisNo, I16 Enable )

B\_8144\_enable\_org\_stop( ByVal AxisNo As Integer, ByVal Enable As Integer )As Integer

# Parameters:

I16 AxisNo: The axis number is designated to receive the command.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td>0</td><td>0</td><td>0</td></tr><tr><td></td><td>1</td><td>1</td></tr><tr><td></td><td>2</td><td>2</td></tr><tr><td></td><td>3</td><td>3</td></tr><tr><td>1</td><td>0</td><td>4</td></tr><tr><td></td><td>1</td><td>5</td></tr><tr><td></td><td>2</td><td>6</td></tr><tr><td></td><td>3</td><td>7</td></tr><tr><td>2</td><td>0</td><td>8</td></tr><tr><td></td><td>...</td><td>...</td></tr></table>

# I16 Enable:

▷ 0: Disable: the axis will not stop when ORG signal is active
▷ 1: Enable: the axis will stop when ORG signal is active

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

# Example:

```c
I16 AxisNo = 0; // axis number
I16 Enable = 1; //Enable ORG stop
ret = _8144_enable_org_stop(AxisNo, Enable); // set ORG stop enable
ret = _8144_sv_move( AxisNo, StrVel, MaxVel, Tacc ); //perform a sv_move
...//monitor ORG signal or check motion done or using interrupt function...
Enable = 0; //Disable ORG stop
ret = _8144_enable_org_stop(AxisNo, Enable); // set ORG stop disable
```

# See also:

```txt
_8144_get_mio_status
_8144_set_mio_sensitivity
_8144_wait_single_motion_interrupt
```

# \_8144\_enable\_sd\_signal

Enable the slow down when SD signal is active

# Description:

When this function is enable, and if an SD signal of the same polarity as the motor rotation is turn ON, the motor will start decelerating. If the SD signal goes OFF, the motor will accelerate again.

Regardless of whether or not this function is enable or disable. The user can monitor the SD input signal's status by “\_8144\_get\_mio\_status” function.

This is used to reduce mechanical shock when stopping in home move or when using EL signal.

# Syntax:

```c
I16 _8144_enable_sd_signal( I16 AxisNo, I16 Enable )
B_8144_enable_sd_signal( ByVal AxisNo As Integer, ByVal Enable As Integer ) As Integer
```

# Parameters:

I16 AxisNo: The axis number is designated to receive the command.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

# I16 Enable:

▷ 0: Disable: the axis will not slow down when SD signal is active
▷ 1: Enable: the axis will slow down when SD signal is active

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

# Example:

```txt
I16 ret; // return code
I16 AxisNo = 0; // axis number
I16 Enable = 1; // Enable slow down by SD signal
ret = _8144_enable_sd_signal(AxisNo, Enable); // set command
...//move functions
```

# See also:

```txt
_8144_get_mio_status
```

# \_8144\_home\_move

# Description:

This function is used to perform a software based home return operation. The homing status can be checked by the “\_8144\_home\_status” function.

# Syntax:

```txt
I16 _8144_home_move( I16 AxisNo, F64 StrVel, F64 MaxVel, F64 Tacc, I16 AccType );
B_8144_home_move( ByVal AxisNo As Integer, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal Tacc As Double, ByVal AccType As Integer );
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.

F64 StrVel: Start homing velocity. Unit: pulse/second.

F64 MaxVel: Maximum homing velocity. Unit: pulse/second.

F64 Tacc: Acceleration time. Unit: second.

I16 AccType: Curve type of acceleration.

0: T-curve

1: S-curve

# Return Values:

# Example:

```rust
F64 StrVel = 100;
F64 MaxVel = 100000;
F64 Tacc = 0.1;
I16 AccType = 0;
I16 ret = _8144_home_move(AxisNo, StrVel, MaxVel, Tacc, AccType);
//...
I16 HomeStatusInBit;
_8144_home_status(AxisNo, &HomeStatusInBit);
// check home status.
```

# See also:

\_8144\_home\_status

# \_8144\_home\_status

# Description:

This function is used to get homing status. When the axis is in homing operation, the “In homing operation” signal (Bit 0) will turned on. When it stopped, “In homing operation” signal (Bit 0) will turned off. If the axis is stopped by error, the “Abnormal stop” (Bit 2) signal will be turned on. Otherwise, “Normal stop” (Bit 1) signal will be turned on.

# Syntax:

```c
I16 _8144_home_status( I16 AxisNo, I16
*HomeStatusInBit );
B_8144_home_status( ByVal AxisNo As Integer,
HomeStatusInBit As Integer ) As Integer
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.

I16 \*HomeStatusInBit: Status of homing operation.

```txt
Bit 0: In homing operation.
Bit 1: Normal stop.
Bit 2: Abnormal stop.
Bit 3-15: Reserved.
```

# Return Values:

Example:
```c
// initialize
// Perform a home return move.
_8144_home_move(AxisNo, StrVel, MaxVel, Tacc, AccType);
//...
I16 HomeStatusInBit;
_8144_home_status(AxisNo, &HomeStatusInBit);
if( HomeStatusInBit & 2 ) //Check home move status.
{
    //Home move is done.
}
```

See also:
```txt
_8144_home_move
```

![Based on the provided image, here is the description of the flowchart/block diagram:\n\n**Labeled Blocks:**\n*   Max. velocity\n*   Start velocity\n*   Start homing\n*   Start homing(Stopped)\n\n**Connections:**\n*   **Top Section:** Two dotted lines extend horizontally to the right from the top and bottom flat edges of the uppermost trapezoidal shape. The upper line points to 'Max. velocity' and the lower line points to 'Start velocity'. A solid black arrow points downward from the right vertical edge of this trapezoid.\n*   **Middle Section:** A dotted arrow extends from the text 'Start homing' pointing left/down to a black dot on the left edge of the large geometric shape below. To the right, a dotted arrow extends from the text 'Start homing(Stopped)' pointing left to a black dot located in the central green vertical strip.\n*   **Lower Section:**\n    *   A solid arrow points downward from the left vertical edge of the trapezoid immediately below the middle section.\n    *   A solid arrow points downward from the left vertical edge of the large trapezoidal shape below that.\n    *   A solid arrow points downward from the right vertical edge of the bottom-most trapezoidal shape.](.pci-8144-50-11144-1010-201/c1dda3e0e4d26c88c24e18f992081875e8ae217d351ce233e2d21692be70226a.jpg)

![A pale yellow square with a black border is centered on a white background.](.pci-8144-50-11144-1010-201/efc7aa205b2ac10aa47ff5fcd4c65c273022863e123bf6cdce2ab61e93792f92.jpg)

SD signal

![A light green square with a black border.](.pci-8144-50-11144-1010-201/740eeeb9621e8b7d5b6621bc2f80a4a0d0feb2a794b89ebd37e5d12a273b32b2.jpg)

ORG signal

![The image displays a light pink rectangle with a thin, dark border. It is set against a white background. Faint black lines are visible to the left and below the rectangle, forming part of a grid-like structure. There is no text in the image.](.pci-8144-50-11144-1010-201/b72585d7183c407a5d2c20e9b099e0233b591e63472d0edbdc2e65be3bcd1adc.jpg)

EL signal

# 6.6 Motion status

# \_8144\_motion\_done

Get the motion command to stop or not

# Description:

By this function, the user can monitor operation status.

# Syntax:

```txt
I16 _8144_motion_done( I16 AxisNo, I16 *OperatingOrStop )
B_8144_motion_done( ByVal AxisNo As Integer, OperatingOrStop As Integer) As Integer
```

# Parameters:

I16 AxisNo: The axis number is designated to receive the command.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

I16 \*OperatingOrStop: The information of whether the axis is operating or stopped.

▷ 0: Stopped(not output pulse)
▷ 1: Operating(output pulse)

# Return Values:

ERR\_ParametersInvalid

```txt
ERR_DeviceNotInitial
ERR_NoError
```

Example:
```txt
I16 OperatingOrStop = 0;
ret = _8144_start_sr_move( AxisNo, Distance, StrVel, MaxVel, Tacc );
while( (!ret) && (!OperatingOrStop)) {
    ret = _8144_motion_done(AxisNo, &OperatingOrStop); // check motion done
}...
```

See also:
```txt
_8144_motion_status
```

# \_8144\_motion\_status

Get motion status

# Description:

Return the motion status of the 8144. The information of motion status is in bit format.

The meaning of bit[0] of parameter "MotionStatusInBit" is the same as "\_8144\_motion\_done"

# Syntax:

```c
I16 _8144_motion_status( I16 AxisNo, I16 *MotionStatusInBit )
B_8144_motion_status( ByVal AxisNo As Integer, MotionStatusInBit As Integer ) As Integer
```

# Parameters:

I16 AxisNo: The axis number is designated to receive the command.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

# I16 \*MotionStatusInBit:

▷ bit[0]: operation status. 0: stop, 1: operation
▷ bit[1]: preset counter. 0: remaining pulse (preset counter) is not zero, 1: is zero
bit[2]: 0: remaining pulse > R5, 1: preset counter &lt;= R5
▷ bit[3]: 0: Not accelerating, 1: accelerating
▷ bit[4]: 0: Not decelerating, 1: decelerating
▷ Else bits: reserved

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

# Example:

```txt
I16 MotionStatusInBit;
I16 ret = _8144_motion_status(AxisNo, &MotionStatusInBit);
If((MotionStatus &gt;> 3) & 0x1)
{...//monitor acceleration status}
```

# See also:

```txt
_8144_motion_done
```

# 6.7 Interrupt

# \_8144\_set\_motion\_interrupt\_factor

Set factors of motion related interrupts

# Description:

This function allows users to enable or disable interrupt output when the motor is stopped in start\_r\_move or when it is stopped using EL, STP and ORG signals or software stop command. Once the Interrupt function is enabled, you can use \_8144\_wait\_single\_motion\_interruptt() to wait event. Disable the motion interrupt by set the factor to 0. Notice that, this function will valid on next motion command.

# Syntax:

```txt
I16 _8144_set_motion_interrupt_factor( I16 AxisNo, I16 MotionIntFactorInBit )
B_8144_set_motion_interrupt_factor( ByVal AxisNo As Integer, ByVal MotionIntFactorInBit As Integer ) As Integer
```

# Parameters:

I16 AxisNo: The axis number is designated to receive the command.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

# I16 MotionIntFactorInBit: factor of INT

▷ 0: disable INT
▷ 1: Enable output INT when motion stop

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_InterruptNotEnable
ERR_TimeOut
ERR_Win32Error
ERR_NoError
```

# Example:

```txt
I32 TimeOutMs = 10000; //time out in milisecound
I16 MotionIntFactorBitNum = 0; //bit number = the first bit=0
I16 MotionIntFactorInBit = 0x1; //enable motion interrupt
ret = _8144_set_motion_interrupt_factor( AxisNo, MotionIntFactorInBit );
//...start a move function...
ret = _8144_wait_single_motion_interrupt( AxisNo, MotionIntFactorBitNum, TimeOutMs );
if( ret == ERR_NoError ){ //Interrupt occurred! }
I16 MotionIntFactorInBit = 0; //disable
ret = _8144_set_motion_interrupt_factor( AxisNo, MotionIntFactorInBit ); //disable motion interrupt
```

# See also:

```txt
_8144_wait_single_motion_interrupt
_8144_motion_status
```

# \_8144\_wait\_single\_motion\_interrupt

Wait a single motion related interrupt

# Description:

When user enabled the Interrupt function by \_8144\_set\_motion\_int\_factor(). User could use this function to wait the specific interrupt. When this function was running, the process would never stop until evens were triggered or the function was time out. This function returns when one of the following occurs:

1. The specified MotionIntFactorInBit is in the signaled state.
2. The TimeOutMs interval elapses.

This function checks the current state of the Motion interrupt. If the state is nonsignaled, the calling thread enters the wait state. It uses no processor time while waiting for the INT state to become signaled or the time-out interval to elapse.

# Syntax:

```txt
I16 _8144_wait_single_motion_interrupt( I16 AxisNo, I16 MotionIntFactorBitNum, I32 TimeOutMs )
B_8144_wait_single_motion_interrupt( ByVal AxisNo As Integer, ByVal MotionIntFactorBitNum As Integer, ByVal TimeOutMs As Long )As Integer
```

# Parameters:

I16 AxisNo: The axis number is designated to receive the command.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

I16 MotionIntFactorBitNum: Specifies the bit number of the INT factor.

Eg. Stop INT : MotionIntFactorBitNum = 0;

I32 TimeOutMs: Specifies the time-out interval, in milliseconds.

If TimeOut\_ms is zero, the function tests the states of the specified objects and returns immediately. If TimeOut\_ms is -1, the function's time-out interval never elapses (infinite).

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_InterruptNotEnable
ERR_TimeOut
ERR_Win32Error
ERR_NoError
```

# Example:

```rust
I32 TimeOutMs = 10000; //time out in milisecound
I16 MotionIntFactorBitNum = 0; //bit number = the first bit=0
I16 MotionIntFactorInBit = 0x1; //enable motion interrupt
ret = _8144_set_motion_interrupt_factor( AxisNo, MotionIntFactorInBit );
//...start a move function...
ret = _8144_wait_single_motion_interrupt( AxisNo, MotionIntFactorBitNum, TimeOutMs );
if( ret == ERR_NoError ){ //Interrupt occurred! }
I16 MotionIntFactorInBit = 0; //disable
```

```c
ret = _8144_set_motion_interrupt_factor(AxisNo, MotionIntFactorInBit); // disable motion interrupt
```

# See also:

```txt
_8144_set_motion_interrupt_factor
```

# \_8144\_set\_gpio\_interrupt\_factor

Set factors of digital input interrupt

# Description:

This function allows users to select GPIO related factors to initiate the event int. Once the Interrupt function is enabled, you can use \_8144\_wait\_single\_gpio\_interrupt or \_8144\_wait\_multiple\_gpio\_interrupt to wait event. To disable the GPIO interrupt function set the GPIO interrupt factor to 0.

# Syntax:

```c
I16 _8144_set_gpio_interrupt_factor( I16 CardId, I32 GpioIntFactorInBit )
B_8144_set_gpio_interrupt_factor( ByVal CardId As Integer, ByVal GpioIntFactorInBit As Long )As Integer
```

# Parameters:

I16 CardId: The card ID number.

I32 GpioIntFactorInBit: The GPIO interrupt factor in bit format

▷ Bit0 - bit7 : DI0 - DI7 Falling edge
▷ Bit8 - bit15: DI0 - DI7 Rising edge

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

# Example:

```c
I32 factorInBits = 0x01; //Wait DI Ch0 falling edge
ret = _8144_set_gpio_interrupt_factor( CardId, factorInBits );

// wait single GPIO interrupt...
I32 TimeOutMs = 10000; //10 sec timeout
```

```c
I16 GpioIntFactorBitNum = 0; // wait INT factor bit number 0
ret = _8144_wait_single_gpio_interrupt( CardId, GpioIntFactorBitNum, TimeOutMs );
if( ret == ERR_NoError ) {
    // Interrupt be triggered
} else {
    //Timeout or wait failed
}
_8144_set_gpio_interrupt_factor( gCardId, 0 ); // Disable GPIO interrupt
```

# See also:

```txt
_8144_wait_single_gpio_interrupt,
_8144_wait_multiple_gpio_interrupt
```

# \_8144\_wait\_single\_gpio\_interrupt

Wait a single digital input interrupt

# Description:

When the user enabled the Interrupt function and set the interrupt factors by \_8144\_set\_gpio\_int\_factor(). The user could use this function to wait a specific interrupt. When this function was running, the process would never stop until evens were triggered or the function was time out. This function returns when one of the following occurs:

1. The specified GPIO interrupt factor is in the signaled state.
2. The TimeOutMs interval elapses.

This function checks the current state of the GPIO interrupt. If the state is nonsignaled, the calling thread enters the wait state. It uses no processor time while waiting for the INT state to become signaled or the time-out interval to elapse.

# Syntax:

```python
I16 _8144_wait_single_gpio_interrupt( I16 CardId,
    I16 GpioIntFactorBitNum, I32 TimeOutMs )
B_8144_wait_single_gpio_interrupt(ByVal CardId As
    Integer, ByVal GpioIntFactorBitNum As
    Integer, ByVal TimeOutMs As Long ) As
    Integer
```

# Parameters:

I16 CardId: Specify the index of target PCI-8144 card. The card\_id could be decided by DIP switch (SW1) or depend on slot sequence.Please refer to “\_8144\_initial”.
I16 GpioIntFactorBitNum: Specifies the bit number of the INT factor

Eg. GpioIntFactorBitNum = 10, wait DI\_2 rising edge INT factor

I32 TimeOutMs: Specifies the time-out interval, in milliseconds.

If TimeOut\_ms is zero, the function tests the states of the specified objects and returns immediately. If TimeOut\_ms is -1, the function's time-out interval never elapses (infinite).

Return Values:
```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_ParametersInvalid
ERR_InterruptNotEnable
ERR_TimeOut
ERR_Win32Error
ERR_NoError
```

Example:
```c
I32 factorInBits = 0x01; //Wait DI Ch0 falling edge
ret = _8144_set_gpio_interrupt_factor( CardId, factorInBits );

// wait single GPIO interrupt...
I32 TimeOutMs = 10000; //10 sec timeout
I16 GpioIntFactorBitNum = 0; //wait INT factor bit number 0
ret = _8144_wait_single_gpio_interrupt( CardId, GpioIntFactorBitNum, TimeOutMs );
if( ret == ERR_NoError ) {
    // Interrupt be triggered
} else {
    //Timeout or wait failed
}
_8144_set_gpio_interrupt_factor( gCardId, 0 ); // Disable GPIO interrupt
```

See also:
```txt
_8144_wait_multiple_gpio_interrupt
_8144_set_gpio_interrupt_factor
```

# \_8144\_wait\_multiple\_gpio\_interrupt

Wait multiple digital input interrupts

# Description:

When the user enabled the Interrupt function and set the interrupt factors by \_8144\_set\_gpio\_int\_factor(). The user could use this function to wait multiple specifid interrupts. When this function was running, the process would never stop until evens were triggered or the function was time out. This function returns when one of the following occurs:

1. Either any one or all of the specified GPIO interrupts are in the signaled state.
2. The TimeOutMs interval elapses.

This function checks the current state of the GPIO interrupt. If the state is nonsignaled, the calling thread enters the wait state. It uses no processor time while waiting for the INT state to become signaled or the time-out interval to elapse.

# Syntax:

```csv
I16 _8144_wait_multiple_gpio_interrupt( I16 CardId, I32 GpioIntFactorInBits, I16 WaitOption, I32 TimeOutMs, I32 *GpioIntTriggeredInBits )
B_8144_wait_multiple_gpio_interrupt( ByVal CardId As Integer, ByVal GpioIntFactorInBits As Long, ByVal WaitOption As Integer, ByVal TimeOutMs As Long, GpioIntTriggeredInBits As Long )As Integer
```

# Parameters:

I16 CardId: Specify the index of target PCI-8144 card. The card\_id could be decided by DIP switch (SW1) or depend on slot sequence.Please refer to “\_8144\_initial”.

I32 GpioIntFactorInBits:

I16 WaitOption: Specifies the wait option. If WaitOption = 1, the function returns when the state all interrupt factors you specified in GpioIntFactorInBits is signaled. If WaitOption = 0, the function returns when the state of any one of the interrupt factors you specified in GpioIntFactorInBits is signaled. In the latter case, you can check which factors whose state caused the function to return by compare the parameter "GpioIntTriggeredInBits".

I32 TimeOutMs: Specifies the time-out interval, in milliseconds.
I32 \*GpioIntTriggeredInBits: Information of interrupt state in bit format.

The value of each bit means: 0: not triggered, 1: be triggered

# Return Values:

```txt
ERR_NoError
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_InsufficientMemory
ERR_InterruptNotEnable
ERR_Win32Error
```

# Example:

```c
I32 GpioIntFactorInBits = 0x101; //Wait DI Ch0
    falling edge and rising edge
ret = _8144_set_gpio_interrupt_factor( CardId,
    GpioIntFactorInBits);

// wait multiple GPIO interrupts...
I32 TimeOutMs = 10000; //10 sec timeout
I16 WaitOption = 1; //wait all interrupts occurred
I32 GpioIntTriggeredInBits;
ret = _8144_wait_multiple_gpio_interrupt(
    gCardId, GpioIntFactorInBits, WaitOption,
    TimeOutMs, &GpioIntTriggeredInBits );
if( ret == ERR_NoError ){
    // Interrupt be triggered
} else {
    //Timeout or wait failed
}
_8144_set_gpio_interrupt_factor( gCardId, 0 ); // Disable GPIO interrupt
```

# See also:

\_8144\_wait\_single\_gpio\_interrupt

\_8144\_set\_gpio\_interrupt\_factor

# 6.8 General purpose input/output

# \_8144\_get\_gpio\_input

Get all DIN digital input signals

# Description:

PCI-8144 has 8 digital input channels. By this function, the user can get the digital input status.

# Syntax:

```c
I16 _8144_get_gpio_input( I16 CardId, I16 *DiStatusInBit )
B_8144_get_gpio_input( ByVal CardId As Integer, DiStatusInBit As Integer )As Integer
```

# Parameters:

I16 CardId: Specify the PCI-8144 card index. The CardId could be decided by DIP switch (SW1) or depend on slot sequence.Please refer to \_8144\_initial()

I16 \*DiStatusInBit: Digital input status, Bit0-7: Digital Input CH0-7.

▷ Meaning of each bit: 1:ON, 0:OFF

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

# Example:

```txt
I16 CardId = 0;
I16 DiStatusInBit;
ret = _8144_get_gpio_input( CardId, &DiStatusInBit );
if( ret == ERR_NoError) // compar DiStatusInBit...
```

# See also:

```txt
_8144_get_gpio_input_channel
```

# \_8144\_get\_gpio\_input\_channel

Get a specified DINn digital input signal

# Description:

PCI-8144 has 8 digital input channels. By this function, the user can get a specified DINn digital input signal.

# Syntax:

```txt
I16 _8144_get_gpio_input_channel( I16 CardId, I16 ChannelNum, I16 *DiStatus )
B_8144_get_gpio_input_channel( ByVal CardId As Integer, ByVal ChannelNum As Integer, DiStatus As Integer ) As Integer
```

# Parameters:

I16 CardId: Specify the PCI-8144 card index. The CardId could be decided by DIP switch (SW1) or depend on slot sequence.Please refer to \_8144\_initial()

I16 ChannelNum: Specified the channel number that you want to get the status

▷ Value meaning: 0-7 => ch0-ch7

I16 \*DiStatus: 1: ON, 0: OFF

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

# Example:

```c
I16 CardId = 0; // Card ID number
I16 ChannelNum = 3; // DI channel 3
I16 DiStatus;
ret = _8144_get_gpio_input_channel (CardId, ChannelNum, &DiStatus);
if( ret == ERR_NoError)
{ // if( DiStatus == 1) ... }
```

# See also:

```txt
_8144_get_gpio_input
```

# \_8144\_set\_gpio\_output

Set all DOUT digital output signal

# Description:

The PCI-8144 has 8 digital output channels. By this function, the user could control all digital outputs.

# Syntax:

```txt
I16 _8144_set_gpio_output( I16 CardId, I16 DoValueInBit )
B_8144_set_gpio_output( ByVal CardId As Integer, ByVal DoValueInBit As Integer) As Integer
```

# Parameters:

I16 CardId: Specify the PCI-8144 card index. The CardId could be decided by DIP switch (SW1) or depend on slot sequence.Please refer to \_8144\_initial()

I16 DoValueInBit: bit0 - bit7 => DO CH0-7

The meaning of each bit: 0:OFF, 1:ON

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

# Example:

```c
I16 CardId = 0; //Card ID number
I16 DoValueInBit = 0xFF; //turn ON all DO channel
ret = _8144_set_gpio_output(CardId, DoValueInBit);
...
```

# See also:

```txt
_8144_set_gpio_output_channel
_8144_get_gpio_output
_8144_get_gpio_output_channel
```

# \_8144\_set\_gpio\_output\_channel

Set a specified DOUTn digital output signal

# Description:

The PCI-8144 has 8 digital output channels. By this function, the user could control a specified digital output.

# Syntax:

```txt
I16 _8144_set_gpio_output_channel( I16 CardId, I16 ChannelNum, I16 DoValue )
B_8144_set_gpio_output_channel( ByVal CardId As Integer, ByVal ChannelNum As Integer, ByVal DoValue As Integer )As Integer
```

# Parameters:

I16 CardId: Specify the PCI-8144 card index. The CardId could be decided by DIP switch (SW1) or depend on slot sequence.Please refer to \_8144\_initial()

I16 ChannelNum: Specified the channel number that you want to control

▷ Value meaning: 0-7 => ch0-ch7

I16 DoValue: 0:OFF, 1: ON

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

# Example:

```c
I16 CardId = 0; // Card ID number
I16 ChannelNum = 0; //DO channel 0
I16 DoValue = 1; //ON
ret = _8144_set_gpio_output_channel( I16 CardId,
    I16 ChannelNum, I16 DoValue ); ...
```

# See also:

```txt
_8144_set_gpio_output
_8144_get_gpio_output
_8144_get_gpio_output_channel
```

# \_8144\_get\_gpio\_output

Get all DOUT digital output signal

# Description:

Get all DOUT digital output signal.

# Syntax:

```c
I16 _8144_get_gpio_output( I16 CardId, I16 *DoValueInBit )
B_8144_get_gpio_output( ByVal CardId As Integer, DoValueInBit As Integer) As Integer
```

# Parameters:

I16 CardId: Specify the PCI-8144 card index. The CardId could be decided by DIP switch (SW1) or depend on slot sequence.Please refer to \_8144\_initial().

I16 \*DoValueInBit: The information of DO signals, bit0 - bit7 => DO CH0-7

The meaning of each bit: 0:OFF, 1:ON

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

# Example:

```c
I16 CardId = 0; //Card ID number
I16 DoValueInBit;
ret = _8144_get_gpio_output(CardId, &DoValueInBit);
if( ret == ERR_NoError )
{ // compare DoValueInBIt... }
```

# See also:

```txt
_8144_set_gpio_output
_8144_set_gpio_output_channel
_8144_get_gpio_output_channel
```

# \_8144\_get\_gpio\_output\_channel

Get a specified DOUTn digital output signal

# Description:

# Syntax:

```txt
I16 _8144_get_gpio_output_channel( I16 CardId,
    I16 ChannelNum, I16 *DoValue )
B_8144_get_gpio_output_channel( ByVal CardId As
    Integer, ByVal ChannelNum As Integer,
    DoValue As Integer ) As Integer
```

# Parameters:

I16 CardId: Specify the PCI-8144 card index. The CardId could be decided by DIP switch (SW1) or depend on slot sequence.Please refer to \_8144\_initial().
I16 ChannelNum: Specified the channel number of digital output.

▷ CH0-CH7 : 0-7

I16 \*DoValue: The information of the specified DO signal.

▷ Value meaning: 0:OFF, 1:ON

# Return Values:

```txt
ERR_ParametersInvalid
ERR_DeviceNotInitial
ERR_NoError
```

# Example:

```txt
I16 CardId = 0; //Card ID number
I16 ChannelNum = 0; //DO ch0
I16 DoValue; //Do information
ret = _8144_get_gpio_output_channel( CardId, ChannelNum, &DoValue );
...
```

# See also:

```txt
_8144_set_gpio_output
_8144_set_gpio_output_channel
_8144_get_gpio_output
```

# 6.9 Speed profile calculation

# \_8144\_get\_tv\_move\_profile

Get tv\_move speed profile

# Description:

This function is used to get the tv\_move speed profiles. By this function, user can get the actual speed profile before running.

This function has warning return code. please refer to \_8144\_tv\_move function.

# Syntax:

```txt
I16 _8144_get_tv_move_profile( I16 AxisNo, F64 StrVel, F64 MaxVel, F64 Tacc, F64 *StrVelP, F64 *MaxVelP, F64 *TaccP, F64 *MagnP )
B_8144_get_tv_move_profile( ByVal AxisNo As Integer, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal Tacc As Double, StrVelP As Double, MaxVelP As Double, TaccP As Double, MagnP As Double ) As Integer
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

F64 StrVel: Start velocity (pulse/sec)

F64 MaxVel: Maximum velocity (pulese/sec)

F64 Tacc: Acceleration time (sec)

F64 \*StrVelP: The information of calculated start velocity (pulse/sec)

F64 \*MaxVelP: The information of maximum velocity (pulse/sec)

F64 \*TaccP: The information of acceleration time (sec)

F64 \*MagnP: Set to 0

# Return Values:

```ignorefile
ERR_ParametersInvalid
WAR_AccDecTimeToSmall
WAR_AccDecTimeToLarge
ERR_NoError
```

# Example:

```rust
I16 ret; //return code
I16 AxisNo = 0; //axis number
F64 StrVel = 100.0; //start velocity (pps)
F64 MaxVel = 50000.0; //maximum velocity (pps)
F64 Tacc = 0.5; // acceleration time (sec)
F64 *StrVelP, MaxVelP, TaccP; //The speed profile informations
ret = _8144_get_tv_move_profile(AxisNo, StrVel, MaxVel, Tacc, &StrVelP, &MaxVelP, &TaccP, 0);
```

# See also:

```cmake
_8144_tv_move()
_8144_get_sv_move_profile()
```

# \_8144\_get\_sv\_move\_profile

Get sv\_move speed profile

# Description:

This function is used to get the sv\_move speed profiles. By this function, user can get the actual speed profile before running.

This function has warning return code. please refer to \_8144\_tv\_move function.

# Syntax:

```csv
I16 _8144_get_sv_move_profile( I16 AxisNo, F64 StrVel, F64 MaxVel, F64 Tacc, F64 *StrVelP, F64 *MaxVelP, F64 *TaccP, F64 *MagnP )
B_8144_get_sv_move_profile( ByVal AxisNo As Integer, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal Tacc As Double, StrVelP As Double, MaxVelP As Double, TaccP As Double, MagnP As Double ) As Integer
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

F64 StrVel: Start velocity (pulse/sec)

F64 MaxVel: Maximum velocity (pulese/sec)

F64 Tacc: Acceleration time (sec)

F64 \*StrVelP: The information of calculated start velocity (pulse/sec)

F64 \*MaxVelP: The information of maximum velocity (pulse/sec)

F64 \*TaccP: The information of acceleration time (sec)

F64 \*MagnP: Set to 0

# Return Values:

```txt
EERR_ParametersInvalid
WAR_AccDecTimeToSmall
WAR_AccDecTimeToLarge
ERR_NoError
```

# Example:

```rust
I16 ret; //return code
I16 AxisNo = 0; //axis number
F64 StrVel = 100.0; //start velocity (pps)
F64 MaxVel = 50000.0; //maximum velocity (pps)
F64 Tacc = 0.5; // acceleration time (sec)
F64 *StrVelP, MaxVelP, TaccP; //The speed profile informations
ret = _8144_get_sv_move_profile(AxisNo, StrVel, MaxVel, Tacc, &StrVelP, &MaxVelP, &TaccP, 0);
```

# See also:

```cmake
_8144_sv_move()
_8144_get_tv_move_profile()
```

# \_8144\_get\_start\_tr\_move\_profile

Get start\_tr\_move speed profile

# Description:

This function is used to get the relative trapezoidal speed profiles. By this function, user can get the actual speed profile before running.

This function has warning return code. please refer to \_8144\_tv\_move function.

# Syntax:

```txt
I16 _8144_get_start_tr_move_profile( I16 AxisNo, F64 Distance, F64 StrVel, F64 MaxVel, F64 Tacc, F64 *StrVelP, F64 *MaxVelP, F64 *TaccP, F64 *TConstP, F64 *MagnP )
B_8144_get_start_tr_move_profile( ByVal AxisNo As Integer, ByVal Distance As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal Tacc As Double, StrVelP As Double, MaxVelP As Double, TaccP As Double, TconstP As Double, MagnP As Double ) As Integer
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

F64 Distance: Specified relative distance to move ( pulse)

F64 StrVel: Starting velocity (pulse/sec)
F64 MaxVel: Maximum velocity (pulse/sec)
F64 Tacc: Specified acceleration and deceleration time (sec)
F64 \*StrVelP: Actual start velocity (pulse/sec)
F64 \*MaxVelP: Actual Maximum velocity (pulse/sec)
F64 \*TaccP: Actual acceleration and deceleration time (sec)
F64 \*TconstP: constant speed time(maximum velocity)
F64 \*MagnP: Set to 0

# Return Values:

```txt
EERR_ParametersInvalid
WAR_AccDecTimeToSmall
WAR_AccDecTimeToLarge
ERR_NoError
```

# Example:

```txt
I16 ret; //return code
I16 AxisNo = 0; //axis number
F64 Distance =100000.0; //pulse number
F64 StrVel = 100.0; //start velocity (pps)
F64 MaxVel = 50000.0; //maximum velocity (pps)
F64 Tacc = 0.5; // acceleration time (sec)
F64 *StrVelP, MaxVelP, TaccP, TConstP; //The speed profile informations
ret = _8144_get_start_tr_move_profile(AxisNo, Distance, StrVel, MaxVel, Tacc, &StrVelP, &MaxVelP, &TaccP, &TConstP, 0);
...
```

# See also:

```txt
_8144_start_tr_move
_8144_get_start_sr_move_profile
```

# \_8144\_get\_start\_sr\_move\_profile

Get start\_sr\_move speed profile

# Description:

This function is used to get the relative S-curve speed profiles. By this function, user can get the actual speed profile before running.

This function has warning return code. please refer to \_8144\_sv\_move function.

# Syntax:

```txt
I16 _8144_get_start_sr_move_profile( I16 AxisNo, F64 Distance, F64 StrVel, F64 MaxVel, F64 Tacc, F64 *StrVelP, F64 *MaxVelP, F64 *TaccP, F64 *TConstP, F64 *MagnP )
B_8144_get_start_sr_move_profile( ByVal AxisNo As Integer, ByVal Distance As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal Tacc As Double, StrVelP As Double, MaxVelP As Double, TaccP As Double, TconstP As Double, MagnP As Double ) As Integer
```

# Parameters:

I16 AxisNo: Axis number of Target Axis.

<table><tr><td>Card ID</td><td>Physical axis</td><td>AxisNo</td></tr><tr><td rowspan="4">0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr><tr><td>3</td><td>3</td></tr><tr><td rowspan="4">1</td><td>0</td><td>4</td></tr><tr><td>1</td><td>5</td></tr><tr><td>2</td><td>6</td></tr><tr><td>3</td><td>7</td></tr><tr><td rowspan="2">2</td><td>0</td><td>8</td></tr><tr><td>...</td><td>...</td></tr></table>

F64 Distance: Specified relative distance to move ( pulse)

F64 StrVel: Starting velocity (pulse/sec)
F64 MaxVel: Maximum velocity (pulse/sec)
F64 Tacc: Specified acceleration and deceleration time (sec)
F64 \*StrVelP: Actual start velocity (pulse/sec)
F64 \*MaxVelP: Actual Maximum velocity (pulse/sec)
F64 \*TaccP: Actual acceleration and deceleration time (sec)
F64 \*TconstP: constant speed time(maximum velocity)
F64 \*MagnP: Set to 0

# Return Values:

```txt
EERR_ParametersInvalid
WAR_AccDecTimeToSmall
WAR_AccDecTimeToLarge
ERR_NoError
```

# Example:

```txt
I16 ret; //return code
I16 AxisNo = 0; //axis number
F64 Distance =100000.0; //pulse number
F64 StrVel = 100.0; //start velocity (pps)
F64 MaxVel = 50000.0; //maximum velocity (pps)
F64 Tacc = 0.5; // acceleration time (sec)
F64 *StrVelP, MaxVelP, TaccP, TConstP; //The speed profile informations
ret = _8144_get_start_sr_move_profile(AxisNo, Distance, StrVel, MaxVel, Tacc, &StrVelP, &MaxVelP, &TaccP, &TConstP, 0);
...
```

# See also:

```txt
_8144_start_sr_move
_8144_get_start_tr_move_profile
```

# 7 Function Return Code

The following table provides a list of possible return value in our library. If the return value is not zero, it means there are some error or warning occurred.

Error Code

<table><tr><td>Code</td><td>Define</td><td>Description</td></tr><tr><td>0</td><td>ERR_NoError</td><td>No Error, function success</td></tr><tr><td>-1</td><td>ERR_OSVersion</td><td>Operation System type mismatched</td></tr><tr><td>-2</td><td>ERR_OpenDriverFailed</td><td>Open device driver failed - Create driver interface failed</td></tr><tr><td>-3</td><td>ERR_InsufficientMemory</td><td>System memory insufficiently</td></tr><tr><td>-4</td><td>ERR_DeviceNotInitial</td><td>Cards not be initialized</td></tr><tr><td>-5</td><td>ERR_NoDeviceFound</td><td>Cards not found(No card in your system)</td></tr><tr><td>-6</td><td>ERR_CardIdDuplicate</td><td>Cards&#x27; ID Number duplicate</td></tr><tr><td>-7</td><td>ERR_DeviceAlreadyInitialed</td><td>Cards have been initialed</td></tr><tr><td>-8</td><td>ERR_InterruptNotEnable</td><td>Cards&#x27; interrupt events not enable</td></tr><tr><td>-9</td><td>ERR_TimeOut</td><td>Function time-out</td></tr><tr><td>-10</td><td>ERR_ParametersInvalid</td><td>Function input parameters are invalid</td></tr><tr><td>-11</td><td>ERR_SetEEPROM</td><td>Set data to EEPROM failed</td></tr><tr><td>-12</td><td>ERR_GetEEPROM</td><td>Get data from EEPROM failed</td></tr><tr><td>-1000~</td><td>ERR_Win32Error</td><td>Check Win32 ErrorCode define [win32 error code = -(code + ERR_Win32Error)]</td></tr></table>

Warning Code

<table><tr><td>Code</td><td>Define</td><td>Description</td></tr><tr><td>1</td><td>WAR_AccDecTimeTooLarge</td><td>Tacc/Tdec&#x27;s value is too large</td></tr><tr><td>2</td><td>WAR_AccDecTimeTooSmall</td><td>Tacc/Tdec&#x27;s value is too small</td></tr><tr><td>3</td><td>WAR_RampDownPointExceed</td><td>The ramping down value is bigger than it&#x27;s maximum value</td></tr></table>
[🔗 Link to the original document](.pci-8144-50-11144-1010-201/pci-8144-50-11144-1010-201.pdf)
