ADLINK Technology PCIe-GIE7 Series User manual

Leading EDGE COMPUTING
PCIe-GIE7x Series
Function Library Reference
Manual Rev.: 1.0
Revision Date: July 14, 2017
Part No: 50-11178-2000

ii
Leading EDGE COMPUTING
Revision History
Revision Release Date Description of Change(s)
2.00 July 14, 2017 Initial Release

Preface iii
PCIe-GIE7x
Preface
Copyright 2017 ADLINK Technology, Inc.
This document contains proprietary information protected by copy-
right. All rights are reserved. No part of this manual may be repro-
duced 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, spe-
cial, 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 Euro-
pean Union's Restriction of Hazardous Substances (RoHS) direc-
tive 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, manu-
facturing 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 pur-
poses only and may be trademarks and/or registered trademarks
of their respective companies.

iv Preface
Leading EDGE COMPUTING
Conventions
Take note of the following conventions used throughout this
manual to make sure that users perform certain tasks and
instructions properly.
NOTE:
NOTE:
Additional information, aids, and tips that help users perform
tasks.
CAUTION:
Information to prevent minor physical injury, component dam-
age, data loss, and/or program corruption when trying to com-
plete a task.
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 v
PCIe-GIE7x
Table of Contents
Revision History...................................................................... ii
Preface.................................................................................... iii
1 Introduction ........................................................................ 1
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.............................................. 41
Getting Service...................................................................... 45

vi Table of Contents
Leading EDGE COMPUTING
This page intentionally left blank.

Introduction 1
PCIe-GIE7x
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.
1.1 Setting Up the Build Environment
All files are located in the directory \ADLINK\PCIe-GIE7X\Include
File Type File Description Required by
Include
SmartPoE.h. Header file required for all
C/C++ applications
All applications
using APIs
SmartPoE.vb Functiondefinitionsrequired
for all VB.Net applications
SmartPoE.cs Functiondefinitionsrequired
for all C# applications
DLL SmartPoE.dll Dynamic link library
required for all applications

2Introduction
Leading EDGE COMPUTING
Library SmartPoE.lib Exports API function
definitions, required for all
Visual C/C++ applications
All C/C++
applications
using APIs
File Type File Description Required by

Function Library 3
PCIe-GIE7x
2 Function Library
2.1 List of Functions
Category Function Cards
Device
Control
SmartPoE_Register_Card PCIe-GIE64,
PCIe-GIE7X
SmartPoE_Release_Card
SmartPoE_Get_ID
SmartPoE_Get_CPLDVersion PCIe-GIE7X
SmartPoE_Get_MCUVersion
Power
Management
SmartPoE_Power_Enable
PCIe-GIE64,
PCIe-GIE7X
SmartPoE_Get_Power_Enable
SmartPoE_Get_PoEstate
SmartPoE_Get_PoEPortLaststate
SmartPoE_Get_Temperature
SmartPoE_Get_HighTemperature
SmartPoE_Get_LowTemperature
SmartPoE_Set_HighTemperature
SmartPoE_Set_LowTemperature
SmartPoE_Get_PortStatus
SmartPoE_Get_PSEPortCurrent
SmartPoE_Get_PSEPortVoltage
SmartPoE_Get_PoEConsPowbudget
SmartPoE_Get_PoELeftPowbudget
SmartPoE_Get_PowerBudgetControl
SmartPoE_Set_PowerBudgetControl
License
Management
AD_InstallSecret
PCIe-GIE7X PRO
AD_SetMasterSecret
AD_EncryptReadSegment
AD_EncryptComputeEnc
AD_EncryptAuthWritePageEnc
AD_ReadInstallSecretStatus

4 Function Library
Leading EDGE COMPUTING
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 num-
ber of the first card, with the second card 1, and so on.
Trigger over
Ethernet
GIE_Set_ActionCommand
PCIe-GIE7X PRO
GIE_Get_ActionCommand
GIE_Send_ActionCommand
GIE_Send_AllActionCommand
GIE_GetTriggerSource
GIE_SetTriggerSource
GIE_GetTriggerMode
GIE_SetTriggerMode
GIE_GetTriggerActivation
GIE_SetTriggerActivation
GIE_GetTriggerType
GIE_SetTriggerType
GIE_GetTriggerDebounce
GIE_SetTriggerDebounce
GIE_GetTriggerCount
GIE_ResetTriggerCount
Category Function Cards

Function Library 5
PCIe-GIE7x
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 specifi-

6 Function Library
Leading EDGE COMPUTING
cations, 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
Card ID S1 switch
4 3 2 1
0 off off off off
1 off off off on
2 off off on off
3offoffonon
4 off on off off
5 off on off on
6 off on on off
7 off on on on
8 on off off off
9onoffoffon
10 on off on off
11 on off on on
12 on on off off
13 on on off on
14 on on on off
15 on on on on

Function Library 7
PCIe-GIE7x
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

8 Function Library
Leading EDGE COMPUTING
SmartPoE_Get_MCUVersion
Retrieves the PoE MCU version.
Syntax
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
C/C++
short SmartPoE_Power_Enable (unsigned short
wCardNumber, unsigned short wEnPort1, unsigned

Function Library 9
PCIe-GIE7x
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

10 Function Library
Leading EDGE COMPUTING
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
C/C++
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

Function Library 11
PCIe-GIE7x
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
-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
C/C++
Short SmartPoE_Get_POEPortLaststate (unsigned
short wCardNumber, unsigned short * wPOEstate)
Parameter(s)
wCardNumber:
Retrieved from the return value of
SmartPoE_Register_Card.
wPOEstate:
Bit 0:

12 Function Library
Leading EDGE COMPUTING
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:

Function Library 13
PCIe-GIE7x
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 *wTempera-
ture)
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

14 Function Library
Leading EDGE COMPUTING
SmartPoE_Get_LowTemperature
Retrieves Low Temperature setting (cannot exceed High
Temperature setting).
Syntax
C/C++
short SmartPoE_Get_LowTemperature (unsigned
short wCardNumber, unsigned short * wLowTem-
perature)
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 wHighTemper-
ature)
Parameter(s)
wCardNumber:
Other manuals for PCIe-GIE7 Series
1
Table of contents
Other ADLINK Technology Video Card manuals