# EOS-1300 Series

# DI/O Function Library Reference

![COM1\nCOM2\nI/O 2\nSP\nSP\nSP\nAudio\nI/O 1\nADLINK\nPROFESSIONAL OCEMBER\nCH1\nCH2\nCH3\nCH4\nPWR\nStatus HDD\nV-\n+\nV+\n24V DC IN](.eos-1300-manual-en-20180110-v1/fbef3190266d7729c18275abe9efbfaa670a7ee6ee8e28d082cf6ac1b9a6421f.jpg)

Manual Rev.: 2.00

Revision Date: Mar. 16, 2017

Part No: 50-1Z225-2000

# Revision History

<table><tr><td>Revision</td><td>Release Date</td><td>Description of Change(s)</td></tr><tr><td>2.00</td><td>Mar. 16, 2017</td><td>Initial Release</td></tr><tr><td></td><td></td><td></td></tr></table>

# Preface

# Copyright 2017 ADLINK Technology, Inc.

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.

# Disclaimer

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.

# Environmental Responsibility

ADLINK is committed to fulfill its social responsibility to global environmental preservation through compliance with the European Union's Restriction of Hazardous Substances (RoHS) directive and Waste Electrical and Electronic Equipment (WEEE) directive. Environmental protection is a top priority for ADLINK. We have enforced measures to ensure that our products, manufacturing processes, components, and raw materials have as little impact on the environment as possible. When products are at their end of life, our customers are encouraged to dispose of them in accordance with the product disposal and/or recovery programs prescribed by their nation or company.

# Trademarks

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

# Conventions

Take note of the following conventions used throughout this manual to make sure that users perform certain tasks and instructions properly.

![This image displays a graphic of a white piece of paper with a folded top-right corner and faint horizontal blue lines. A large, bold red checkmark is superimposed over the center of the document.](.eos-1300-manual-en-20180110-v1/48ad356fac852bf37c8ed64cc02ac7e4003f13303b245f13d84b33f788743661.jpg)
NOTE:

Additional information, aids, and tips that help users perform tasks.

![A yellow triangular warning sign with a black border and a large black exclamation point in the center.](.eos-1300-manual-en-20180110-v1/b1275d87e6ba47d5eb2c0c1524b8fd61b209fa7a28ee641b6aa47e91c6f0a9e2.jpg)
CAUTION:

Information to prevent minor physical injury, component damage, data loss, and/or program corruption when trying to complete a task.

![The image displays a red triangular warning sign containing a large white exclamation point in its center. The triangle has a black border along its left and top edges, and a thin white border along its right edge. The background outside the sign is white.](.eos-1300-manual-en-20180110-v1/32220d8218650024295c2a50a0df24d39090f38acce0e3f33484a4f260bad6b9.jpg)
WARNING:

Information to prevent serious physical injury, component damage, data loss, and/or program corruption when trying to complete a specific task.

# Table of Contents

# Revision History...... ii

# Preface...... iii

# List of Tables...... vii

# List of Figures ix

# 1 Introduction ...... 1

1.1 Features and General Description.... 1

# 2 DI/O Function Library.... 5

2.1 List of Functions.... 5
2.2 Function Library 7

2.2.1 Initialization....7
2.2.2 DI/O 9
2.2.3 Debounce 15
2.2.4 COS Interrupt 18
2.2.5 Trigger 25
2.2.6 Encoder 43

# Important Safety Instructions.... 71

# Getting Service.... 75

This page intentionally left blank.

# List of Tables

Table 1-1: DI Channels and Support Functions....2

Table 1-2: DO Channels and Support Functions....2

This page intentionally left blank.

# List of Figures

Figure 1-1: Single Trigger In Signal Driving Multiple Trigger Outs.....2

Figure 1-2: SW/HW Combination Trigger Out....3

Figure 1-3: SW/HW Combination Trigger Out w/ HW Start Enabled . 3

Figure 1-4: DI/O Flowchart....4

Figure 2-1: Trigger by Rising/Falling Edge....27

Figure 2-2: Encoder Signals....48

Figure 2-3: Encoder Mode A Phase without Delay 53

Figure 2-4: Encoder Mode A Phase with Delay 54

Figure 2-5: Encoder input direction signals A/B phase CW ...... 56

Figure 2-6: Encoder input direction signals A/B phase CCW...... 56

Figure 2-7: Encoder Mode A Phase with Encoder Latch (rising edge)....63

Figure 2-8: Encoder Mode A Phase with Encoder Latch (falling edge)....63

This page intentionally left blank.

# 1 Introduction

This Function Library Reference provides necessary details of APIs for the PCIe-E13D, the I/O device employed by the EOS-1300 4CH GigE Vision system. Once the driver is installed, the PCIe-E13D is listed in in the Device Manager, as shown. The functions can be used to develop normal I/O control and on-the-fly (real-time) trigger and encoder applications in Visual C++, C#, Visual Basic.Net, and Borland C++ Builder.

![Device Manager\nFile Action View Help\nE13D-x64-PC\nComputer\nDI/O Boards\nPCIe-E13D Device\nDisk drives\nDisplay adapters\nHuman Interface Devices\nKeyboards\nMice and other pointing devices\nMonitors\nNetwork adapters\nOther devices\nPortable Devices\nPorts (COM & LPT)\nProcessors\nSound, video and game controllers\nStorage controllers\nSystem devices\nUniversal Serial Bus controllers](.eos-1300-manual-en-20180110-v1/560097faa869de8dfc422b837a5d28cfa6b54ef7b08bc3904a04924ca002ac39.jpg)

# 1.1 Features and General Description

The PCIe-E13D provides the EOS-1300 with 12 DI, 16 DO, and 2 encoders with some I/O pins configurable for real-time trigger in/out. The encoder latch and DI also support digital de-bounce filtering to easily reduce noise effects, as shown.

<table><tr><td>Function</td><td>DI0 to DI3</td><td>DI4 to DI7</td><td>DI8 to DI9</td><td>DI10 to DI11</td></tr><tr><td>Trigger In</td><td>Yes</td><td>No</td><td>No</td><td>No</td></tr><tr><td>Encoder Latch</td><td>No</td><td>No</td><td>CH8:Encoder 0CH9:Encoder 1</td><td>No</td></tr><tr><td>General D/I</td><td>Yes</td><td>Yes</td><td>Yes</td><td>Yes</td></tr><tr><td>De-bounce filter</td><td>Yes</td><td>Yes</td><td>Yes</td><td>Yes</td></tr><tr><td>Start Enable</td><td>No</td><td>Yes</td><td>No</td><td>No</td></tr></table>

Table 1-1: DI Channels and Support Functions

<table><tr><td>Function</td><td>DO0 to DO3</td><td>DO4 to DO15</td></tr><tr><td>Trigger Out</td><td>Yes</td><td>No</td></tr><tr><td>General DO</td><td>Yes</td><td>Yes</td></tr></table>

Table 1-2: DO Channels and Support Functions

Trigger Out can be SW (software) or HW (Hardware) triggered (i.e. trigger in and encoder), or a SW/HW hybrid.

One Trigger In can drive multiple Trigger Outs, each of which can have individual pulse and delay, as shown.

![| Signal          | Event           | Pulse Width |\n|-----------------|-----------------|-------------|\n| Trigger_In      | In              | -           |\n| Trigger_Out_1   | Out             | Delay       |\n| Trigger_Out_2   | Out             | Delay       |](.eos-1300-manual-en-20180110-v1/7258990f4ead827aa5dafbc5d62ed4ed2cea9243d6db89ca54ecc7fa98b34616.jpg)

Figure 1-1: Single Trigger In Signal Driving Multiple Trigger Outs

With HW/SW combinations, flexible Trigger Out applications can be created, as shown.

![Based on the provided image, here is an accurate and concise description of the flowchart/block diagram:\n\n**Labeled Blocks:**\nThere are three rectangular blocks on the left side, each associated with a signal line:\n1.  **Trigger Enable (SW Signal)**\n2.  **Trigger In (HW DI Signal)**\n3.  **Trigger Out (DO)**\n\n**Connections and Signals:**\n*   **Top Signal (Red):** A red horizontal line extends from the 'Trigger Enable' block. It transitions to a high state (red line) between two vertical blue lines.\n*   **Middle Signal (Green):** A green square wave signal extends from the 'Trigger In' block, running continuously across the diagram.\n*   **Bottom Signal (Black):** A black square wave signal extends from the 'Trigger Out' block. It begins low and pulses high and low, generally following the pattern of the green signal.\n\n**Markers:**\n*   Two vertical blue lines intersect the signals.\n*   The left vertical line is labeled **Start**.\n*   The right vertical line is labeled **Stop**.\n\nThe diagram illustrates a timing relationship where the 'Trigger Enable' signal is active (high) between the **Start** and **Stop** points, enabling the 'Trigger Out' signal to pass through or follow the 'Trigger In' signal within that specific window.](.eos-1300-manual-en-20180110-v1/e3ff1c20b834162bb00ac53aa79af61b6f002bb9121a5bfd4abcfdab0c3e61c4.jpg)

Figure 1-2: SW/HW Combination Trigger Out

![| Signal Type              | Start | Start Enable | Stop |\n| ------------------------ | ----- | ------------ | ---- |\n| Trigger Enable (SW Signal) | 1     | 1            | 1    |\n| Start Enable (HW DI Signal) | 0     | High         | 0    |\n| Trigger In (HW DI Signal) | 0     | Low          | High |\n| Trigger Out (DO)         | 0     | Low          | Low  |](.eos-1300-manual-en-20180110-v1/0c28d3885a9a36aa6cbedc821c0604c14ef3bc526fc38cacdd01218eb187641a.jpg)

Figure 1-3: SW/HW Combination Trigger Out w/ HW Start Enabled

Referring to the Encoder, the user can send the Trigger Out pulse periodically, according to Encoder counts (Linear mode) or dynamically, according to CPU result and encoder counts (FIFO Compare Mode).

