Advantech PCIE-1182 handleiding
Handleiding
Je bekijkt pagina 23 van 29

15
PCIE-1182 User Manual
3.4 How does the API uses the DLL Export Function
The following steps show how to call the DLL export function to control the power of
the PoE and DCOUT Port on the PCIE-1182. Please refer to the sample program for
more details. (path: āC:\Advantech\PoEPowerControl\Example\ā)
3.4.1
Load DLL library
HMODULE hDLL = LoadLibrary(TEXT("PoEPowerControl.dll"));
3.4.2
Get DLL function
P_PPCGetNumPorts fpPPCGetNumPorts = NULL;
fpPPCGetNumPorts = (P_PPCGetNumPorts)GetProcAddress(hDLL, "PPCGetNumPorts");
P_PPCSetPowerState fpPPCSetPowerState = NULL;
fpPPCSetPowerState = (P_PPCSetPowerState)GetProcAddress(hDLL,
"PPCSetPowerState");
P_PPCGetPowerState fpPPCGetPowerState = NULL;
fpPPCGetPowerState = (P_PPCGetPowerState)GetProcAddress(hDLL,
"PPCGetPowerState");
P_PPCSetDCPowerState fpPPCSetDCPowerState = NULL;
fpPPCDCSetPowerState = (P_PPCSetDCPowerState)GetProcAddress(hDLL,
"PPCSetDCPowerState");
P_PPCGetDCPowerState fpPPCGetDCPowerState = NULL;
fpPPCGetDCPowerState = (P_PPCGetDCPowerState)GetProcAddress(hDLL,
"PPCGetDCPowerState");
P_ PPCSaveDevicePowerState fpPPCSaveDevicePowerStates= NULL;
fpPPCSaveDevicePowerStates = (P_PPCSaveDevicePowerState)GetProcAddress(hDLL,
"PPCSaveDevicePowerState");
3.4.3
Set PoE Port 0 Power OFF
fpPPCSetPowerState (0, PPC_POWER_OFF);
3.4.4
Set PoE Port 0 Power ON
fpPPCSetPowerState (0, PPC_POWER_AUTO);
3.4.5
Get PoE Port 0 Power Status
State = fpPPCGetPowerState (0);
if(State == PPC_POWER_AUTO)
printf("PoE Port[0] State: Power ON\n");
else if(State == PPC_POWER_OFF)
printf("PoE Port[0] State: Power OFF\n");
3.4.6
Set Port 0 DCOUT Power OFF
fpPPCDCSetPowerState (0, PPC_POWER_OFF);
3.4.7
Set Port 0 DCOUT Power ON
fpPPCDCSetPowerState (0, PPC_POWER_AUTO);
3.4.8
Get Port 0 DCOUT Power Status
State = fpPPCGetDCPowerState (0);
if(State == PPC_POWER_AUTO)
printf("DCOUT Port[0] State: Power ON\n");
else if(State == PPC_POWER_OFF)
printf("DCOUT Port[0] State: Power OFF\n");
Bekijk gratis de handleiding van Advantech PCIE-1182, stel vragen en lees de antwoorden op veelvoorkomende problemen, of gebruik onze assistent om sneller informatie in de handleiding te vinden of uitleg te krijgen over specifieke functies.
Productinformatie
Merk | Advantech |
Model | PCIE-1182 |
Categorie | Niet gecategoriseerd |
Taal | Nederlands |
Grootte | 3111 MB |