# PCIe-GIE7x Series

# Function Library Reference

Manual Rev.: 1.0

Revision Date: July 14, 2017

Part No: 50-11178-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>July 14, 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.

![The image shows a white document icon with a folded top-left corner. Horizontal grey lines run across the lower portion of the paper, and a large, bold red checkmark is superimposed in the center.](.pcie-gie7xflr-50-11178-2000-10/7a3e8656ae9bad60869f551691dddc7e81c66b16845133949e7ad42dae286013.jpg)
NOTE:

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

![The image displays a yellow triangular warning sign with a black border. Centered inside the triangle is a black exclamation point.](.pcie-gie7xflr-50-11178-2000-10/87951f7a2f6c89fd3443e2c05a35ed0f7896c536bfa1f23213e107e1f7e0d04a.jpg)
CAUTION:

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

![A red triangular warning sign with a white border containing a large white exclamation mark in the center.](.pcie-gie7xflr-50-11178-2000-10/1f2b3b968278ba82d4d2774bc476ebd0e03c41bb8029f5a3ab1c3e288156d9b2.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

# 1 Introduction ......

1.1 Setting Up the Build Environment... 1

# 2 Function Library ............. 3

2.1 List of Functions..... 3
2.2 Function Library ..... 4

2.2.1 Device Control Functions ...... 4
2.2.2 Power Management Functions... 8
2.2.3 License Management Functions... . 22
2.2.4 Trigger over Ethernet Functions .... .. 28

# Important Safety Instructions ....... 4 1

# Getting Service.......... 45

This page intentionally left blank.

# 1 Introduction

The PCIe-GIE7X Function Library Reference provides necessary API details, where functions can develop power management, Trigger over Ethernet, and License Management applications in C/ C++, C#/VB.Net. Once the driver is installed, the PCIe-GIE7X is listed in the ADLINK Smart GigE Utility, as shown.

![ADLINK Smart GGE Tool\nFile View Help\nADLINK DEVICE\nVOLUME RD\nPCIe-00174_Ca#0_M3\nPort1\nPort2\nPort3\nPort4\n# Port 1\nVoltage 54.5\nCurrent 0.039\nWatt (W) 2.1\n# Port 2\nVoltage 0\nCurrent 0\nWatt (W) 0\n# Port 3\nVoltage 0\nCurrent 0\nWatt (W) 0\n# Port 4\nVoltage 0\nCurrent 0\nWatt (W) 0\n# Port Status\nDevice Version\nPioneer Version 2017/06\nNOSI Version 1.53\nPOE Budget\nCurrent Power Input(W) 2.1\nReversing Current Budget(W) 16\nRetired Power(W) 4\nTotal Power Budget(W) 20\nPOE Switch\nPort HW Switch (SW-1) Enable\nPort Iload Switch (SW-2) On\nPortState (Power)\nPort1 Enable\nPort2 Enable\nPort3 Enable\nPort4 Enable\nTemperature Protection\nOver Temperature No.\n# Temperature\nCohort 44\nPort1\nPort2\nPort3\nPort4\nPort1\nPort2\nPort3\nPort4\nPort1\nPort2\nPort3\nPort4\nPort1\nPort2\nPort3\nPort4\nPort1\nPort2\nPort3\nPort4\nPort1\nPort2\nPort3\nPort4\nPort1\nPort2\nPort3\nPort4](.pcie-gie7xflr-50-11178-2000-10/1a93b112c3b9fc10efacee49862269682728c3b2c5c10f094f925ef80855804e.jpg)

# 1.1 Setting Up the Build Environment

All files are located in the directory \ADLINK\PCIe-GIE7X\Include

<table><tr><td>File Type</td><td>File</td><td>Description</td><td>Required by</td></tr><tr><td rowspan="3">Include</td><td>SmartPoE.h.</td><td>Header file required for all C/C++ applications</td><td rowspan="4">All applications using APIs</td></tr><tr><td>SmartPoE.vb</td><td>Function definitions required for all VB.Net applications</td></tr><tr><td>SmartPoE.cs</td><td>Function definitions required for all C# applications</td></tr><tr><td>DLL</td><td>SmartPoE.dll</td><td>Dynamic link library required for all applications</td></tr><tr><td>Library</td><td>SmartPoE.lib</td><td>Exports API function definitions, required for all Visual C/C++ applications</td><td>All C/C++ applications using APIs</td></tr></table>

# 2 Function Library

# 2.1 List of Functions

<table><tr><td>Category</td><td>Function</td><td>Cards</td></tr><tr><td rowspan="5">Device Control</td><td>SmartPoE_Register_Card</td><td rowspan="3">PCIe-GIE64, PCIe-GIE7X</td></tr><tr><td>SmartPoE_Release_Card</td></tr><tr><td>SmartPoE_Get_ID</td></tr><tr><td>SmartPoE_Get_CPLDVersion</td><td rowspan="2">PCIe-GIE7X</td></tr><tr><td>SmartPoE_Get_MCUVersion</td></tr><tr><td rowspan="16">Power Management</td><td>SmartPoE_Power_Enable</td><td rowspan="16">PCIe-GIE64, PCIe-GIE7X</td></tr><tr><td>SmartPoE_Get_Power_Enable</td></tr><tr><td>SmartPoE_Get_PoEstate</td></tr><tr><td>SmartPoE_Get_PoEPortLaststate</td></tr><tr><td>SmartPoE_Get_Temperature</td></tr><tr><td>SmartPoE_Get_HighTemperature</td></tr><tr><td>SmartPoE_Get_LowTemperature</td></tr><tr><td>SmartPoE_Set_HighTemperature</td></tr><tr><td>SmartPoE_Set_LowTemperature</td></tr><tr><td>SmartPoE_Get_PortStatus</td></tr><tr><td>SmartPoE_Get_PSEPortCurrent</td></tr><tr><td>SmartPoE_Get_PSEPortVoltage</td></tr><tr><td>SmartPoE_Get_PoEConsPowbudget</td></tr><tr><td>SmartPoE_Get_PoELeftPowbudget</td></tr><tr><td>SmartPoE_Get_PowerBudgetControl</td></tr><tr><td>SmartPoE_Set_PowerBudgetControl</td></tr><tr><td rowspan="6">License Management</td><td>AD_InstallSecret</td><td rowspan="6">PCIe-GIE7X PRO</td></tr><tr><td>AD_SetMasterSecret</td></tr><tr><td>AD_EncryptReadSegment</td></tr><tr><td>AD_EncryptComputeEnc</td></tr><tr><td>AD_EncryptAuthWritePageEnc</td></tr><tr><td>AD_ReadInstallSecretStatus</td></tr><tr><td rowspan="16">Trigger over Ethernet</td><td>GIE_Set_ActionCommand</td><td rowspan="16">PCIe-GIE7X PRO</td></tr><tr><td>GIE_Get_ActionCommand</td></tr><tr><td>GIE_Send_ActionCommand</td></tr><tr><td>GIE_Send_AllActionCommand</td></tr><tr><td>GIE_GetTriggerSource</td></tr><tr><td>GIE_SetTriggerSource</td></tr><tr><td>GIE_GetTriggerMode</td></tr><tr><td>GIE_SetTriggerMode</td></tr><tr><td>GIE_GetTriggerActivation</td></tr><tr><td>GIE_SetTriggerActivation</td></tr><tr><td>GIE_GetTriggerType</td></tr><tr><td>GIE_SetTriggerType</td></tr><tr><td>GIE_GetTriggerDebounce</td></tr><tr><td>GIE_SetTriggerDebounce</td></tr><tr><td>GIE_GetTriggerCount</td></tr><tr><td>GIE_ResetTriggerCount</td></tr></table>

# 2.2 Function Library

# 2.2.1 Device Control Functions

# SmartPoE\_Register\_Card

Initializes a specified device, should be called before other functions except those with no Number parameter.

# Syntax

C/C++

short SmartPoE\_Register\_Card (unsigned short card\_num)

# Parameter(s)

Card\_num:

Indicates the number of devices, beginning at 0 for the number of the first card, with the second card 1, and so on.

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-3 The count of calling SmartPoE\_Register\_Card need to be less than 32
-13 Driver is not found or there is no card exists

# SmartPoE\_Release\_Card

Closes the device and releases all allocated resources, should be called before terminating the application.

# Syntax

C/C++

short SmartPoE\_Release\_Card (unsigned short wCardNumber)

# Parameter(s)

wCardNumber:

Indicates the value returned from calling

SmartPoE\_Register\_Card.

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-4 Call SmartPoE\_Register\_Card before other functions

# SmartPoE\_Get\_ID

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

short SmartPoE\_Get\_ID (unsigned short wCard-Number, unsigned short \*wID)

# Parameter(s)

wCardNumber:

Acquired from the return value of SmartPoE\_Register\_Card wID:

Indicates card ID set by S1 switch, a value from 0 to 15. Card ID and S1 switch settings correlate as shown

<table><tr><td rowspan="2">Card ID</td><td colspan="4">S1 switch</td></tr><tr><td>4</td><td>3</td><td>2</td><td>1</td></tr><tr><td>0</td><td>off</td><td>off</td><td>off</td><td>off</td></tr><tr><td>1</td><td>off</td><td>off</td><td>off</td><td>on</td></tr><tr><td>2</td><td>off</td><td>off</td><td>on</td><td>off</td></tr><tr><td>3</td><td>off</td><td>off</td><td>on</td><td>on</td></tr><tr><td>4</td><td>off</td><td>on</td><td>off</td><td>off</td></tr><tr><td>5</td><td>off</td><td>on</td><td>off</td><td>on</td></tr><tr><td>6</td><td>off</td><td>on</td><td>on</td><td>off</td></tr><tr><td>7</td><td>off</td><td>on</td><td>on</td><td>on</td></tr><tr><td>8</td><td>on</td><td>off</td><td>off</td><td>off</td></tr><tr><td>9</td><td>on</td><td>off</td><td>off</td><td>on</td></tr><tr><td>10</td><td>on</td><td>off</td><td>on</td><td>off</td></tr><tr><td>11</td><td>on</td><td>off</td><td>on</td><td>on</td></tr><tr><td>12</td><td>on</td><td>on</td><td>off</td><td>off</td></tr><tr><td>13</td><td>on</td><td>on</td><td>off</td><td>on</td></tr><tr><td>14</td><td>on</td><td>on</td><td>on</td><td>off</td></tr><tr><td>15</td><td>on</td><td>on</td><td>on</td><td>on</td></tr></table>

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card

# SmartPoE\_Get\_CPLDVersion

Retrieves CPLD version.

# Syntax

C/C++

short SmartPoE\_Get\_CPLDVersion(unsigned short wCardNumber, unsigned long \*wVersion1, unsigned long \*wVersion2 )

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card

wVersion1:

7:0 Date

15:8 Month

31:16 Year

wVersion2:

7:0 Minute

15:8 Hour

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card

# SmartPoE\_Get\_MCUVersion

Retrieves the PoE MCU version.

# Syntax

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

short SmartPoE\_Get\_MCUVersion (unsigned short wCardNumber, unsigned short wVersion)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

wVersion:

Bit 0 to 3: minor number

Bit 4 to 7: major number

For example V1.3

Bit 0 to 3: minor number, in this case 3

Bit 4 to 7: major number, in this case 1

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card

# 2.2.2 Power Management Functions

# SmartPoE\_Power\_Enable

Controls power auto/off.

# Syntax

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

short SmartPoE\_Power\_Enable (unsigned short wCardNumber, unsigned short wEnPort1, unsigned short wEnPort2, unsigned short wEnPort3, unsigned short wEnPort4)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

wEnPort1, wEnPort2, wEnPort3, wEnPort4:

Indicates power mode of the Smart PoE port with:

0: power off

1: auto mode (enables port line detection)

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card

# SmartPoE\_Get\_Power\_Enable

Retrieves power auto/off.

# Syntax

C/C++

short SmartPoE\_Get\_Power\_Enable (unsigned short wCardNumber, unsigned short \*wEnPort1, unsigned short \*wEnPort2, unsigned short \*wEnPort3, unsigned short \*wEnPort4)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

wEnPort1, wEnPort2, wEnPort3, wEnPort4:

Indicates power mode of the Smart PoE port with:

0: power off

1: auto mode (enables port line detection)

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card

# SmartPoE\_Get\_PoEstate

Retrieves PoE state.

# Syntax

short SmartPoE\_Get\_PoEstate (unsigned short wCardNumber, unsigned char \*bPoEstatePA0, unsigned char \*bPoEstatePA1, unsigned char \*bPoEstatePowerBudget, unsigned char \*bPoEstatePA4, unsigned char \*bPoEstatePA3, unsigned char \*bPoEstatePF0)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

wPoEstate:

bPoEstatePA0: (PA0)

0: PoE-PSE HW setting disabled

1: PoE-PSE HW setting enabled

bPoEstatePA1: (PA1)

0: PoE-PSE should be turned off when powered on

1: PoE-PSE should be turned on when powered on.

bPoEstatePowerBudget: (PA5 and PB1)

00: power budget = 61.6W

01: power budget = 120W

10: power budget = 20W

```txt
11: power budget = 61.6W
bPoEstatePA4: (PA4)
0: 52V off, PoE-PSE is down
1: 52V on, PoE-PSE is on
bPoEstatePA3: (PA3) INT state of thermal sensor (Low Active)
0: over temperature interrupt arise
1: no interrupt
bPoEstatePF0: (PF0) Port numbers
0: 4 PoE ports
1: 2 PoE ports (port 1 and port 2)
```

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

```txt
-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE_Get_MCUVersion
```

# SmartPoE\_Get\_PoEPortLaststate

Retrieves the PoEPort Last State. MCU recovers POE-PSE Port Last State when PSE is off/on.

# Syntax

```txt
C/C++
Short SmartPoE_Get_POEPortLaststate (unsigned short wCardNumber, unsigned short * wPOEstate)
```

# Parameter(s)

```txt
wCardNumber:
Retrieved from the return value of SmartPoE_Register_Card.
```

wPOEstate:

Bit 0:

0 : port 1 power not enabled

1 : port 1 power enabled

Bit 1:

0 : port 2 power not enabled

1 : port 2 power enabled

Bit 2: (if there are only 2 POE ports, this bit is always 0)

0 : port 3 power not enabled

1 : port 3 power enabled

Bit 3: (if there are only 2 POE ports, this bit is always 0)

0 : port 4 power not enabled, or there are only 2 POE ports

1 : port 4 power enabled

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32

-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion

# SmartPoE\_Get\_Temperature

Retrieves thermal temperature.

# Syntax

C/C++

short SmartPoE\_Get\_Temperature (unsigned short wCardNumber, double \*wTemperature)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

wTemperature:

Thermal temperature in °C.

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion

# SmartPoE\_Get\_HighTemperature

Retrieves the High Temperature setting.

# Syntax

C/C++

short SmartPoE\_Get\_HighTemperature (unsigned short wCardNumber, unsigned short \*wTemperature)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

wHighTemperature:

High Temperature setting, not exceeding 150°C.

1 byte data in 1°C unit.

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion

# SmartPoE\_Get\_LowTemperature

Retrieves Low Temperature setting (cannot exceed High Temperature setting).

# Syntax

C/C++

short SmartPoE\_Get\_LowTemperature (unsigned short wCardNumber, unsigned short \* wLowTemperature)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

wLowTemperature:

Low Temperature setting (cannot exceed High Temperature setting

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion

# SmartPoE\_Set\_HighTemperature

High Temperature setting.

# Syntax

C/C++

short SmartPoE\_Set\_HighTemperature (unsigned short wCardNumber, unsigned short wHighTemperature)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

wHighTemperature:

High Temperature setting, more than or equal to $8 0 ^ { \circ } \mathsf { C }$ , not exceeding $1 3 0 ^ { \circ } \mathsf { C }$ , and at least $1 0 ^ { \circ } \mathsf { C }$ higher than the Low Temperature setting.

1 byte data in $1 ^ { \circ } \mathsf { C }$ unit.

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion
-11 The input argument(s) exceed the allowed range.

# SmartPoE\_Set\_LowTemperature

Low Temperature setting.

# Syntax

C/C++

short SmartPoE\_Set\_LowTemperature (unsigned short wCardNumber, unsigned short wLowTemperature)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

wLowTemperature:

Low Temperature setting, equal to or exceeding $7 0 \textdegree$ and at least $1 0 ^ { \circ } \mathsf { C }$ lower than the High Temperature setting.

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion
-11 The input argument(s) exceed the allowed range.

![The image displays an icon of a white document or piece of paper with a folded top-left corner. Faint gray horizontal lines are visible across the paper, and a large, bold red checkmark is superimposed over it.](.pcie-gie7xflr-50-11178-2000-10/e88c81d224b6f0474bc5162e31ae1a4cf4271b67778789d4cfb16650c8e96057.jpg)
NOTE:

High Temperature and Low Temperature settings must be more than 10°C apart.

# SmartPoE\_Get\_PortStatus

Retrieves Port Status.

# Syntax

C/C++

short SmartPoE\_Get\_PortStatus (unsigned short wCardNumber, unsigned short PortNumber, unsigned char \* bstateClass, unsigned char \* bstatePowerGood)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

PortNumber:

Indicates port number from 1 to 4.

wstate:

bstateClass:

0:Unknow

1:Class 1

2:Class 2
3:Class 3
4:Class 4
5:Class 5
6:Class 0
7:Current limit

<table><tr><td>bstateClass</td><td>PoE CLASS</td></tr><tr><td>000</td><td>Unknown</td></tr><tr><td>001</td><td>1</td></tr><tr><td>010</td><td>2</td></tr><tr><td>011</td><td>3</td></tr><tr><td>100</td><td>4</td></tr><tr><td>101</td><td>5</td></tr><tr><td>110</td><td>0</td></tr><tr><td>111</td><td>Current limit</td></tr></table>

bstatePowerGood:

1: PowerGood

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion

# SmartPoE\_Get\_PSEPortCurrent

Retrieves port current.

Syntax

C/C++

short SmartPoE\_Get\_PSEPortCurrent(unsigned short wCardNumber, unsigned short PortNumber double \*wCurrent)

# Parameter(s)

wCardNumber:

Retrieved from the return value of

SmartPoE\_Register\_Card.

PortNumber:

Indicates port number from 1 to 4.

wCurrent:

Port current

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32

-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion

# SmartPoE\_Get\_PSEPortVoltage

Retrieves port voltage.

# Syntax

C/C++

short SmartPoE\_Get\_PSEPortVoltage (unsigned short wCardNumber, unsigned short PortNumber double \*wVoltage)

# Parameter(s)

wCardNumber:

Retrieved from the return value of

SmartPoE\_Register\_Card.

PortNumber:

Indicates port number from 1 to 4.

wVoltage:

Port voltage

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion

# SmartPoE\_Get\_PoEConsPowbudget

Retrieves the Consumed Power budget.

# Syntax

C/C++

short SmartPoE\_Get\_POEConsPowbudget(unsigned short wCardNumber, double \* wPower)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

wPower:

Consumed Power budget in W.

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion

# SmartPoE\_Get\_PoELeftPowbudget

Retrieves the Left Power budget.

# Syntax

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

```txt
short SmartPoE_Get_POELeftPowbudget(unsigned short wCardNumber, double *wPower)
```

# Parameter(s)

```txt
wCardNumber:
```

```txt
Retrieved from the return value of SmartPoE_Register_Card.
```

```txt
wPower:
```

```txt
Left Power budget in W.
```

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

```txt
-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE_Get_MCUVersion
```

# SmartPoE\_Get\_PowerBudgetControl

Retrieves power budget control status.

# Syntax

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

```txt
short SmartPoE_Get_PowerBudgetControl(unsigned short wCardNumber, unsigned short * wMode)
```

# Parameter(s)

```txt
wCardNumber:
```

```txt
Retrieved from the return value of SmartPoE_Register_Card.
```

```txt
wMode:
```

```txt
Mode: 0 (Turn off power budget control)
```

```txt
Mode: 1 (Turn on power budget control)
```

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion

# SmartPoE\_Set\_PowerBudgetControl

Sets power budget control status.

# Syntax

C/C++

short SmartPoE\_Set\_PowerBudgetControl(unsigned short wCardNumber, unsigned short wMode)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

wMode:

Mode: 0 (Turn off power budget control.)

Mode: 1 (Turn on power budget control.)

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion

# 2.2.3 License Management Functions

# AD\_InstallSecret

Installs secret on DS28C22, and can, optionally, lock the secret (irreversible).

# Syntax

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

```txt
short AD_InstallSecret(unsigned short wCardNumber, unsigned char *MasterSecret, bool lockbit)
```

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

MasterSecret:

32 byte buffer with new secret (or partial).

LockBit:

Allows secret to be write-protected, where it is read as protected by hardware design. Once set, secret protection cannot be reset.

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion
-12 An invalid secret. (SetMastSecret error)
-15 Secret has been locked.

# AD\_SetMasterSecret

Sets secret on DS28C22.

# Syntax

C/C++

short AD\_SetMasterSecret(unsigned short wCard-Number, unsigned char \*MasterSecret)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

MasterSecret:

32 byte buffer with new secret (or partial).

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion
-12 An invalid secret. (SetMastSecret error)

# AD\_EncryptReadSegment

Performs an encrypted read DS28C22 on an encrypted segment of memory, starting on the specified page at the specified segment offset.

# Syntax

C/C++

short AD\_EncryptReadSegment(unsigned short wCardNumber, unsigned char \*data, unsigned char \*romid, unsigned char \*manid, unsigned char \*read\_mac, unsigned char \*read\_challenge)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

data:

Buffer for data to read (32-byte)

romid:

Buffer containing device 8-byte ROM ID used in encryption.

manid:

Buffer for 2-byte manufacturer ID used in encryption calculation

read\_mac:

Buffer containing 32 bytes of read\_mac

read\_challenge:

Buffer containing 8 bytes of challenge

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion
-12 An invalid secret. (SetMastSecret error)

# AD\_EncryptComputeEnc

Computes encode data.

# Syntax

C/C++

short AD\_EncryptComputeEnc\_ex2(unsigned short wCardNumber, unsigned char \*new\_data, unsigned char \*romid, unsigned char \*manid, unsigned char \*read\_mac, unsigned char \*challenge, unsigned char \*enc\_data, unsigned char \* chk\_mac)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

numBytesTot:

Total bytes to be written to page.

enc\_data:

Buffer containing 32 bytes of data to be written

old\_data:

Buffer containing 32 bytes of data currently in that segment (required for authentication calc.)

romid:

Buffer containing device 8-byte ROM ID used in encryption.

manid:

Buffer for 2-byte manufacturer ID used in encryption calculation

check\_mac:

Buffer containing 32 bytes of check\_mac

read\_challenge:

Buffer containing 8 bytes of challenge

lockdata:

Once set, data protection mode cannot be reset.

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion
-11 An error in lock function.
-70 An error in encryption authentication.

# AD\_EncryptAuthWritePageEnc

Writes up to 32 bytes in WHOLE block segment(s) to EEPROM on provided page using authenticated encryption.

# Syntax

C/C++

short AD\_EncryptAuthWritePageEnc(unsigned short wCardNumber, unsigned short numBytesTot, unsigned char \*enc\_data, unsigned char \*old\_data, unsigned char \*romid, unsigned char \*manid, unsigned char \*chk\_mac, unsigned char \*challenge, bool lockdata)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

numBytesTot:

Total bytes to be written to page.

enc\_data:

Buffer containing 32 bytes of data to be written

old\_data:

Buffer containing 32 bytes of data currently in that segment (required for authentication calc.)

romid:

Buffer containing device 8-byte ROM ID used in encryption.

manid:

Buffer for 2-byte manufacturer ID used in encryption calculation

check\_mac:

Buffer containing 32 bytes of check\_mac

read\_challenge:

Buffer containing 8 bytes of challenge

lockdata:

Once set, data protection mode cannot be reset.

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion
-11 An error in lock function.
-70 An error in encryption authentication.

# AD\_ReadInstallSecretStatus

Retrieves how each individual user memory page can be protected.

# Syntax

C/C++

short AD\_ReadInstallSecretStatus(unsigned short wCardNumber, byte\* InstallBit, byte\* LockDataBit)

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

InstallBit:

0: Non-burned card

1: Burned card

2: Burned card and data locked

LockDataBit:

0: Secret non-locked

1: Secret locked

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card SmartPoE\_Get\_MCUVersion

# 2.2.4 Trigger over Ethernet Functions

# GIE\_Set\_ActionCommand

Sets an ACTION command over the selected port.

# Syntax

C/C++

short GIE\_Set\_ActionCommand(U16 wCardNumber, U16 PortNumber, U32 gActionDeviceKey, U32 gActionGroupKey, U32 gActionGroupMask);

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

PortNumber:

Indicates port number from 1 to 4.

gActionDeviceKey:

Device Key of the command.

gActionGroupKey:

Group Key of the command

gActionGroupMask:

Group Mask of the command

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card.
-77 An invalid IP address.

# GIE\_Get\_ActionCommand

Gets an ACTION command over the selected port.

# Syntax

C/C++

```javascript
short GIE_Get_ActionCommand(U16 wCardNumber, U16 PortNumber, U32 *gActionDeviceKey, U32 *gActionGroupKey, U32 *gActionGroupMask);
```

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

PortNumber:

Indicates port number from 1 to 4.

gActionDeviceKey:

Device Key of the command.

gActionGroupKey:

Group Key of the command

gActionGroupMask:

Group Mask of the command

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card.

# GIE\_Send\_ActionCommand

Sends a software ACTION command over the selected port.

# Syntax

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

```javascript
short GIE_Send_SoftwareActionCommand(U16 wCardNumber, U16 PortNumber);
```

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

PortNumber:

Indicates port number from 1 to 4.

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

```txt
-2 An invalid wCardNumber parameter,
wCardNumber is less than 32
-5 The function is not supported by this card.
```

# GIE\_Send\_AllActionCommand

Sends a software ACTION command over all ports.

# Syntax

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

```txt
short GIE_Send_AllSoftwareActionCommand(U16wCardNumber);
```

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card.

# GIE\_GetTriggerSource

Acquires Trigger over Ethernet function source.

# Syntax

C/C++

short GIE\_GetTriggerSource(U16 wCardNumber, U16 \*Source);;

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

State:

0: Software trigger source

1: External hardware trigger source

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card.

# GIE\_SetTriggerSource

Sets the Trigger over Ethernet function source.

# Syntax

C/C++

```txt
short GIE_SetTriggerSource(U16 wCardNumber, U16 Source);
```

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

State:

0: Software trigger source
1: External hardware trigger source

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card.
-11) An invalid state parameter.

# GIE\_GetTriggerMode

Acquires Trigger over Ethernet function status.

# Syntax

```txt
C/C++
short GIE_GetTriggerMode(U16 wCardNumber, U16 *Mode);;
```

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

Mode:

0: Software trigger source
1: External hardware trigger source

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card.
-11) An invalid state parameter.

# GIE\_SetTriggerMode

Acquires Trigger over Ethernet function status.

# Syntax

C/C++

short GIE\_GetTriggerMode(U16 wCardNumber, U16 \*Mode);;

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

Mode:

0: Software trigger source

1: External hardware trigger source

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card.
-11) An invalid state parameter.