![**Labeled Blocks:**\n\n*   Start\n*   Select DO: D00 to Do3\n*   In Trigger Mode?\n*   GPDO General Purpose DO\n*   Set Pulse Delay\n*   Set Pulse Width\n*   Set as HW or SW Trigger?\n*   Software Trigger\n*   Hardware Trigger\n*   Select Encoder Mode?\n*   Select Trigger In: DI0 to 3\n*   Set StartEn: Enable/Disable\n*   Set Trigger Edge: Rising / Falling\n*   Set TriggerEN: Enable\n*   Select Comparison type?\n*   Select Comparison type: Linear 0 to 3\n*   Set Delay Count\n*   Set Comparison Count\n*   Select Comparison type: FIFO 0 to 3\n*   Set Data into FIFO Buffer\n*   Set Encoder Source: Encoder 0 or 1\n*   Set Encoder Phase: off/A/AB2\n*   Set Encoder Direction: CW / CCW\n*   Set EncoderEn: Enable\n*   Trigger Out\n*   Set TriggerEn or EncoderEn to Disable\n\n**Connections:**\n\n*   **Start** connects to **Select DO: D00 to Do3**.\n*   **Select DO: D00 to Do3** connects to **In Trigger Mode?**.\n*   From **In Trigger Mode?**, the 'No' path leads to **GPDO General Purpose DO**, which then connects to **Trigger Out**.\n*   From **In Trigger Mode?**, the 'Yes' path leads to **Set Pulse Delay**, which connects to **Set Pulse Width**, which connects to **Set as HW or SW Trigger?**.\n*   From **Set as HW or SW Trigger?**, the 'SW' path leads to **Software Trigger**, which connects to **Trigger Out**.\n*   From **Set as HW or SW Trigger?**, the 'HW' path leads to **Hardware Trigger**, which connects to **Select Encoder Mode?**.\n*   From **Select Encoder Mode?**, the 'No' path leads to **Select Trigger In: DI0 to 3**, which connects to **Set StartEn: Enable/Disable**, which connects to **Set Trigger Edge: Rising / Falling**, which connects to **Set TriggerEN: Enable**, which then connects to **Trigger Out**.\n*   From **Select Encoder Mode?**, the 'Yes' path leads to **Select Comparison type?**.\n*   From **Select Comparison type?**, the 'Linear Comparison' path leads to **Select Comparison type: Linear 0 to 3**, which connects to **Set Delay Count**, which connects to **Set Comparison Count**.\n*   From **Select Comparison type?**, the 'FIFO Comparison' path leads to **Select Comparison type: FIFO 0 to 3**, which connects to **Set Data into FIFO Buffer**.\n*   The paths from **Set Comparison Count** and **Set Data into FIFO Buffer** merge and connect to **Set Encoder Source: Encoder 0 or 1**.\n*   **Set Encoder Source: Encoder 0 or 1** connects to **Set Encoder Phase: off/A/AB2**, which connects to **Set Encoder Direction: CW / CCW**, which connects to **Set EncoderEn: Enable**, which then connects to **Trigger Out**.\n*   **Trigger Out** connects to **Set TriggerEn or EncoderEn to Disable**.\n*   **Set TriggerEn or EncoderEn to Disable** loops back to the input of **In Trigger Mode?**.](.eos-1300-manual-en-20180110-v1/1df4604c244861226d7a25d5c908535b200cc6d97ee2ca6e3c8e8275a6367ee2.jpg)

Figure 1-4: DI/O Flowchart

# 2 DI/O Function Library

2.1 List of Functions

<table><tr><td>Function Group</td><td></td></tr><tr><td rowspan="2">Initialization ()See “Initialization” on page 7.</td><td>Register_Card</td></tr><tr><td>Release_Card</td></tr><tr><td rowspan="6">DI/O (see “DI/O” on page 9)</td><td>DI_ReadLine</td></tr><tr><td>DI_ReadPort</td></tr><tr><td>DO_ReadLine</td></tr><tr><td>DO_WriteLine</td></tr><tr><td>DO_ReadPort</td></tr><tr><td>DO_WritePort</td></tr><tr><td rowspan="2">Debounce (see “Debounce” on page 15)</td><td>SetDIFilter</td></tr><tr><td>GetDIFilter</td></tr><tr><td rowspan="5">COS Interrupt (see “COS Interrupt” on page 18)</td><td>DIO_INT1_EventMessage</td></tr><tr><td>DIO_INT2_EventMessage</td></tr><tr><td>DIO_SetDualInterrupt</td></tr><tr><td>DIO_SetCOSInterrupt32</td></tr><tr><td>DIO_GetCOSLatchData32</td></tr><tr><td rowspan="14">Trigger (see “Trigger” on page 25)</td><td>GetTriggerInPolarity</td></tr><tr><td>SetTriggerInPolarity</td></tr><tr><td>GetTriggerOutPulseWidth</td></tr><tr><td>SetTriggerOutPulseWidth</td></tr><tr><td>GetTriggerOutDelay</td></tr><tr><td>SetTriggerOutDelay</td></tr><tr><td>GetDOMode</td></tr><tr><td>SetDOMode</td></tr><tr><td>SetSWTrigger</td></tr><tr><td>GetHWTrigger</td></tr><tr><td>SetHWTrigger</td></tr><tr><td>GetTriggerStart</td></tr><tr><td>SetTriggerStart</td></tr><tr><td>GetTriggerEn</td></tr><tr><td rowspan="5">Trigger(see “Trigger” on page 25)</td><td>SetTriggerEn</td></tr><tr><td>GetTriggerInCount</td></tr><tr><td>GetTriggerOutCount</td></tr><tr><td>ResetTriggerInCount</td></tr><tr><td>ResetTriggerOutCount</td></tr><tr><td rowspan="24">Encoder(see “Encoder” on page 43)</td><td>GetEncoderEn</td></tr><tr><td>SetEncoderEn</td></tr><tr><td>GetEncoderInputMode</td></tr><tr><td>SetEncoderInputMode</td></tr><tr><td>GetEncoderCount</td></tr><tr><td>GetEncoderDelayCount</td></tr><tr><td>SetEncoderDelayCount</td></tr><tr><td>GetEncoderLinearCount</td></tr><tr><td>SetEncoderLinearCount</td></tr><tr><td>GetEncoderInputDirection</td></tr><tr><td>SetEncoderInputDirection</td></tr><tr><td>GetComparedTriggerSource</td></tr><tr><td>SetComparedTriggerSource</td></tr><tr><td>SetEncoderLatchInt</td></tr><tr><td>GetEncoderLatchDirection</td></tr><tr><td>SetEncoderLatchDirection</td></tr><tr><td>GetEncoderLatchData</td></tr><tr><td>GetFIFOBufferUsage</td></tr><tr><td>GetFIFOBufferFreeSpace</td></tr><tr><td>GetFIFOBufferState</td></tr><tr><td>GetFIFOBufferData</td></tr><tr><td>SetFIFOBufferData</td></tr><tr><td>ResetEncoderCount</td></tr><tr><td>ResetFIFOBuffer</td></tr></table>

# 2.2 Function Library

# 2.2.1 Initialization

# Register\_Card

Initializes the hardware and software states of a PCI-bus data acquisition card, then returns a numeric card ID that corresponds to the initialized card. Register\_Card must be called before any other PCIS-DASK library functions can be called for a particular card. The function initializes the card and variables internal to the PCIS-DASK library. Because PCI-bus data acquisition cards meet plug-and-play specifications, the base address (pass-through address) and IRQ level are assigned directly by the system BIOS

# Syntax

C/C++

I16 Register\_Card (U16 CardType, U16 card\_num)

Visual Basic

Register\_Card (ByVal CardType As Integer, ByVal card\_num As Integer) As Integer

VB.Net

Register\_Card (ByVal CardType As Short, ByVal card\_num As Short) As Short

C#

short Register\_Card (ushort CardType, ushort card\_num)

# Parameters

CardType:

Type of card to be initialized. ADLINK periodically upgrades PCIS-DASK to add support for new PCI-bus data acquisition cards and NuIPC CompactPCI cards. Refer to release notes of the card to know if PCIS-DASK supports that card. These are the constants defined in DASK.H that represent the PCI-bus data acquisition cards supported by PCIS-DASK: PCIe-E13D

card\_num:

Sequence number of the card with the same card type (as defined in argument CardType) or that belongs to the same card type series (except PCI-7300A\_Rev. A and PCI-7300A Rev. B) plugged in the PCI slot. card\_num is always equal to 0 for PCIe-E13D.

# Return Code

Returns a numeric card ID for the initialized card. The card ID range is between 0 and 31. If any error occurs, this returns a negative error code. Possible error codes:

```htaccess
ErrorTooManyCardRegistered
ErrorUnknownCardType
ErrorOpenDriverFailed
ErrorOpenEventFailed
```

# Release\_Card

At most, 32 cards can be registered simultaneously. This function tells the PCIS-DASK library that the registered card is not currently in use and may be released. Releasing a card creates a vacancy for a new card to register. Also used at the end of a program to release all registered cards.

# Syntax

```txt
C/C++
I16 Release_Card (U16 CardNumber)
Visual Basic
Release_Card (ByVal CardNumber As Integer) As Integer
VB.Net
Release_Card (ByVal CardNumber As Short) As Short
C#
short Release_Card (ushort CardNumber)
```

# Parameters

```txt
CardNumber:
ID of the card for release.
```

# Return Code

NoError

# 2.2.2 DI/O

# DI\_ReadLine

Reads the digital logic state of the digital line in the specified port.

# Syntax

C/C++

I16 DI\_ReadLine(U16 CardNumber, U16 Port, U16 Line, U16 \*State)

# Visual Basic

DI\_ReadLine(ByVal CardNumber As ushort, ByVal Port As ushort, ByVal Line As ushort, State As ushort) As Short

# VB.Net

DI\_ReadLine(ByVal CardNumber As ushort, ByVal Port As ushort, ByVal Line As ushort, ByRef State As ushort) As Short

C#

short DI\_ReadLine(ushort CardNumber, ushort Port, ushort Line, out ushort State)

# Parameters

CardNumber

ID of the card performing the operation.

Port

Digital input port number. Valid values, where PCIe-E13D supports only port 0.

Line

Digital line to be read, with valid values for PCIe-E13D of 0 to 11.

State

Returns the digital logic state of the specified line to 0 or 1.

# Return Code

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorCardNotRegistered -4
ErrorFuncNotSupport -5
ErrorInvalidIoChannel -6
```

# DI\_ReadPort

Reads the digital data from the specified digital input port.

# Syntax

```txt
C/C++
I16 DI_ReadPort(U16 CardNumber, U16 Port, U32 *Value)
```

# Visual Basic

```txt
DI_ReadPort(ByVal CardNumber As ushort, ByVal Port As ushort, Value As uint) As short
```

# VB.Net

```txt
DI_ReadPort(ByVal CardNumber As ushort, ByVal Port As ushort, ByRef Value As uint) As short
```

# C#

```txt
short DI_ReadPort(ushort CardNumber, ushort Port, out uint Value)
```

# Parameters

CardNumber:

ID of the card performing the operation.

Port:

Digital input port number. Valid values: PCIe-E13D only supports port 0

Value:

Returns the digital data read from the specified port. Valid values: PCIe-E13D 12-bit data (for port 0)

# Return Code

```txt
NoError 0
ErrorInvalidCardNumber -1
```

```batch
ErrorCardNotRegistered -4
ErrorFuncNotSupport -5
ErrorInvalidIoChannel -6
```

# DO\_ReadLine

Reads back the digital logic state of the specified digital output line of the specified port.

# Syntax

```txt
C/C++
```

```txt
I16 DO_ReadLine(U16 CardNumber, U16 Port, U16 Line, U16 *State)
```

# Visual Basic

```txt
DO_ReadLine(ByVal CardNumber As ushort, ByVal Port As ushort, ByVal Line As ushort, State As ushort) As short
```

# VB.Net

```txt
DO_ReadLine(ByVal CardNumber As ushort, ByVal Port As ushort, ByVal Line As ushort, ByRef State As ushort) As short
```

```txt
C#
```

```txt
short DO_ReadLine(ushort CardNumber, ushort Port, ushort Line, out ushort State)
```

# Parameters

CardNumber:

ID of the card performing the operation.

Port:

Digital input port number. Valid values: PCIe-E13D only supports port 0

State

Returns the digital logic state, 0 or 1, of the specified line.

# Return Code

```txt
NoError 0
ErrorInvalidCardNumber -1
```

```batch
ErrorCardNotRegistered -4
ErrorFuncNotSupport -5
ErrorInvalidIoChannel -6
```

# DO\_WriteLine

Sets the specified digital output line in the specified digital port to the specified state. Only available for cards supporting digital output read-back.

# Syntax

```txt
C/C++
```

```txt
I16 DO_WriteLine(U16 CardNumber, U16 Port, U16 Line, U16 State)
```

# Visual Basic

```txt
DO_WriteLine(ByVal CardNumber As ushort, ByVal Port As ushort, ByVal Line As ushort, ByVal State As ushort) As Integer
```

# VB.Net

```txt
DO_WriteLine(ByVal CardNumber As ushort, ByVal Port As ushort, ByVal Line As ushort, ByVal State As ushort) As Short
```

```txt
C#
```

```txt
short DO_WriteLine(ushort CardNumber, ushort Port, ushort Line, ushort State)
```

# Parameters

CardNumber:

ID of the card performing the operation.

Port:

Digital input port number. Valid values: PCIe-E13D only supports port 0.

Line

Digital line to be read. Valid values: PCIe-E13D 0 to 15(for port 0).

State

New digital logic state 0 or 1.

# Return Code

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorCardNotRegistered -4
ErrorFuncNotSupport -5
ErrorInvalidIoChannel -6
```

# DO\_ReadPort

Reads back the output digital data from the specified digital output port.

# Syntax

```txt
C/C++
I16 DO_ReadPort(U16 CardNumber, U16 Port, U32 *Value)
```

# Visual Basic

```txt
DO_ReadPort(ByVal CardNumber As ushort, ByVal Port As ushort, Value As uint) As Short
```

# VB.Net

```txt
DO_ReadPort(ByVal CardNumber As ushort, ByVal Port As ushort, ByRef Value As uint) As Short
```

# C#

```txt
short DO_ReadPort(ushort CardNumber, ushort Port, out uint Value)
```

# Parameters

CardNumber:

ID of the card performing the operation.

Port:

Digital input port number. Valid values: PCIe-E13D only supports port 0

Value

Digital data written to the specified port. Valid values: PCIe-E13D 16-bit data (for port 0)

# Return Code

```batch
ErrorInvalidCardNumber -1
ErrorCardNotRegistered -4
```

```txt
ErrorFuncNotSupport -5
ErrorInvalidIoChannel -6
```

# DO\_WritePort

Writes digital data to the specified digital output port.

# Syntax

```txt
C/C++
```

```txt
I16 DO_WritePort(U16 CardNumber, U16 Port, U32 Value)
```

# Visual Basic

```txt
DO_WritePort(ByVal CardNumber As ushort, ByVal Port As ushort, ByVal Value As uint) As Short
```

# VB.Net

```txt
DO_WritePort(ByVal CardNumber As ushort, ByVal Port As ushort, ByVal Value As uint) As Short
```

```txt
C#
```

```txt
short DO_WritePort(ushort CardNumber, ushort Port, uint Value)
```

# Parameters

CardNumber:

ID of the card performing the operation.

Port:

Digital output port number. Valid values: PCIe-E13D only supports port 0

Value

Digital data written to the specified port. Valid values: PCIe-E13D 16-bit data (for port 0)

# Return Code

```batch
ErrorInvalidCardNumber -1
ErrorCardNotRegistered -4
ErrorFuncNotSupport -5
ErrorInvalidIoChannel -6
```

# 2.2.3 Debounce

# SetDIFilter

Sets time for all digital input filters.

# Syntax

C/C++

I16 SetDIFilter(U16 CardNumber, U16 Line, U16 Value)

VB.Net

SetDIFilter(ByVal CardNumber As ushort, ByRef Line As ushort, ByVal Value As ushort) As Short

C#

short SetDIFilter(ushort CardNumber, ushort Line, ushort Value)

# Parameters

CardNumber:

ID of the card performing the operation.

Line:

Digital line to be read. Valid values: PCIe-E13D 0 to 11

Value

0 disabling (off), and others digital filter time (1 to 9; 409.6\*

2^(setting value) us)

![The image displays a white document icon featuring faint horizontal lines and a folded top-left corner. A large, bold red checkmark is superimposed over the document, slanting upwards from the bottom left to the top right.](.eos-1300-manual-en-20180110-v1/43c5296b8859a7b3c4825406db6536408b15a33ef15674b63056e1ac2ed2944d.jpg)
NOTE:

Due to characteristics of HW components and external circuits, filter time may change dynamically.

<table><tr><td>Filter Time (50% duty cycle)</td><td>Value</td><td>Frequency (Hz)</td></tr><tr><td>0 (bypass)</td><td>0</td><td>Disabled</td></tr><tr><td>819.2 us</td><td>1</td><td>609.76</td></tr><tr><td>71.64 ms</td><td>2</td><td>304.88</td></tr><tr><td>3.28 ms</td><td>3</td><td>152.67</td></tr><tr><td>6.55 ms</td><td>4</td><td>76.22</td></tr><tr><td>13.10 ms</td><td>5</td><td>38.11</td></tr><tr><td>26.20 ms</td><td>6</td><td>19.06</td></tr><tr><td>52.43 ms</td><td>7</td><td>9.53</td></tr><tr><td>104.85 ms</td><td>8</td><td>4.76</td></tr><tr><td>209.72 ms</td><td>9</td><td>2.38</td></tr></table>

# Return Code

NoError 0

ErrorInvalidCardNumber -1

ErrorCardNotRegistered -4

ErrorFuncNotSupport -5

ErrorInvalidIoChannel -6

# GetDIFilter

Acquires time for all digital input filters.

# Syntax

C/C++

I16 GetDIFilter(U16 CardNumber, U16 Line, U16 \*Value)

# VB.Net

GetDIFilter(ByVal CardNumber As ushort, ByRef Line As ushort, ByRef Value As ushort) As Short

# C#

short GetDIFilter(ushort CardNumber, out ushort Line, out ushort Value)

# Parameters

CardNumber:

ID of the card performing the operation.

Line:

Digital line to be read. Valid values: PCIe-E13D 0 to 11

Value

0 disabling (off), and others digital filter time (1 to 9; 409.6\*2^(setting value) us)

![An icon depicting a white document with a folded top-right corner and faint horizontal lines, featuring a large red checkmark overlaid on top.](.eos-1300-manual-en-20180110-v1/1e873bd6815b1d477c7cd63e2a1efffe4a4a5d1aa54ede7cdc19eae55241a2f5.jpg)
NOTE:

Due to characteristics of HW components and external circuits, filter time may change dynamically.

<table><tr><td>Filter Time (50% duty cycle)</td><td>Value</td><td>Frequency (Hz)</td></tr><tr><td>0 (bypass)</td><td>0</td><td>Disabled</td></tr><tr><td>819.2 us</td><td>1</td><td>609.76</td></tr><tr><td>71.64 ms</td><td>2</td><td>304.88</td></tr><tr><td>3.28 ms</td><td>3</td><td>152.67</td></tr><tr><td>6.55 ms</td><td>4</td><td>76.22</td></tr><tr><td>13.10 ms</td><td>5</td><td>38.11</td></tr><tr><td>26.20 ms</td><td>6</td><td>19.06</td></tr><tr><td>52.43 ms</td><td>7</td><td>9.53</td></tr><tr><td>104.85 ms</td><td>8</td><td>4.76</td></tr><tr><td>209.72 ms</td><td>9</td><td>2.38</td></tr></table>

# Return Code

NoError 0

ErrorInvalidCardNumber -1

ErrorCardNotRegistered -4

ErrorFuncNotSupport -5

ErrorInvalidIoChannel -6

# 2.2.4 COS Interrupt

# DIO\_INT1\_EventMessage

Controls INT1 interrupt sources for a dual-interrupt system and notifies the host application when an interrupt event occurs. Notification is issued via user-specified callback or the Windows PostMessage API.

# Syntax

C/C++
```txt
I16 DIO_INT1_EventMessage(U16 CardNumber, I16 Int1Mode, HANDLE windowHandle, U32 message, void *callbackAddr())
```

# Visual Basic

```txt
DIO_INT1_EventMessage(ByVal CardNumber As ushort, ByVal IntlMode As short, ByVal windowHandle As Long, ByVal message As Long, ByVal callbackAddr As Long) As Short
```

# VB.Net

```txt
DIO_INT1_EventMessage(ByVal CardNumber As ushort, ByVal IntlMode As Short, ByVal windowHandle As Integer, ByVal message As Integer, ByVal callbackAddr As CallbackDelegate) As Short
```
C#

x64
```txt
short DIO_INT1_EventMessage(ushort CardNumber, short Int1Mode, IntPtr windowHandle, ulong message, MulticastDelegate callbackAddr)
```
x86

```txt
short DIO_INT1_EventMessage(ushort CardNumber, short Int1Mode, IntPtr windowHandle, uint message, MulticastDelegate callbackAddr)
```

# Parameters

CardNumber:

ID of the card performing the operation.

Int1Mode:

Interrupt mode of INT1 by COS of Line0 of Port 0. Valid values: INT1\_DISABLE or 0, and INT1\_EXT\_SIGNAL or 1

windowHandle:

Handle of the window to receive a Windows message when the specified INT event happens. If 0, no Windows messages will be sent.

message:

User-defined message sent when a specified INT event occurs. The message can be of any value. In Windows, the message can be set to a value including any Windows pre-defined messages, such as WM\_PAINT. To define custom messages, any value ranging from WM\_USER (0x400) to 0x7fff can be used. This range is reserved by Windows for user-defined messages.

callbackAddr:

Address of the user callback function. The PCIS-DASK calls this function when the specified INT event occurs. If no callback function is required, set callbackAddr to 0.

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorCardNotRegistered -4
ErrorFuncNotSupport -5
```

# DIO\_INT2\_EventMessage

Controls INT2 interrupt sources for a dual-interrupt system and notifies the host application when an interrupt event occurs. Notification is issued via user-specified callback or the Windows PostMessage API.

# Syntax

```txt
C/C++
```

I16 DIO\_INT2\_EventMessage(U16 CardNumber, I16 Int2Mode, HANDLE windowHandle, U32 message, void \*callbackAddr())

# Visual Basic

DIO\_INT2\_EventMessage(ByVal CardNumber As ushort, ByVal Int2Mode As short, ByVal windowHandle As Long, ByVal message As Long, ByVal callbackAddr As Long) As Short

# VB.Net

DIO\_INT2\_EventMessage(ByVal CardNumber As Short, ByVal Int2Mode As Short, ByVal windowHandle As Integer, ByVal message As Integer, ByVal callbackAddr As CallbackDelegate) As Short

C#

x64

short DIO\_INT2\_EventMessage(ushort CardNumber, short Int2Mode, IntPtr windowHandle, ulong message, MulticastDelegate callbackAddr)

x86

short DIO\_INT2\_EventMessage(ushort CardNumber, short Int2Mode, IntPtr windowHandle, uint message, MulticastDelegate callbackAddr)

# Parameters

CardNumber:

ID of the card performing the operation.

Int2Mode:

Interrupt mode of INT2 by COS of Line 1 of Port 0. Valid values: INT2\_DISABLE or 0, and INT2\_EXT\_SIGNAL or 1

windowHandle:

Handle of the window to receive a Windows message when the specified INT event happens. If 0, no Windows messages will be sent.

message:

User-defined message sent when a specified INT event occurs. The message can be of any value. In Windows, the message can be set to a value including any Windows predefined messages, such as WM\_PAINT. To define custom messages, any value ranging from WM\_USER (0x400) to 0x7fff can be used. This range is reserved by Windows for user-defined messages.

callbackAddr:

Address of the user callback function. The PCIS-DASK calls this function when the specified INT event occurs. If no callback function is required, set callbackAddr to 0.

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorCardNotRegistered -4
ErrorFuncNotSupport -5
```

# DIO\_SetDualInterrupt