# GIE\_GetTriggerActivation

Acquires Trigger activation mode of ToE, specifying that the source trigger is considered valid on the rising edge or falling edge.

# Syntax

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

```javascript
short GIE_GetTriggerActivation (U16 wCardNumber, U16 *Activation);
```

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

Activation:

1: Rising edge

2: Falling edge

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

```txt
-2 An invalid wCardNumber parameter,
wCardNumber is less than 32
-5 The function is not supported by this card.
```

# GIE\_SetTriggerActivation

Sets Trigger activation mode for ToE, specifying that the source trigger is considered valid on the rising edge or falling edge.

# Syntax

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

```txt
short GIE_SetTriggerActivation (U16 wCardNumber, U16 Activation);
```

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

Activation:

1: Rising edge
2: Falling edge

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card.
-11 This is an invalid state parameter.

# GIE\_GetTriggerType

Acquires Trigger type, where 4 to 4 mode indicates that each pin of the DI performs corresponding port action command to active, and 1 to 4 mode indicates that DI\_0 performs all port action commands to active.

# Syntax

C/C++

short GIE\_GetTriggerType(U16 wCardNumber, U16 \*Type);;

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

0: 4 to 4 mode

1: 1 to 4 mode

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card.

# GIE\_SetTriggerType

Sets Trigger type, where 4 to 4 mode indicates that each pin of the DI performs corresponding port action command to active, and 1 to 4 mode indicates that DI\_0 performs all port action commands to active.