Informs the PCIS-DASK library of the interrupt mode of sources of a dual-interrupt system and returns dual interrupt events. If an interrupt is generated, the corresponding interrupt events are signaled. The application uses Win32 wait functions, such as WaitForSingleObject or WaitForMultipleObjects to check the interrupt event status.

# Syntax

C/C++

I16 DIO\_SetDualInterrupt (U16 CardNumber, I16 Int1Mode, I16 Int2Mode, HANDLE \*hEvent)

# Visual Basic

DIO\_SetDualInterrupt (ByVal CardNumber As ushort, ByVal Int1Mode As short, ByVal Int2Mode As short, hEvent As Long) As Short

# VB.Net

DIO\_SetDualInterrupt (ByVal CardNumber As ushort, ByVal Int1Mode As short, ByVal Int2Mode As Short, ByRef hEvent() As IntPtr) As Short

C#

short DIO\_SetDualInterrupt (ushort CardNumber, short Int1Mode, short Int2Mode, IntPtr hEvent)

# Parameters

CardNumber:

ID of the card performing the operation.

Int1Mode:

Interrupt mode of INT1 by COS of Line0 of Port 0, with valid values:

INT1\_DISABLE or 0

INT1\_EXT\_SIGNAL or 1

Int2Mode:

Interrupt mode of INT2 by COS of Line1 of Port 0, with valid values:

INT2\_DISABLE or 0

INT2\_EXT\_SIGNAL INT2 or 1

hEvent (Windows only):

Returned dual-interrupt event handles. The status of a dual-interrupt event indicates that an interrupt is generated or not for cards comprising dual-interrupt system.

# Return Code(s)

NoError 0

ErrorInvalidCardNumber -1

ErrorCardNotRegistered -4

ErrorFuncNotSupport -5

# DIO\_SetCOSInterrupt32

Enables or disables COS (Change Of State) interrupt detection for the specified ports with 32-bit data width.

# Syntax

C/C++

I16 DIO\_SetCOSInterrupt32 (U16 CardNumber, U8 Port, U32 ctl, HANDLE \*hEvent, BOOLEAN Manual-Reset)

# VB.Net

DIO\_SetCOSInterrupt32 (ByVal CardNumber As ushort, ByVal Port As Byte, ByVal ctl As uint, ByRef hEvent As Integer, ByVal ManualReset As Byte) As Short

# C#

short DIO\_SetCOSInterrupt32 (ushort CardNumber, byte Port, uint ctl, out SafeWaitHandle hEvent, bool ManualReset)

# Parameters

CardNumber:

ID of the card performing the operation.

Port:

Channel number where COS detection capability is to be enabled/disabled, with valid port numbers: PCIe-E13D 0

ctl:

Control value for the port defined by argument port. Valid values:

Each bit of the ctrl value controls one DI channel. The '0' value of the bit value disables COS function of the corresponding line, and the '1' value of the bit value enables the COS function of the corresponding line. Valid values for ctrl are 0 to 4095 (0xFFFF)

hEvent :

Returned COS interrupt event handle.

ManualReset:

Specifies whether the event is (1) manual-reset by function ResetEvent in user application or (0) autoreset Address of the user callback function. PCIS-DASK calls this function when the specified COS event occurs. If no callback function is to be used, setting should be 0.

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorCardNotRegistered -4
ErrorFuncNotSupport -5
```

# DIO\_GetCOSLatchData32

Retrieves 32-bit width DI data latched in the COS Latch register when a Change-of-State (COS) interrupt occurs.

# Syntax

```txt
C/C++
I16 DIO_GetCOSLatchData32(U16 CardNumber, U8 Port, U32 *CosLData)
```

# Visual Basic

```txt
DIO_GetCOSLatchData32 (ByVal CardNumber As ushort, ByVal Port As Byte, CosLData As uint) As Short
```

# VB.Net

```txt
DIO_GetCOSLatchData32 (ByVal CardNumber As ushort, ByVal Port As Byte, ByRef CosLData As uint) As Short
```

# C#

```txt
short DIO_GetCOSLatchData32(ushort CardNumber, byte Port, out uint CosLData)
```

# Parameters

CardNumber:

ID of the card performing the operation.

Port:

Channel number on which COS detection capability is to be enabled/disabled. Valid port numbers: PCIe-E13D 0

CosLData:

Retrieves DI data latched in the COS Latch register when a Change-of-State (COS) interrupt occurs. PCIe-E13D 16-bit data.

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorCardNotRegistered -4
ErrorFuncNotSupport -5
```

# 2.2.5 Trigger

# GetTriggerInPolarity

Acquires polarity of the specified Trigger In for the channel.

# Syntax

```javascript
C/C++
I16 GetTriggerInPolarity(U16 CardNumber, U16 Channel, U16 *Polarity)
```

# VB.Net

GetTriggerInPolarity(ByVal CardNumber As ushort, ByVal Channel As ushort, ByRef Polarity As ushort) As Short

C#

short GetTriggerInPolarity(ushort CardNumber, ushort Channel, out of ushort Polarity)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates channel of trigger output, value can be from 0 to 3.

Polarity:

0: High active (Rising), 1: Low active (Falling)

# Return Code(s)

NoError 0

```batch
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# SetTriggerInPolarity

Sets polarity of the specified Trigger In for the channel.

# Syntax

```txt
C/C++
```

```txt
I16 SetTriggerInPolarity(U16 CardNumber, U16 Channel, U16 Polarity)
```

# VB.Net

```txt
SetTriggerInPolarity(ByVal CardNumber As ushort, ByVal Channel As ushort, ByVal Polarity As ushort) As Short
```

```txt
C#
```

```txt
short SetTriggerInPolarity(ushort CardNumber, ushort Channel, ushort Polarity)
```

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates channel of trigger output, value can be from 0 to 3.

Polarity:

0: High active (Rising), 1: Low active (Falling)

![The image displays a graphic of a white document or page featuring horizontal grey lines. The top-left corner of the page is folded down. Overlaid on top of the document is a large, thick red checkmark that spans diagonally from the bottom left to the upper right.](.eos-1300-manual-en-20180110-v1/e18b1cb2d59a5744bcf08a51093d8def22c966fc603501bb67681af72691da79.jpg)
NOTE:

Disable SetTriggerEn() and SetEncoderEn() before configuring SetTriggerInPolarity().

# Return Code(s)

NoError 0

```batch
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

Trigger by rising edge
![Trigger in\nTrigger out\nTdelay Tpulse width](.eos-1300-manual-en-20180110-v1/5306b4aeaf379b1500ee4fd1ab569fd27315b1244c9b62941e0572de5e34fae8.jpg)

Trigger by falling edge
![Trigger in\nTrigger out\nTdelay Tpulse width](.eos-1300-manual-en-20180110-v1/95d467818f1a16f2ae0817168e63173f274192e06ebbaed375cb1f4bcd0d8b0a.jpg)

Figure 2-1: Trigger by Rising/Falling Edge

# GetTriggerOutPulseWidth

Acquires pulse width of Trigger Out.

# Syntax

C/C++

I16 GetTriggerOutPulseWidth(U16 CardNumber, U16 Channel, U32 \*Width)

VB.Net

GetTriggerOutPulseWidth(ByVal CardNumber As ushort, ByVal Channel As ushort, ByRef Width As uint) As Short

C#

short GetTriggerOutPulseWidth(ushort CardNumber, ushort Channel, out of unit Width)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates channel of trigger output, value can be from 0 to 3, with 0 to 3 indicating trigger in 0 to 3.

Width:

Pulse width, 0 to 2097151, indicating 1 to 2097150 us (21 bits).

![The image displays a graphic of a white document page featuring horizontal grey lines and a folded top-left corner. A large, thick red checkmark is superimposed over the center of the page.](.eos-1300-manual-en-20180110-v1/b4d7b1cc96099fd96b43bbfeea2bf50dab79eaa08aeabed9dba70a99727bf4c3.jpg)
NOTE:

Measure time = PulseWidth \* 1.024

Due to the characteristics of HW components and external circuits, it is recommended that width be set above 1ms

# Return Code(s)

NoError 0

ErrorInvalidCardNumber -1

ErrorInvalidIoChannel -6

ERRORInvalidParameter -218

ERROROnTheFly -219

# SetTriggerOutPulseWidth

Sets pulse width of Trigger Out.

# Syntax

C/C++

I16 SetTriggerOutPulseWidth(U16 CardNumber, U16 Channel, U32 Width)

# VB.Net

SetTriggerOutPulseWidth(ByVal CardNumber As ushort, ByVal Channel As ushort, ByVal Width As uint) As Short

C#

short SetTriggerOutPulseWidth(ushort CardNumber, ushort Channel, uint Width)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates channel of trigger output, value can be from 0 to 3, with 0 to 3 indicating trigger in 0 to 3.

Width:

Pulse width, 0 to 2097151, indicating 1 to 2097150 us (21 bits).

![The image displays a square icon with a thin black border. Inside is a white piece of paper with a folded top-right corner. Faint gray horizontal lines run across the lower portion of the paper, resembling a document or list. A large, thick red checkmark is superimposed over the paper, running diagonally from the bottom left to the top right.](.eos-1300-manual-en-20180110-v1/40f4915752a8fd60aba0d96684f150bc5f42899a3ef4fafa60ab6b2ae0fabc6e.jpg)
NOTE:

Measure time = PulseWidth \* 1.024

Due to the characteristics of HW components and external circuits, it is recommended that width be set above 1ms

Disable SetTriggerEn() and SetEncoderEn() before configuring SetTriggerOutPulseWidth

# Return Code(s)

NoError 0

ErrorInvalidCardNumber -1

ErrorInvalidIoChannel -6

ERRORInvalidParameter -218

ERROROnTheFly -219

# GetTriggerOutDelay

Acquires delay of Trigger Out.

# Syntax

C/C++

I16 GetTriggerOutDelay(U16 CardNumber, U16 Channel, U32 \*Delay)

# VB.Net

GetTriggerOutDelay(ByVal CardNumber As uint, ByVal Channel As uint, ByRef Delay As uint) As Short

C#

short GetTriggerOutDelay(ushort CardNumber, ushort Channel, out of uint Delay)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates channel of trigger output, value can be from 0 to 3, with 0 to 3 indicating trigger in 0 to 3.

Delay:

Pulse width, 0 to 2097151, indicating 1 to 2097150 us (21 bits).

![The image displays a white document icon with a folded top-right corner and faint horizontal lines running across it. A large, bold red checkmark is superimposed over the left side of the document.](.eos-1300-manual-en-20180110-v1/03b2cd0f1cb482fe97ebe1949ed8d748c45112d75e08678f45ef92da17d00d13.jpg)
NOTE:

Measure time = PulseWidth \* 1.024

Due to the characteristics of HW components and external circuits, it is recommended that width be set above 1ms

# Return Code(s)

NoError 0

ErrorInvalidCardNumber -1

ErrorInvalidIoChannel -6

ERRORInvalidParameter -218

ERROROnTheFly -219

# SetTriggerOutDelay

Sets delay of Trigger Out.

# Syntax

C/C++

I16 SetTriggerOutDelay(U16 CardNumber, U16 Channel, U32 Delay)

# VB.Net

SetTriggerOutDelay(ByVal CardNumber As uint, ByVal Channel As uint, ByVal Delay As uint) As Short

C#

short SetTriggerOutDelay(ushort CardNumber, ushort Channel, uint Delay)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates channel of trigger output, value can be from 0 to 3, with 0 to 3 indicating trigger in 0 to 3.

Delay:

Pulse width, 0 to 2097151, indicating 1 to 2097150 us (21 bits).

![The image shows a document icon. It features a white piece of paper with a folded top-left corner and faint horizontal lines representing text. A large, bold red checkmark is superimposed over the center of the paper, indicating approval or verification.](.eos-1300-manual-en-20180110-v1/34ebd3e4b8ddefbd2a3c1a59a8da30c106f58ef5e5f879ff93ab98da7a7168f9.jpg)
NOTE:

Measure time = PulseWidth \* 1.024

Due to the characteristics of HW components and external circuits, it is recommended that width be set above 1ms
Disable SetTriggerEn() and SetEncoderEn() efore configuring SetTriggerOutDelay()

# Return Code(s)

NoError 0

ErrorInvalidCardNumber -1

ErrorInvalidIoChannel -6

ERRORInvalidParameter -218

ERROROnTheFly -219

# GetDOMode

Acquires mode (GPDO, SW trigger or HW trigger).

# Syntax

C/C++

I16 GetDOMode(U16 CardNumber, U16 Channel, U32 \*Mode)

# VB.Net

GetDOMode(ByVal CardNumber As ushort, ByVal Channel As ushort, ByRef Mode As uint) As Short

C#

short GetDOMode(ushort CardNumber, ushort Channel, out of uint Mode)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates channel of trigger output, value can be from 0 to 3, with 0 to 3 indicating trigger in 0 to 3.

Mode:

0: GPDO, 1: HW trigger, 2: SW trigger

# Return Code(s)

NoError 0

ErrorInvalidCardNumber -1

ErrorInvalidIoChannel -6

ERRORInvalidParameter -218

ERROROnTheFly -219

# SetDOMode

Sets (GPDO, SW trigger or HW trigger) of Trigger Out.

# Syntax

C/C++

I16 SetDOMode(U16 CardNumber, U16 Channel, U32 Mode)

# VB.Net

SetDOMode(ByVal CardNumber As ushort, ByVal Channel As ushort, ByVal Mode As uint) As Short

C#

short SetDOMode(ushort CardNumber, ushort Channel, uint Mode)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates channel of trigger output, value can be from 0 to 3, with 0 to 3 indicating trigger in 0 to 3.

Mode:

0: GPDO, 1: HW trigger, 2: SW trigger

![The image displays a white document icon with a folded upper-right corner and faint horizontal lines representing text. A large, bold red checkmark is superimposed over the center of the document.](.eos-1300-manual-en-20180110-v1/8576c6c89072a9bbc7bcb1ba485fe4ad282f210a86ac64c4cfbfcee460bec862.jpg)
NOTE:

Disable SetTriggerEn() and SetEncoderEn() before configuring SetTriggerOutDelay()

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# SetSWTrigger

Sets trigger of SW signal for each channel (DO0 to 3). Set function and trigger immediately.

# Syntax

C/C++

I16 SetSWTrigger(U16 CardNumber, U16 Channel)

# VB.Net

SetSWTrigger(ByVal CardNumber As ushort, ByVal Channel As ushort) As Short

C#

short SetSWTrigger(ushort CardNumber, ushort Channel)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates channel of trigger output, value can be from 0 to 3, with 0 to 3 indicating trigger in 0 to 3.

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# GetHWTrigger

Acquires Line In source of target DO.

# Syntax

C/C++

I16 GetHWTrigger(U16 CardNumber, U16 Channel, U16 \*LineIn)

# VB.Net

GetHWTrigger(ByVal CardNumber As ushort, ByVal Channel As ushort, ByRef LineIn As ushort) As Short

C#

short GetHWTrigger(ushort CardNumber, ushort Channel, out of ushort LineIn)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates channel of trigger output, value can be from 0 to 3, with 0 to 3 indicating trigger out 0 to 3.

Lineln

0 to 3: Trigger D10 to 3

4 to 7: Linear mode of compared trigger

8 to 11: FIFO mode of compared trigger

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# SetHWTrigger

Sets target DO as HW trigger and DI0 to 3, and Linear mode 4 to 7 or FIFO mode 8 to 11 as LineIn.

# Syntax

C/C++

I16 SetHWTrigger(U16 CardNumber, U16 Channel, U16 LineIn)

VB.Net

SetHWTrigger(ByVal CardNumber As ushort, ByVal Channel As ushort, ByVal LineIn As ushort) As Short

C#

short SetHWTrigger(ushort CardNumber, ushort Channel, ushort LineIn)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates channel of trigger output, value can be from 0 to 3, with 0 to 3 indicating trigger out 0 to 3.

Lineln

0 to 3: Trigger D10 to 3

4 to 7: Linear mode of compared trigger

8 to 11: FIFO mode of compared trigger

![The image displays a simple icon of a white document or piece of paper with horizontal lines running across it, suggesting text or a list. The top right corner of the paper is curled over. Superimposed over the document is a large, bold red checkmark (or tick mark) angled from the bottom left to the top right. There is no text present in the image.](.eos-1300-manual-en-20180110-v1/6f4ea060ce8e60bd07c6b43d5bd6a602eca04f6fd3918554c42ad26f103c9ac1.jpg)
NOTE:

Disable SetTriggerEn() and SetEncoderEn() before configuring SetHWTrigger()

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# GetTriggerStart

Acquires state of trigger start mode.

# Syntax

C/C++

I16 GetTriggerStart(U16 CardNumber, U16 LineIn, U16 \*State)

# VB.Net

GetTriggerStart(ByVal CardNumber As ushort, ByVal LineIn As ushort, ByRef State As ushort) As Short

C#

short GetTriggerStart(ushort CardNumber, ushort LineIn, out of ushort State)

# Parameters

CardNumber:

ID of the card performing the operation.

Lineln:

Indicates channel of trigger in, value can be from 0 to 3, with 0 to 3 indicating trigger in 0 to 3.

State

0: without start enable

1: with corresponding DI as HW trigger(DI4 -> DI0, ..., DI 7 -> DI 3)

<table><tr><td>Line In as Trigger In</td><td>HW Signal as Trigger Start Pin</td></tr><tr><td>DI0</td><td>DI4</td></tr><tr><td>DI1</td><td>DI5</td></tr><tr><td>DI2</td><td>DI6</td></tr><tr><td>DI3</td><td>DI7</td></tr></table>

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# SetTriggerStart

Sets state of trigger start mode.

# Syntax

C/C++

I16 SetTriggerStart(U16 CardNumber, U16 LineIn, U16 State)

VB.Net

SetTriggerStart(ByVal CardNumber As ushort, ByVal LineIn As ushort, ByVal State As ushort) As Short

C#

short SetTriggerStart(ushort CardNumber, ushort LineIn, ushort State)

# Parameters

CardNumber:

ID of the card performing the operation.

Lineln:

Indicates channel of trigger in, value can be from 0 to 3, with 0 to 3 indicating trigger in 0 to 3.

State

0: without start enable

1: with corresponding DI as HW trigger(DI4 -> DI0, ..., DI 7 -> DI 3)

<table><tr><td>Line In as Trigger In</td><td>HW Signal as Trigger Start Pin</td></tr><tr><td>DI0</td><td>DI4</td></tr><tr><td>DI1</td><td>DI5</td></tr><tr><td>DI2</td><td>DI6</td></tr><tr><td>DI3</td><td>DI7</td></tr></table>

![The image shows a white document icon with faint grey horizontal lines and a folded top-right corner, featuring a large red checkmark superimposed over it.](.eos-1300-manual-en-20180110-v1/2dc2963e4bbdc5389bf47022c9d4819479a2f66c9bb6da9dc669f4ddbe68fa27.jpg)
NOTE:

Disable SetTriggerEn() and SetEncoderEn() before configuring SetTriggerStart()

# Return Code(s)

NoError 0

ErrorInvalidCardNumber -1

ErrorInvalidIoChannel -6

ERRORInvalidParameter -218

ERROROnTheFly -219

# GetTriggerEn

Acquires state of trigger mode.

# Syntax

C/C++

I16 GetTriggerEn(U16 CardNumber, U16 TriggerIn, U16 \*State)

# VB.Net

GetTriggerEn(ByVal CardNumber As ushort, ByVal TriggerIn As ushort, ByRef State As ushort) As Short

C#

short GetTriggerEn(ushort CardNumber, ushort TriggerIn, out of ushort State)

# Parameters

CardNumber:

ID of the card performing the operation.

TriggerIn:

0 to 3: Trigger in 0 to 3

State

0: Disable (Reset DO channel referring to corresponding TriggerIn as GPDO. No HW trigger signal if statue set as 0)

1: Enable

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
```

# SetTriggerEn

Sets state of trigger mode.

# Syntax

```txt
C/C++
```

I16 SetTriggerEn(U16 CardNumber, U16 TriggerIn, U16 State)

# VB.Net

SetTriggerEn(ByVal CardNumber As ushort, ByVal TriggerIn As ushort, ByVal State As ushort) As Short

```txt
C#
```

short SetTriggerEn(ushort CardNumber, ushort TriggerIn, ushort State)

# Parameters

CardNumber:

ID of the card performing the operation.

TriggerIn:

0 to 3: Trigger in 0 to 3

State

0: Disable (Reset DO channel referring to corresponding TriggerIn as GPDO. No HW trigger signal if statue set as 0)

1: Enable

# Return Code(s)

NoError 0

ErrorInvalidCardNumber -1

ErrorInvalidIoChannel -6

ERRORInvalidParameter -218

# GetTriggerInCount

Acquires count value of valid Trigger In, incremental until reset by ResetTriggerInCount call.

# Syntax

```txt
C/C++
```

I16 GetTriggerInCount(U16 CardNumber, U16 Channel, U32 \*Count)

# VB.Net

GetTriggerInCount(ByVal CardNumber As ushort, ByVal Channel As ushort, ByRef Count As uint) As Short

# C#

I16 GetTriggerInCount(ushortCardNumber, ushortChannel, out uint Count)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates Trigger In channel, value from 0 to 3.

Count:

Indicates count value.

# Return Code(s)

NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6

# GetTriggerOutCount

Acquires count value of valid Trigger Out, incremental until reset by ResetTriggerOutCount call.

# Syntax

C/C++

I16 GetTriggerOutCount(U16 CardNumber, U16 Channel, U32 \*Count)

# VB.Net

GetTriggerOutCount(ByVal CardNumber As ushort, ByVal Channel As ushort, ByRef Count As uint) As Short

# C#

I16 GetTriggerOutCount(ushortCardNumber, ushort Channel, out uint Count)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates Trigger Out channel, value from 0 to 3.

Count:

Indicates count value.

# Return Code(s)

NoError 0

ErrorInvalidCardNumber -1

ErrorInvalidIoChannel -6

# ResetTriggerInCount

Resets Trigger In count.

# Syntax

C/C++

I16 ResetTriggerInCount (U16 CardNumber, U16 Channel)

# VB.Net

ResetTriggerInCount (ByVal CardNumber As ushort, ByVal Channel As ushort) As Short

C#

I16 ResetTriggerInCount (ushortCardNumber, ushortChannel)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates the channel of trigger in, value from 0 to 3.

# Return Code(s)

NoError 0

```txt
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
```

# ResetTriggerOutCount

Resets Trigger Out count.

# Syntax

```javascript
C/C++
I16 ResetTriggerOutCount (U16 CardNumber, U16 Channel)
```

# VB.Net

```txt
ResetTriggerOutCount (ByVal CardNumber As ushort, ByVal Channel As ushort) As Short
```

C#

```txt
I16 ResetTriggerOutCount (ushort CardNumber, ushortChannel)
```

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates the channel of trigger output, value from 0 to 3.

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
```

# 2.2.6 Encoder

# GetEncoderEn

Acquires state of encoder.

# Syntax

```txt
C/C++
```

I16 GetEncoderEn(U16 CardNumber, U16 Channel, U16 \*State)

# VB.Net

GetEncoderEn(ByVal CardNumberAs Uushort short, ByVal Channel As ushort, ByRef State As ushort) As Short

C#

short GetEncoderEn (ushort CardNumber, ushort Channel, out of ushort State)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

0 to 1: Encoder 0 to 1

State:

0: Disable

1: Enable

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
```

# SetEncoderEn

Sets state of encoder.

# Syntax

C/C++

I16 SetEncoderEn(ushortCardNumber, ushortChannel, ushort State)

# VB.Net

SetEncoderEn(ByVal CardNumber As ushort, ByVal Channel As ushort, ByVal State As ushort) As Short

C#

short SetEncoderEn(ushort CardNumber, ushort Channel, ushort State)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

0 to 1: Encoder 0 to 1

State:

0: Disable

1: Enable

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
```

![The image displays an icon of a document. It depicts a white sheet of paper with the top-right corner folded down. Horizontal lines run across the page, simulating text. A large, bold red checkmark is superimposed over the document.](.eos-1300-manual-en-20180110-v1/4527e5b7c50bdffa9e2e1570ae823980d16071a2102e3c1aa312af84b58f5090.jpg)
NOTE:

If SetEncoderEn() is disabled, encoder count is retained until count is reset via ResetEncoderCount().

# GetEncoderInputMode

Acquires mode of encoder input, which indicates trigger input source type. Encoder input usually connects to optics ruler or motor encoder.

# Syntax

C/C++

I16 GetEncoderInputMode(U16 CardNumber, U16 Channel, U16 \*Mode)

VB.Net

GetEncoderInputMode(ByVal CardNumber As ushort, ByVal Channel As ushort, ByRef Mode As ushort) As Short

C#

I16 GetEncoderInputMode(ushort CardNumber, ushort Channel, out ushort Mode)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates the channel of Encoder, value from 0 to 1.

Mode:

0: Off

1: A phase

2: A/B phase

3: A/B/Z phase

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# SetEncoderInputMode

Sets mode of encoder input, indicating trigger input source type. Encoder input usually connects to optics ruler or motor encoder.

# Syntax

C/C++

I16 SetEncoderInputMode(ushortCardNumber, ushortChannel, ushort Mode)

VB.Net

SetEncoderInputMode(ByVal CardNumber As ushort, ByVal Channel As ushort, ByVal Mode As ushort) As Short

# C#

I16 SetEncoderInputMode(ushort CardNumber, ushort Channel, ushort Mode)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates the channel of Encoder, value from 0 to 1.

Mode:

0: Off

1: A phase

2: A/B phase

3: A/B/Z phase

![An icon depicting a white document with horizontal lines and a curled top-left corner, featuring a large red checkmark overlay.](.eos-1300-manual-en-20180110-v1/212d2ee19478da053a0629e3425f8359db77778e59b10e8bac23ec2776fb2aae.jpg)
NOTE:

Disable SetTriggerEn() and SetEncoderEn() before configuring SetEncoderInputMode()

If EZ signal of ABZ mode is to be reset, encoder input mode must be reset by calling SetEncoderInputMode(CardNumber, Channel, 0) before setting SetEncoderInputMode(CardNumber, Channel, 3)

# Return Code(s)

NoError 0

ErrorInvalidCardNumber -1

ErrorInvalidIoChannel -6

ERRORInvalidParameter -218

ERROROnTheFly -219

A phase
![| A phase | Count |\n| ------- | ----- |\n| 1       | 1     |\n| 2       | 2     |\n| 3       | 3     |\n| 4       | 4     |\n| 5       | 5     |\n| 6       | 6     |\n| 7       | 7     |\n| 8       | 8     |](.eos-1300-manual-en-20180110-v1/5d1c13097e71eaea88db027d88e45b8835bc57b0ddb7aa1c6871e52498bc3a8b.jpg)

A/B phase
![| Phase | Count |\n|-------|-------|\n| A phase | 1     |\n| A phase | 2     |\n| A phase | 3     |\n| A phase | 4     |\n| A phase | 5     |\n| A phase | 6     |\n| A phase | 7     |\n| A phase | 8     |\n| A phase | 9     |\n| A phase | 10    |\n| A phase | 11    |\n| A phase | 12    |\n| A phase | 13    |\n| A phase | 14    |\n| A phase | 15    |\n| A phase | 16    |\n| B phase | 1     |\n| B phase | 2     |\n| B phase | 3     |\n| B phase | 4     |\n| B phase | 5     |\n| B phase | 6     |\n| B phase | 7     |\n| B phase | 8     |\n| B phase | 9     |\n| B phase | 10    |\n| B phase | 11    |\n| B phase | 12    |\n| B phase | 13    |\n| B phase | 14    |\n| B phase | 15    |\n| B phase | 16    |](.eos-1300-manual-en-20180110-v1/7b4fa9c21c233d677cce446d2b3f754dff4f1ced7bacdbef345f7ec0b5ef7f66.jpg)

A/B/Z phase
![| Time | A phase | B phase | Z start |\n|------|---------|---------|---------|\n| 1    | Low     | Low     | High    |\n| 2    | Low     | Low     | Low     |\n| 3    | Low     | Low     | Low     |\n| 4    | Low     | Low     | Low     |\n| 5    | Low     | Low     | Low     |\n| 6    | Low     | Low     | Low     |\n| 7    | Low     | Low     | Low     |\n| 8    | Low     | Low     | Low     |\n| 9    | Low     | Low     | Low     |\n| 10   | Low     | Low     | Low     |\n| 11   | Low     | Low     | Low     |\n| 12   | Low     | Low     | Low     |](.eos-1300-manual-en-20180110-v1/3ad7d1337d78c0a7ca0b7a5aef71a4cd4cce7d2e12b566c77061b6be3a6d249a.jpg)

Figure 2-2: Encoder Signals

# GetEncoderCount

Acquires count value of valid encoder trigger in (cnt\_num), incremental or decremented until reset by ResetEncoder-Count call.

# Syntax

C/C++

I16 GetEncoderCount(U16 CardNumber, U16 Channel, I32 \*Count)

VB.Net

GetEncoderCount(ByVal CardNumber As ushort, ByVal Channel As ushort, ByRef Count As int) As Short

C#

I16 GetEncoderCount(U16 CardNumber, U16 Channel, out int Count)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates the channel of Encoder, value from 0 to 1.

Count:

Indicates the count value by 2's complement.

# Return Code(s)

NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6

# GetEncoderDelayCount

Acquires count value of valid encoder delay count (dly\_num).

# Syntax

C/C++

I16 GetEncoderDelayCount(U16 CardNumber, U16 ComparedTrigger, U32 \*Count)

# VB.Net

GetEncoderDelayCount(ByVal CardNumber As ushort, ByVal ComparedTrigger As ushort, ByRef Count As U32) As Short

C#

I16 GetEncoderDelayCount(ushort CardNumber, ushort ComparedTrigger, out uint Count)

# Parameters

CardNumber:

ID of the card performing the operation.

ComparedTrigger:

0 to 3: Linear mode 0 to 3.

Count:

Indicates the delay count of encoder input signal, a 32-bit positive integer.

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# SetEncoderDelayCount

Sets count value of valid encoder delay count (dly\_num).

# Syntax

C/C++

I16 SetEncoderDelayCount(U16 CardNumber, U16 ComparedTrigger, U32 Count)

VB.Net

SetEncoderDelayCount(ByVal CardNumber As ushort, ByVal ComparedTriggerAs ushort, ByVal Count As U32) As Short

# C#

I16 SetEncoderDelayCount(ushort CardNumber, ushort ComparedTrigger, uint Count)

# Parameters

CardNumber:

ID of the card performing the operation.

ComparedTrigger:

0 to 3: Linear mode 0 to 3.

Count:

Indicates the delay count of encoder input signal, a 32-bit positive integer.

![The image displays an icon of a white document with a folded top-left corner and faint horizontal lines running across it. A large red check mark is superimposed over the center of the document.](.eos-1300-manual-en-20180110-v1/de13bdbf7d8be44dca571065dacdcf32f2d074c2fbb719f0ce64df53f3525dfa.jpg)
NOTE:

Disable SetTriggerEn() and SetEncoderEn() before configuring SetEncoderDelayCount()

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# GetEncoderLinearCount

Acquires comparison count of encoder input signal, i.e. how many signals are treated as valid.

# Syntax

C/C++

I16 GetEncoderLinearCount(U16 CardNumber, U16 ComparedTrigger, U32 \*Count)

# VB.Net

GetEncoderLinearCount(ByVal CardNumber As ushort, ByVal ComparedTriggerAs ushort, ByRef Count As U32) As Short

C#

I16 GetEncoderLinearCount(ushort CardNumber, ushort ComparedTrigger, out uint Count)

# Parameters

CardNumber:

ID of the card performing the operation.

ComparedTrigger:

0 to 3: Linear mode 0 to 3.

Count:

Indicates the linear count of encoder input signal, a 32-bit positive integer.

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# SetEncoderLinearCount

Sets the compared count of encoder input signal, i.e. how many signals are treated as valid.

# Syntax

C/C++

I16 SetEncoderLinearCount(U16 CardNumber, U16 ComparedTrigger, U32 Count)

# VB.Net

SetEncoderLinearCount(ByVal CardNumber As ushort, ByVal ComparedTriggerAs ushort, ByVal Count As U32) As Short

C#

I16 SetEncoderLinearCount(ushort CardNumber, ushort ComparedTrigger, uint Count)

# Parameters

CardNumber:

ID of the card performing the operation.

ComparedTrigger:

0 to 3: Linear mode 0 to 3

Count:

Indicates line count of encoder input signal, a 32-bit positive integer.

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

A phase input valid only (A\_en is enabled), enc\_cmp\_num = 5, dly\_num\_en is disabled, as follows.

![Encoder_start &\nEncoder_en\nA phase\nCnt_num 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16\nTrig_cc_o](.eos-1300-manual-en-20180110-v1/ff01a8bc895fd86054229aa6ab3f4277c33db49fc25d3a190a3f16e1c31f8b93.jpg)

Figure 2-3: Encoder Mode A Phase without Delay

![Encoder_start &\nEncoder_en\nA phase\nCnt_num 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16\nTrig_cc_o dly_num](.eos-1300-manual-en-20180110-v1/8e6258b8172d9d292681969f7530235b67e575f2885796f62baa543e4507208f.jpg)

Figure 2-4: Encoder Mode A Phase with Delay

# GetEncoderInputDirection

Acquires direction of encoder input signal when encoder input mode is A/B phase or A/B/Z phase.

# Syntax

C/C++

I16 GetEncoderInputDirection(U16 CardNumber, U16 Channel, U16 \*Direction)

# VB.Net

GetEncoderInputDirection(ByVal CardNumber As ushort, ByVal Channel As ushort, ByRef Direction As ushort) As Short

C#

I16 GetEncoderInputDirection(U16 CardNumber,U16 Channel, out ushort Direction)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates Encoder channel, value can be from 0 to 1.

Direction:

0: Clockwise rotation (CW)

1: Counter Clockwise rotation (CCW)

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# SetEncoderInputDirection