# Syntax

```javascript
C/C++
short GIE_SetTriggerType(U16 wCardNumber, U16 Type);;
```

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

Type:

0: 4 to 4 mode

1: 1 to 4 mode

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card.
-11) An invalid state parameter.

# GIE\_GetTriggerDebounce

Acquires Trigger debounce time for filtering the external trigger.

# Syntax

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

```txt
short GIE_GetTriggerDebounce (U16 wCardNumber, U32 * Debounce);
```

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

Debounce:

1µs to 200000µs

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card.

# GIE\_SetTriggerDebounce

Sets trigger denounce time for filtering the external trigger.

![A white document icon with a folded top-right corner featuring faint horizontal lines and a large, bold red checkmark superimposed over the center.](.pcie-gie7xflr-50-11178-2000-10/b56ab8c12fe3d332418ef4197ea5b102f54100aca2424b6a0c461594d6d50f9f.jpg)
NOTE:

When the board connects with different trigger source types (voltage and frequency), photocouplers onboard experience slightly different rising and falling times, and, thus, the trigger debounce time is 25 to 35 ns longer than the time period (reciprocal of frequency) of the trigger source.

# Syntax

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

short GIE\_SetTriggerDebounce (U16 wCardNumber, U32 Debounce);;

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

Debounce:

1µs to 200000µs

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter, wCardNumber is less than 32
-5 The function is not supported by this card.
-11) An invalid state parameter.

# GIE\_GetTriggerCount

Acquires Trigger count, directing 16-bit counter to count triggers originating from hardware or software and ToE commands sent from the PCIe-GIE7x PRO.

# Syntax

C/C++

short GIE\_GetTriggerCount(U16 wCardNumber, U16 PortNumber, U16 \*TriggerCount, U16 \*TriggerSentCount);

# Parameter(s)

wCardNumber:

Retrieved from the return value of SmartPoE\_Register\_Card.

PortNumber:

Indicates port number from 1 to 4.

TriggerCount:

Number of triggers from hardware trigger or software trigger (Valid value: 0 to 65535)

TriggerSentCount:

Number of action commands from PCIe-GIE7x PRO (Valid value: 0 to 65535)

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter,
wCardNumber is less than 32
-5 The function is not supported by this card.

# GIE\_ResetTriggerCount

Resets Trigger count, with trigger counters reset to 0.

# Syntax

C/C++

short GIE\_ResetTriggerCount(U16 wCardNumber);

# Parameter(s)

wCardNumber:

Retrieved from the return value of

SmartPoE\_Register\_Card.

# Return Code

No error occurs if return value >= 0, and if negative value, as follows