Sets direction of encoder input signal when encoder input mode is A/B phase or A/B/Z phase.

# Syntax

C/C++

I16 SetEncoderInputDirection(U16 CardNumber, U16 Channel, U16 Direction)

VB.Net

SetEncoderInputDirection(ByVal CardNumber As ushort, ByVal Channel As ushort, ByVal Direction As ushort) As Short

C#

I16 SetEncoderInputDirection(U16 CardNumber,U16 Channel, ushort Direction)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates Encoder channel, value can be from 0 to 1.

Direction:

0: Clockwise rotation (CW)

1: Counter Clockwise rotation (CCW)

# Return Code(s)

```txt
NoError 0
ErrorInvalidCardNumber -1
```

ErrorInvalidIoChannel -6

ERRORInvalidParameter -218

ERROROnTheFly -219

CW
A/B phase
![| Phase | Count |\n|-------|-------|\n| A phase | 1 |\n| A phase | 2 |\n| A phase | 3 |\n| A phase | 4 |\n| A phase | 5 |\n| A phase | 6 |\n| A phase | 7 |\n| A phase | 8 |\n| A phase | 9 |\n| A phase | 10 |\n| A phase | 11 |\n| A phase | 12 |\n| A phase | 13 |\n| A phase | 14 |\n| A phase | 15 |\n| A phase | 16 |\n| B phase | 1 |\n| B phase | 2 |\n| B phase | 3 |\n| B phase | 4 |\n| B phase | 5 |\n| B phase | 6 |\n| B phase | 7 |\n| B phase | 8 |\n| B phase | 9 |\n| B phase | 10 |\n| B phase | 11 |\n| B phase | 12 |\n| B phase | 13 |\n| B phase | 14 |\n| B phase | 15 |\n| B phase | 16 |](.eos-1300-manual-en-20180110-v1/7929e4c49e2f0f64512f994347cbec79ba99ff50184ee812be5f1ff92b484931.jpg)

Figure 2-5: Encoder input direction signals A/B phase CW

CCW
A/B phase
A phase
![Pure electrical circuit lines without any symbols](.eos-1300-manual-en-20180110-v1/65f01ce5e2979421d137db9a5d1d089ef11aa09ed01c730fdffcc9d4f060f211.jpg)

B phase
![Pure electrical circuit lines without any symbols](.eos-1300-manual-en-20180110-v1/edceb1cc6a7cbfc8060d302fbe9b1db9c58a8a8d9152389bf0250f5e24c63b6c.jpg)

Count

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Figure 2-6: Encoder input direction signals A/B phase CCW

GetComparedTriggerSource

Acquires encoder source of each compared trigger.

# Syntax

C/C++

I16 SetComparedTriggerSource(U16 CardNumber, U16 ComparedTrigger, U16 Source)

VB.Net

GetComparedTriggerSource(ByVal CardNumber As ushort, ByVal ComparedTrigger As ushort, ByRef Source As ushort) As Short

C#

I16 GetComparedTriggerSource(U16 CardNumber, U16 ComparedTrigger, out ushort Source)

# Parameters

CardNumber:

ID of the card performing the operation.

ComparedTrigger:

0 to 3: Linear mode 0 to 3

4 to 7: FIFO mode 0 to 3

Source:

0: Encoder 0

1: Encoder 1

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# SetComparedTriggerSource

Sets encoder source of each compared trigger.

Syntax

C/C++

I16 SetComparedTriggerSource(U16 CardNumber, U16 ComparedTrigger, U16 Source)

# VB.Net

SetComparedTriggerSource(ByVal CardNumber As ushort, ByVal ComparedTrigger As ushort, ByVal Source As ushort) As Short

C#

I16 SetComparedTriggerSource(U16 CardNumber, U16 ComparedTrigger, ushort Source)

# Parameters

CardNumber:

ID of the card performing the operation.

ComparedTrigger:

0 to 3: Linear mode 0 to 3

4 to 7: FIFO mode 0 to 3

Source:

0: Encoder 0

1: Encoder 1

![The image displays a simple graphic icon featuring a white document with horizontal gray lines, resembling a checklist or memo pad. A large, bold red checkmark is superimposed diagonally across the paper. The top left corner of the paper is curled slightly.](.eos-1300-manual-en-20180110-v1/ab12e0b92b481a9e68f9fe90faf6b0e9844d791edb55763970b48021d9d0633a.jpg)
NOTE:

Disable SetTriggerEn() and SetEncoderEn() before configuring SetComparedTriggerSource()

# Return Code(s)

NoError 0

ErrorInvalidCardNumber -1

ErrorInvalidIoChannel -6

ERRORInvalidParameter -218

ERROROnTheFly -219

# SetEncoderLatchInt

Interrupt is generated when DI8 or DI9 receive pull high or pull low signal, with corresponding interrupt events signaled. The application uses Win32 wait functions, such as WaitForSingleObject or WaitForMultipleObjects to determine interrupt event status.

# Syntax

C/C++

I16 SetEncoderLatchInt(U16 CardNumber, I16 Int1Mode, I16 Int2Mode, HANDLE \*hEvent)

Linux C/C++

I16 SetEncoderLatchInt(U16 CardNumber, I16 Int1Mode, I16 Int2Mode, void (\*event1\_handler)(int), void (\*event2\_handler)(int))

# Visual Basic

SetEncoderLatchInt(ByVal CardNumber As Integer, ByVal Int1Mode As Integer, ByVal Int2Mode As Integer, hEvent As Long) As Integer

# VB.Net

SetEncoderLatchInt(ByVal CardNumber As Short, ByVal Int1Mode As Short, ByVal Int2Mode As Short, ByRef hEvent() As IntPtr) As Short

C#

short SetEncoderLatchInt(ushort CardNumber, short Int1Mode, short Int2Mode, IntPtr hEvent)

# Parameters

CardNumber:

ID of the card performing the operation.

Int1Mode:

Interrupt mode of INT1 by COS of Line8 of Port 0, with valid values:

INT1\_DISABLE or 0

INT1\_EXT\_SIGNAL or 1

Int2Mode:

Interrupt mode of INT2 by COS of Line9 of Port 0, with valid values:

INT2\_DISABLE or 0

INT2\_EXT\_SIGNAL or 1

hEvent (Windows only):

Returns dual-interrupt event handles, where status of a dual-interrupt event indicates whether an interrupt is generated for cards comprising dual-interrupt system.

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorCardNotRegistered -4
ErrorFuncNotSupport -5
```

# GetEncoderLatchDirection

Acquires direction of encoder latch signal, DI8 and DI9 corresponding to encoder 0 and encoder 1.

# Syntax

```javascript
C/C++
I16 GetEncoderLatchDirection(U16 CardNumber,U16 Channel, U16 *Direction)
```

# VB.Net

GetEncoderLatchDirection(ByVal CardNumber As ushort, ByVal Channel As ushort, ByRef Direction As ushort) As Short

# C#

I16 GetEncoderLatchDirection(U16 CardNumber, U16 Channel, out ushort Direction)

# Parameters

```txt
CardNumber:
ID of the card performing the operation.
Channel:
Indicates Encoder channel, value can b
```

Direction:

Based on the direction of the specific DI signal

0: rising, 1: falling

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# SetEncoderLatchDirection

Sets direction of encoder latch signal, with DI8 and DI9 corresponding to encoder 0 and encoder 1.

# Syntax

C/C++

I16 SetEncoderLatchDirection(U16 CardNumber, U16 Channel, U16 Direction)

VB.Net

SetEncoderLatchDirection(ByVal CardNumber As ushort, ByVal Channel As ushort, ByVal Direction As ushort) As Short

C#

I16 SetEncoderLatchDirection(U16 CardNumber, U16 Channel, ushort Direction)

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates Encoder channel, value can be from 0 to 1.

Direction:

Based on the direction of the specific DI signal

0: rising, 1: falling

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# GetEncoderLatchData

Acquires encoder0 count when DI8 is rising or falling (set by SetEncoderLatchDirection) and acquires encoder1 count when DI9 is rising or falling.

# Syntax

```txt
C/C++
I16 GetEncoderLatchData(U16 CardNumber, U16 Channel, I32 *Count)
```

# VB.Net

GetEncoderLatchData(ByVal CardNumber As ushort, ByVal Channel As ushort, ByRef Count As int) As Short

# C#

I16 GetEncoderLatchData(ushort CardNumber, ushort Channel, out int Count

# Parameters

CardNumber:

ID of the card performing the operation.

Channel:

Indicates Encoder channel, value can be from 0 to 1.

Count:

Indicates the count value by 2's complement.

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
```

ERROROnTheFly -219

When Encoder Latch Switch (Encoder0: DI8; Encoder1: DI9) changes value, latch the encoder counter number.

![Encoder_start &\nEncoder_en\nA phase\nCnt_num 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16\nTrig_cc_o\nEncoder_latch_switch\nEncoder_latch 0 1 6 11](.eos-1300-manual-en-20180110-v1/c64a60115380f6d5e98a1ae1b4dfc2fcc1befbe0f9e60f066578acd747a6a35a.jpg)

Figure 2-7: Encoder Mode A Phase with Encoder Latch (rising edge)

![Encoder_start &\nEncoder_en\nA phase\nCnt_num 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16\nTrig_cc_o\nEncoder_latch_switch\nEncoder_latch 0 4 9 14](.eos-1300-manual-en-20180110-v1/549a7d1ace4f825757d5ed8d893650cadfb4e112d84d1d7450066ad3b5d1adec.jpg)

Figure 2-8: Encoder Mode A Phase with Encoder Latch (falling edge)

# GetFIFOBufferUsage

Acquires the number of comparison values in FIFO buffer.

# Syntax

C/C++

I16 GetFIFOBufferUsage(U16 CardNumber, U16 ComparedTrigger, U16 \*Count)

# VB.Net

GetFIFOBufferUsage(ByVal CardNumber As ushort, ByVal ComparedTriggerAs ushort, ByRef Count As ushort) As Short

C#

I16 GetFIFOBufferUsage(ushort CardNumber, ushort ComparedTrigger, out ushort Count)

# Parameters

CardNumber:

ID of the card performing the operation.

ComparedTrigger:

0 to 3: FIFO mode 0 to 3.

Count:

0 to 1023, where

0: Buffer empty

1 to 1022: Buffer populated

1023: Buffer full

# Return Code(s)

NoError 0

ErrorInvalidCardNumber -1

ErrorInvalidIoChannel -6

ERRORInvalidParameter -218

ERROROnTheFly -219

# GetFIFOBufferFreeSpace

Acquires the amount of space remaining in FIFO buffer.

# Syntax

C/C++

I16 GetFIFOBufferFreeSpace(U16 CardNumber, U16 ComparedTrigger, U16 \*Count)

VB.Net

GetFIFOBufferFreeSpace(ByVal CardNumber As ushort, ByVal ComparedTriggerAs ushort, ByRef Count As ushort) As Short

C#

I16 GetFIFOBufferFreeSpace(ushort CardNumber, ushort ComparedTrigger, out ushort Count)

# Parameters

CardNumber:

ID of the card performing the operation.

ComparedTrigger:

0 to 3: FIFO mode 0 to 3.

Count:

0 to 1023, where

0: Buffer full

1 to 1022: Buffer populated

1023: Buffer empty

# Return Code(s)

NoError 0

ErrorInvalidCardNumber -1

ErrorInvalidIoChannel -6

ERRORInvalidParameter -218

ERROROnTheFly -219

# GetFIFOBufferState

Acquires whether the FIFO buffer is populated.

Syntax

C/C++

I16 GetFIFOBufferState(U16 CardNumber, U16 ComparedTrigger, U16 \*State)

# VB.Net

GetFIFOBufferState(ByVal CardNumber As ushort, ByVal ComparedTriggerAs ushort, ByRef State As ushort) As Short

C#

I16 GetFIFOBufferState(ushort CardNumber, ushort ComparedTrigger, out ushort State)

# Parameters

CardNumber:

ID of the card performing the operation.

ComparedTrigger:

0 to 3: FIFO mode 0 to 3.

State:

0: Buffer empty

1: Buffer populated

2: Buffer full

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# GetFIFOBufferData

Acquires the latest comparison value from FIFO buffer.

# Syntax

C/C++

I16 GetFIFOBufferData(U16 CardNumber,U16 ComparedTrigger,I32 \*Value)

VB.Net

GetFIFOBufferData(ByVal CardNumber As ushort, ByVal ComparedTrigger As ushort, ByRef Value As I32) As Short

C#

I16 GetFIFOBufferData(ushort CardNumber, ushort ComparedTrigger,out int Value)

# Parameters

CardNumber:

ID of the card performing the operation.

ComparedTrigger:

0 to 3: FIFO mode 0 to 3.

Value:

The latest comparison value in FIFO buffer (2's complement).

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
```

# SetFIFOBufferData

Sets comparison value in FIFO buffer.

# Syntax

C/C++

I16 SetFIFOBufferData(U16 CardNumber,U16 ComparedTrigger, I32 Value)

VB.Net

SetFIFOBufferData(ByVal CardNumber As ushort, ByVal ComparedTriggerAs ushort, ByVal Value As I32) As Short

C#

I16 SetFIFOBufferData(ushort CardNumber, ushort ComparedTrigger, int Value)

# Parameters

CardNumber:

ID of the card performing the operation.

ComparedTrigger:

0 to 3: FIFO mode 0 to 3.

Value:

The comparison value in FIFO buffer (2's complement).

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
ERROROnTheFly -219
ERRORFIFOFull -220
```

# ResetEncoderCount

Resets encoder count.

# Syntax

```javascript
C/C++
I16 ResetEncoderCount(U16 CardNumber, U16 Channel)
```

# VB.Net

ResetEncoderCount(ByVal CardNumber As ushort, ByVal Channel As ushort) As Short

# C#

I16 ResetEncoderCount(U16 CardNumber, U16 Channel)

# Parameters

CardNumber:

ID of the card performing the operation.

# Channel:

Indicates the channel of Encoder, value can be from 0 to 1.

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
```

# ResetFIFOBuffer

Clears all data from the FIFO buffer.

# Syntax

```javascript
C/C++
I16 ResetFIFOBuffer(U16 CardNumber, U16 ComparedTrigger)
```

# VB.Net

```txt
ResetFIFOBuffer(ByVal CardNumber As ushort, ByVal ComparedTrigger As ushort) As Short
```

# C#

```txt
I16 ResetFIFOBuffer(U16 CardNumber, U16 ComparedTrigger)
```

# Parameters

CardNumber:

ID of the card performing the operation.

ComparedTrigger:

0 to 3: FIFO mode 0 to 3.

# Return Code(s)

```batch
NoError 0
ErrorInvalidCardNumber -1
ErrorInvalidIoChannel -6
ERRORInvalidParameter -218
```

This page intentionally left blank.

# Important Safety Instructions

For user safety, please read and follow all instructions, Warnings, Cautions, and Notes marked in this manual and on the associated device before handling/operating the device, to avoid injury or damage.

S'il vous plaît prêter attention stricte à tous les avertissements et mises en garde figurant sur l'appareil, pour éviter des blessures ou des dommages.

▶ Read these safety instructions carefully
- Keep the User’s Manual for future reference
▶ Read the Specifications section of this manual for detailed information on the recommended operating environment
The device can be operated at an ambient temperature of $55^{\circ}$ C (with DC supply) and $50^{\circ}$ C (with adapter supply);
- When installing/mounting or uninstalling/removing device; or when removal of a chassis cover is required for user servicing (See “DI/O Function Library” on page 5.):

▷ Turn off power and unplug any power cords/cables
▶ Reinstall all chassis covers before restoring power

▶ To avoid electrical shock and/or damage to device:

▷ Keep device away from water or liquid sources
▷ Keep device away from high heat or humidity
▷ Keep device properly ventilated (do not block or cover ventilation openings)
▶ Always use recommended voltage and power source settings
▶ Always install and operate device near an easily accessible electrical outlet
▷ Secure the power cord (do not place any object on/over the power cord)
▶ Only install/attach and operate device on stable surfaces and/or recommended mountings

▶ If the device will not be used for long periods of time, turn off and unplug from its power source

▶ Never attempt to repair the device, which should only be serviced by qualified technical personnel using suitable tools
▶ A Lithium-type battery may be provided for uninterrupted backup or emergency power.

![A yellow triangular warning sign with a black border containing a black exclamation point in the center.](.eos-1300-manual-en-20180110-v1/2e1adc6b478077eaffb0a050dbeeba6a8ff2c85d057f9a3ff6fc16fd6c934661.jpg)
CAUTION:

Risk of explosion if battery is replaced with one of an incorrect type; please dispose of used batteries appropriately.

Risque d'explosion si la pile est remplacée par une autre de type incorrect. Veuillez jeter les piles usagées de façon appropriée.

▶ The device must be serviced by authorized technicians when:

The power cord or plug is damaged
▷ Liquid has entered the device interior
The device has been exposed to high humidity and/or moisture
The device is not functioning or does not function according to the User's Manual
The device has been dropped and/or damaged and/or shows obvious signs of breakage

▶ Disconnect the power supply cord before loosening the thumbscrews and always fasten the thumbscrews with a screwdriver before starting the system up

It is recommended that the device be installed only in a server room or computer room where access is:

▶ Restricted to qualified service personnel or users familiar with restrictions applied to the location, reasons therefor, and any precautions required

▶ Only afforded by the use of a tool or lock and key, or other means of security, and controlled by the authority responsible for the location

▶ If PoE (Power over Ethernet) is enabled for the device, the system can ONLY be deployed indoors. Unless otherwise noted, the PoE system is NOT designed to withstand the rigors of outdoor use.

![Yellow triangular warning sign with black smoke symbol indicating hot weather](.eos-1300-manual-en-20180110-v1/79739ee16e79c5d8bb29454f9301530c92632ba1971290bcde606ea08e1d6396.jpg)

# BURN HAZARD

Touching this surface could result in bodily injury. To reduce risk, allow the surface to cool before touching.

# RISQUE DE BRÛLURES

Ne touchez pas cette surface, cela pourrait entraîner des blessures.

Pour éviter tout danger, laissez la surface refroidir avant de la toucher.

This page intentionally left blank.

# Getting Service

Ask an Expert: http://askanexpert.adlinktech.com

# ADLINK Technology, Inc.

Address: 9F, No.166 Jian Yi Road, Zhonghe District

New Taipei City 235, Taiwan

新北市中和區建一路 166 號 9 樓

Tel: +886-2-8226-5877

Fax: +886-2-8226-5717

Email: service@adlinktech.com

# Ampro ADLINK Technology, Inc.

Address: 5215 Hellyer Avenue, #110

San Jose, CA 95138, USA

Tel: +1-408-360-0200

Toll Free: +1-800-966-5200 (USA only)

Fax: +1-408-360-0222

Email: info@adlinktech.com

# ADLINK Technology (China) Co., Ltd.

Address: 上海市浦东新区张江高科技园区芳春路 300 号 (201203)

300 Fang Chun Rd., Zhangjiang Hi-Tech Park

Pudong New Area, Shanghai, 201203 China

Tel: +86-21-5132-8988

Fax: +86-21-5132-3588

Email: market@adlinktech.com

# ADLINK Technology Beijing

Address: 北京市海淀区上地东路 1 号盈创动力大厦 E 座 801 室(100085)

Rm. 801, Power Creative E, No. 1 Shang Di East Rd.

Beijing, 100085 China

Tel: +86-10-5885-8666

Fax: +86-10-5885-8626

Email: market@adlinktech.com

# ADLINK Technology Shenzhen

Address: 深圳市南山区科技园南区高新南七道 数字技术园

A1 栋 2 楼 C 区 (518057)

2F, C Block, Bldg. A1, Cyber-Tech Zone, Gao Xin Ave. Sec. 7

High-Tech Industrial Park S., Shenzhen, 518054 China

Tel: +86-755-2643-4858

Fax: +86-755-2664-6353

Email: market@adlinktech.com

# LiPPERT ADLINK Technology GmbH

Address: Hans-Thoma-Strasse 11

D-68163 Mannheim, Germany

Tel: +49-621-43214-0

Fax: +49-621 43214-30

Email: emea@adlinktech.com

# PENTA ADLINK Technology GmbH

Ulrichsbergerstrasse 17

94469 Deggendorf, Germany

Tel: +49 (0) 991 290 94 - 10

Fax: +49 (0) 991 290 94 - 29

Email: emea@adlinktech.com

# ADLINK Technology, Inc. (French Liaison Office)

Address: 6 allée de Londres, Immeuble Ceylan
91940 Les Ulis, France

Tel: +33 (0) 1 60 12 35 66

Fax: +33 (0) 1 60 12 35 66

Email: france@adlinktech.com

# ADLINK Technology Japan Corporation

Address: 〒101-0045 東京都千代田区神田鍛冶町 3-7-4
神田 374 ビル 4F
KANDA374 Bldg. 4F, 3-7-4 Kanda Kajicho,
Chiyoda-ku, Tokyo 101-0045, Japan

Tel: +81-3-4455-3722

Fax: +81-3-5209-6013

Email: japan@adlinktech.com

# ADLINK Technology, Inc. (Korean Liaison Office)

Address: 경기도 성남시 분당구 수내로 46 번길 4 경동빌딩 2 층 (수내동 4-4 번지) (우) 463-825
2F, Kyungdong B/D, 4 Sunae-ro 46 beon-gil
Bundang-gu, Seongnam-si, Gyeonggi-do, Korea, 463-825

Toll Free +82-80-800-0585

Tel +82-31-786-0585

Fax +82-31-786-0583

Email: korea@adlinktech.com

# ADLINK Technology Singapore Pte. Ltd.

Address: 84 Genting Lane #07-02A, Cityneon Design Centre Singapore 349584

Tel: +65-6844-2261

Fax: +65-6844-2263

Email: singapore@adlinktech.com

# ADLINK Technology Singapore Pte. Ltd. (Indian Liaison Office)

Address: #50-56, First Floor, Spearhead Towers Margosa Main Road (between 16th/17th Cross) Malleswaram, Bangalore - 560 055, India

Tel: +91-80-65605817, +91-80-42246107

Fax: +91-80-23464606

Email: india@adlinktech.com

# ADLINK Technology, Inc. (Israeli Liaison Office)

Address: 27 Maskit St., Corex Building
PO Box 12777
Herzliya 4673300, Israel

Tel: +972-54-632-5251

Fax: +972-77-208-0230

Email: israel@adlinktech.com

# ADLINK Technology, Inc. (UK Liaison Office)

Tel: +44 774 010 59 65

Email: UK@adlinktech.com
[🔗 Link to the original document](.eos-1300-manual-en-20180110-v1/eos-1300-manual-en-20180110-v1.pdf)