-2 An invalid wCardNumber parameter,
wCardNumber is less than 32
-5 The function is not supported by this card.

# 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ºC (with DC supply) and 50ºC (with adapter supply);
When installing/mounting or uninstalling/removing device; or when removal of a chassis cover is required for user servicing (See “Function Library” on page 3.):

 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.

![The image displays a safety sign featuring a yellow triangle with a black border at the top, containing a large black exclamation point. Below the triangle is a white rectangular area with the text 'CAUTION:' printed in black capital letters.](.pcie-gie7xflr-50-11178-2000-10/377c439e5d1dfebf2165dc04800de3ceeb220f3a965ad2160cd444220e1e5d18.jpg)

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](.pcie-gie7xflr-50-11178-2000-10/bd1f48c2193a2ae71ae11e9a2662466ecb14c4fe9326698b174bccd04ad118b4.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.

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

New Taipei City 235, Taiwan

Tel: +886-2-8226-5877

Fax: +886-2-8226-5717

Email: service@adlinktech.com

# Ampro ADLINK Technology, Inc.

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.

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

# LiPPERT ADLINK Technology GmbH

Hans-Thoma-Strasse 11

D-68163 Mannheim, Germany

Tel: +49-621-43214-0

Fax: +49-621 43214-30

Email: emea@adlinktech.com

Please visit the Contact page at www.adlinktech.com for information on how to contact the ADLINK regional office nearest you:
[🔗 Link to the original document](.pcie-gie7xflr-50-11178-2000-10/pcie-gie7xflr-50-11178-2000-10.pdf)
