PowerShell v5 API Library Ref Manual
PowerShell v5 API Library Ref Manual
Sifos Technologies
PowerSync Analyzer
PSA-3000
Disclaimer
The information contained in this manual is the property of Sifos Technologies, Inc., and is furnished for use by
recipient only for the purpose stated in the Software License Agreement accompanying the user documentation.
Except as permitted by such License Agreement, no part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, without the prior written permission of Sifos Technologies, Inc.
Information contained in the user documentation is subject to change without notice and does not represent a
commitment on the part of Sifos Technologies, Inc. Sifos Technologies, Inc. assumes no responsibility or liability
for any errors or inaccuracies that may appear in the user documentation.
Table of Contents
1. Introduction ..................................................................................................................................... 7
1.1. PowerShell v5 API Library Introduction ...................................................................................................................... 7
1.2. System Requirements .................................................................................................................................................. 8
1.3. Installation .................................................................................................................................................................... 8
1.4. Use with a PSA/PSL Chassis Containing PVA-3102 Test Blades .............................................................................. 9
1.5. Use in a Multi-threaded Program ................................................................................................................................. 9
1.6. Reference Manual Organization................................................................................................................................... 9
1. Introduction
1.1. PowerShell v5 API Library Introduction
The Sifos Technologies PowerSync Analyzer is a test instrument designed to be controlled from a PC over a TCP/IP
network connection (10/100BaseT). The software environment used to control a PowerSync Analyzer is PowerShell
v5 PSA, a powerful, interpretive scripting language built on the widespread Tcl language. From an automation
perspective, the native Application Programming Interface (API) for PowerShell v5 PSA is a set of Tcl commands,
which require a Tcl interpreter to execute.
To facilitate automation control of the PowerSync Analyzer from alternative languages, a binary PowerShell v5 PSA
API Library (referred to below as “the API Library”) has been created. The PowerShell v5 API Library is a collection
of functions published in a binary form that provide access to many of the native PowerShell v5 PSA Tcl commands.
The API library programmatically initializes a Tcl interpreter, translates the information passed by the caller for each
function into the related PowerShell v5 PSA Tcl command, evaluates that command with the Tcl interpreter, and
returns the result of that command evaluation to the caller. Calls will not return until the related Tcl command
execution has been completed, so no special pacing should be required in the calling context.
This document does not describe theory of operation, and does not include the full description of the actual PowerShell
v5 PSA Tcl commands that each API function encapsulates. This API manual should be used in conjunction with the
PowerSync Analyzer PSA-3000 Technical Reference Manual v5 or the PowerSync Programmable Load PSL-3000
Technical Reference Manual v5, depending on which Test Blade type you are working with.
NOTE: all of the API functions listed below will work with a PSA-3202. A limited subset will work with the PSL-
3202, PSA-3102, and PSL-3102, due to their reduced hardware capability. Refer to the associated Technical Reference
Manual for each blade type for the specific commands each blade supports. For example, both blade types can perform
VDC Average measurements, but only the PSA-3202 can perform VDC Peak or Trace measurements, so the related
API calls are not valid for use with a PSL-3202. A PSA-3102 supports all of the meters, triggering, and active load
functions for 2 pair operation, but has limited support for 4 pair operation. If a call that is not supported on the
addressed test port is used, PowerShell v5 PSA Tcl will return an error, which will be communicated to the caller by the
API function. Starting with version 5.3, unique functions have been added that support the new PSL-3402.Test Blades.
These functions contain “PL” in their name.
The PowerShell v5 API Library is published as a Dynamic Link Library (.dll) for use on Microsoft Windows platforms,
and as a Shared Library (.so) for use on Linux platforms.
On a Windows platform, any language capable of calling Win32 API functions should be able to use the PowerShell v5
API library. On a Linux platform, any application capable of calling C functions located in a shared library should be
able to use the PowerShell v5 API.
The API library is considered a “contributed” utility, and is provided for the convenience of end users who are not able
to utilize Tcl directly, and choose not to employ one of the other remote control methods available for the PowerSync
Analyzer (described in the Application Note Remote Control of PowerShell Tcl). The API library has been tested
against the release of PowerShell v5 PSA noted below. Given the multitude of programming environments available,
Sifos can only provide limited support with regard to the use of the API library with non-standard environments.
The fundamental difference between this API library and the previous versions (4.1.x, which supported PowerShell
PSA through 4.2.10) is the 4-pair operation support. One change required the addition of port to all formal argument
lists, which was required to support the new PSx-3202 Test Blades, which support 4-pair operation on both the PSE 1
and PSE 2 jacks (the PSx-3102 Test Blades only support 4-pair operations on the PSE 2 jack). The e4PairState
enumeration was changed to define the new signature definitions (SINGLE and DUAL) required to support the 802.3bt
standard. All meters that return values for both Alt A and Alt B had to have their formal parameter definitions changed
to support transferring those measurements to the caller. The port arg had to be extended to allow ‘A’ and ‘B’ as valid
port addresses, along with ‘1’, ‘2’, and ‘99’. Alt ‘A’ port resources are accessed by passing the value 65, and Alt ‘B’ by
passing the value 66.
For Linux:
32-bit
Built, tested on Debian 8 kernel 3.16, GLIBC_2.0, GLIBC_2.1, GLIBC_2.1.3 (libc.so), libdl.so
Tcl/Tk version 8.4 (8.4.5 or later), Tcl 8.5, or Tcl 8.6
PowerShell API Library (libPowerShellv5API.so) version 5.3.2 or later
64-bit
Built, tested on CentOS 5.8 kernel 2.6.18, GLIBC_2.2.5 (libc.so), libdl.so
PSA Software version 5.3.0 or later
Tcl/Tk version 8.4 (8.4.5 or later), Tcl 8.5, or Tcl 8.6
PowerShell API Library (libPowerShellv5API64.so) version 5.3.2 or later
Test Blades
Sifos PSx-3102, PSx-3202, PVA-3102, installed in a PSA-3000 chassis, PSL-3402 in a PSL-3424 chassis.
1.3. Installation
The API library binary file must be placed in a location that the application program you are using can find at runtime.
For Windows platforms, there are specific rules that the operating system uses to locate a DLL:
The .h, .lib, and .bas files should be placed wherever necessary to access them from your application development
environment. NOTE: the .lib file was produced with a Microsoft C version 6 linker.
For 32-bit Linux platforms, the .so file should be placed under /usr/lib (or an alternative directory as defined by a local
administrative policy). For 64-bit Linux platforms, the .so file should be placed under /usr/lib64 (or an alternative
directory as defined by a local administrative policy).
The .h file should be placed wherever necessary to access it from your application development environment.
The API library also contains support for the Sifos PhyView Analyzer (PVA-3102 Test Blade). There are a small
number of functions that are common to both PowerSync Analyzer and PhyView Analyzer capabilities (listed below).
All other functions are specific to the Test Blade type. The PhyView Analyzer API functions are documented in the
PhyView API Library Reference Manual.
PowerShell_ManageStdout
PowerShell_Init
PowerShell_UnInit
PowerShell_ConnectToChassis
PowerShell_GetInitStatus
PowerShell_GetErrString
PowerShell_Inventory
PowerShell_GetVersion
PowerShell_ProcessCmd
PowerShell_SetConfigTrigPort
PowerShell_GetConfigTrigPort
PowerShell_TrigOut
The API library functions are not thread safe. Due to the architecture of the PowerSync Analyzer instrument, which
only supports a single connection at any instant in time, the underlying Tcl extension environment (PowerShell v5 PSA)
that is used to control the instrument only supports a single thread use model. As a result, there has been no engineering
effort devoted to making the API function thread safe.
It is incumbent on the end user to use the API library in a manner where functions are only called by a single thread at
any one time. Each function call is “atomic”, where the function call marshals arguments, submits the associated
PowerShell v5 PSA command to the encapsulated Tcl shell for evaluation, and does not return until that command’s
execution has completed. Multiple threads need to use some form of access control, such as semaphores or mutexes, to
insure that one and only one thread is performing an API function call at any single point in time. The semaphore or
mutex must not be released by the thread that owns the semaphore or mutex until the API library function call has
returned.
If more than one thread calls API functions simultaneously, unpredictable results will occur, with a high probability that
one of the threads will encounter a socket error at the lowest level of PowerShell v5 PSA.
Section 2 contains the PowerShell v5 API function definitions, and related enumeration type definitions for any
language able to call a standard C function.
Section 3 contains information about using the PowerShell v5 API library with Microsoft .NET languages.
Section 4 contains information about using the PowerShell v5 API library with LabView.
Section 5 contains example code showing how to use the PowerShell v5 API library.
On Microsoft Windows platforms, the calling convention used by the API functions is __stdcall.
There is no explicit definition of the calling convention for Linux platforms. The default calling convention used is
defined by gcc (specifically, gcc4.2).
The application program should always test the status returned by an API function.
When an API function returns the TCL_ERROR status, the calling application should immediately call the API
function that returns a message associated with that error. That function is PowerShell_GetErrString. If another API
function is called before retrieving the error message, that API call will cause the error message to be overwritten, and
therefore ‘lost’.
2.3. Enumerations
Defined in the include file PowerShellv5API.h. If the language being used does not support enumerations, pass the
integer value defined below.
2.4. PowerShell_Init
description: loads and initializes a Tcl interpeter, and evaluates the defined rc file, which will load the PowerShell Tcl
language extensions.
NOTE: this function should only be called once in the lifetime of a process, when the library is initially loaded. To
connect to another chassis once the library has been loaded, call the API function
PowerShell_ConnectToChassis.
An error will be returned if this function is called more than once. A service function has been provided that allows the
initialization state of the library to be interrogated – see PowerShell_GetInitStatus.
parameters: char *szChassisIPAddress - the IP address of the chassis to connect to, in dotted decimal format.
char *szRCFile - name of the rc file to be eval'ed by the Tcl interpreter. This must be a file name (not a
path), which must exist under c:/program files/sifos/psa1200. If NULL is passed as this argument,
the default file tclshrc.tcl will be eval'ed.
NOTE: the rc file used should be modified to set psaConnectPause to 0, to minimize the time that the
initial PSA connection will take. An rc file configured with this setting is provided with the standard
PowerShell PSA software release, named tclshrcAPI_LIB.tcl.
2.5. PowerShell_ManageStdout
description: allows caller to direct the library to manage the Tcl channels TCL_STD_OUT and TCL_STDERR, which
are not available when running in some processes. For example, this situation has been encountered when
using the API library with a “Windows Application” constructed with Visual Basic (VB.NET, C#.NET),
and with LabView. A GUI process running on Windows will require this function to be called prior to
calling PowerShell_Init. Closing stdout is not required when running in a console (text mode) process.
parameters: ePSABoolean bCloseStdout - PSA_FALSE = don't close stdout | PSA_TRUE = close stdout
returns: TCL_OK
2.6. PowerShell_UnInit
description: deletes the Tcl interpreter created when PowerShell_Init was called, and unloads the Tcl library.
parameters: none
returns: TCL_OK
2.7. PowerShell_AllowDemoModeOperation
description: allows the library to be configured to force the underlying PowerShell PSA Tcl session to operate in
DEMO mode. This allows various function calls to be used without access to hardware.
NOTE: not all functions operate in demo mode. {editors note mark functions that do support this}
parameters: ePSABoolean bState - PSA_FALSE = don't allow demo mode PSA_TRUE = force demo mode
2.8. PowerShell_IsDemoModeOn
description: interrogates the embedded PowerShell PSA, and returns the response of "psa_demo ?".
parameters: ePSABoolean *pbState- location to store the demo mode state. Values returned:
PSA_TRUE | PSA_FALSE
2.9. PowerShell_GetInitStatus
description: returns the initialization status of the library. If the PowerShell_Init function has been called, the state will
be PSA_INITIALIZED.
parameters: eInitStatus *psStatus - the location to store the init state in. Values returned:
PSA_INITIALIZED | PSA_NOT_INITIALIZED
2.10. PowerShell_ConnectToChassis
description: connects to the specified chassis (if that chassis is powered on an accessible at the defined address).
parameters: char *szChassisIPAddress - the IP address of the chassis to connect to, in dotted decimal format.
2.11. PowerShell_Inventory
description: performs an inventory of the chassis, using the PowerShell command "psa_config". The inventory is
returned as a semi-colon delimited list (there are commas in parts of the response text, which precludes
formatting the string with comma delimiters).
parameters: char *szInventory - a character array that will be used to return the inventory string in.
int iLenInventory - the length of the character array passed as the szInventory parameter. If the indicated
length is shorter than the length of the inventory string, the inventory string will be
truncated to fit the available space.
NOTE: this parameter MUST accurately define the length of szInventory, to prevent a buffer overrun. The
underlying API library is implemented in C, which does not provide any means to determine size or rank of
a character array.
2.13. PowerShell_SetAlt
description: configures the ALT switch setting using the PowerShell command "alt".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
2.14. PowerShell_GetAlt
description: reads the ALT switch setting using the PowerShell command "alt ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
2.15. PowerShell_SetPolarity
description: configures the POLARITY switch setting using the PowerShell command "polarity".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
2.16. PowerShell_GetPolarity
description: reads the POLARITY switch setting using the PowerShell command "polarity ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
2.17. PowerShell_Set4PairMode
description: configures the 4Pair relay setting using the PowerShell command "psa_4pair".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2
e4PairState eState - the 4Pair mode setting Legal values: FOURPAIR_DUAL | FOURPAIR_SINGLE |
FOURPAIR_DISABLED
2.18. PowerShell_Get4PairMode
description: reads the 4Pair relay setting using the PowerShell command "psa_4pair ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1|2
2.19. PowerShell_GetConnected4PrPort
description: this function returns the Connected 4 pair port for the Test Blade in the defined slot, as well as the
configured signature type. This function will return an error if the Test Blade is not configured for 4 pair
operation.
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int *piPort - pointer to the storage location to store the connected 4 pair port in.
e4PairState *peSig - pointer to the storage location to store the signature type in.
2.20. PowerShell_SetIload
function: PowerShell_SetIload (int iSlot, int iPort, double dCurrent, double dTransCurrent);
description: sets the current load using the PowerShell command "iload".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1|2
double dCurrent - the current level to be set, in units of mA. The legal value varies depending on the
model number of the blade being programmed (refer to the PSA-1200 and PSA-3000 Technical
Reference Manual).
double dTransCurrent - the transition current level to be set, in units of mA. This parameter is only used
with PSA-3202 and PSA-3102 blades.
2.21. PowerShell_GetIload
function: PowerShell_GetIload (int iSlot, int iPort, double *pdCurrent, double *pdTransCurrent, int *piNumRslts);
description: reads the current load setting using the PowerShell command "iload ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1|2
double *pdCurrent - pointer to the storage location to store the current value read from the blade in. The
value is in units of mA.
double *pdTransCurrent - pointer to the storage location to store the current value read from the blade in.
This parameter is only used with PSA-3202 and PSA-3102 blades. The default value -99.9 is
returned for any other blade type. The value is in units of mA. When the blade is configured for 2
pair operation, there will be one value to return. When the blade is configured for 4 pair operation,
there will be two, one for each pairset.
NOTE about the variable passed in: When the blade is configured for 2 pair operation, or the caller
specifies an individual pairset for iPort, the variable pointed to can be single storage
locations. When the blade is configured for 4 pair operation, and the connected port is
specified, the variable pointed to must be a two element array.
int *piNumRslts - pointer to the location to store the number of results stored in the parameter. On entry,
this must define the number of array elements allocated for the parameter. On return, it will be set to
indicate how many values were discovered in the Tcl result (1 for 2 pair operation or for an
individual pairset, 2 for a port configured for 4 pair operation, where both pairset's configuration data
is returned).
2.22. PowerShell_GetBladeType
description: this function returns the Test Blade type identified in the defined slot,port.
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1|2
eBladeType *peType - pointer to the storage location to store the blade type in..
2.23. PowerShell_SetPassiveLoad
function: PowerShell_SetPassiveLoad (int iSlot, int iPort, int iRes, int iCap);
description: configures the PASSIVE load settings using the PowerShell command "passive".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
int iRes - the RESISTANCE setting, in units of kOhms. Legal values 9..39
2.24. PowerShell_GetPassiveLoad
function: PowerShell_GetPassiveLoad (int iSlot, int iPort, int *piRes, int *piCap, int *piNumRslts);
description: reads the PASSIVE load settings using the PowerShell command "passive ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE about the variables passed in: when the blade is configured for 2 pair operation, or the caller
specifies an individual pairset for iPort, the variables pointed to can be single storage locations.
When the blade is configured for 4 pair operation, and the connected port is specified, the
variables pointed to must be two element arrays.
int *piNumRslts - pointer to the location to store the number of results stored in each parameter. On entry,
this must define the number of array elements allocated for each parameter. On return, it will be set to
indicate how many values were discovered in the Tcl result (1 for 2 pair operation or for an individual
pairset, 2 for a port configured for 4 pair operation, where both pairset's configuration data is
returned).
2.25. PowerShell_SetPort
function: PowerShell_SetPort (int iSlot, int iPort, ePortState eState, eTrigOut eTout);
description: configures the PORT state using the PowerShell command "port".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1|2
ePortState eState - the state of the port. Legal values: PORT_CONNECTED | PORT_ISOLATED
eTrigOut eTout - defines whether or not to generate a trigger event when the port is closed. Legal values:
TRG_OUT_EN | TRG_OUT_DIS
2.26. PowerShell_GetPort
function: PowerShell_GetPort (int iSlot, int iPort, ePortState *peState, int *piNumRslts);
description: reads the PORT state using the PowerShell command "port ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
ePortState *peState - the location to store the state of the port in.
NOTE about the variable passed in: When the blade is configured for 2 pair operation, 4 pair SINGLE
signature operation, or the caller specifies an individual pairset for iPort, the variable pointed to
can be single storage locations. When the blade is configured for 4 pair DUAL signature
operation, and the connected port is specified, the variable pointed to must be a two element
array.
int *piNumRslts - pointer to the location to store the number of results stored in the parameter. On entry,
this must define the number of array elements allocated for the parameter. On return, it will be set to
indicate how many values were discovered in the Tcl result (1 for 2 pair operation, 4 pair SINGLE
signature operation, or for an individual pairset, 2 for a port configured for 4 pair DUAL signature
operation, where both pairset's configuration data is returned).
NOTE: there is no corresponding eTrigOut eTout parameter, unlike most of the other configuration query functions.
This parameter can be set, but is a one-shot, and has no persistence. There is nothing in the Tcl proc response
list about Trig Out.
2.27. PowerShell_SetTrig1
function: PowerShell_SetTrig1(int iSlot, int iPort, eEdge eEdg, double dLevel, eTrigMode eMode);
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
eEdge eEdg - defines the trigger edge direction. Legal values: EDGE_RISING | EDGE_FALLING
double dLevel - defines the threshold voltage level for the trigger. Legal values 0.25 - 59.5.
eTrigMode eMode - defines the trigger noise immunity mode. (only used by PSA-3202, PSA-3102)
2.28. PowerShell_SetStateTrig1
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
eTrigState eState - defines the state to set the trigger state machine to. Legal values:
TRIG_ARMED | TRIG_CLEAR
2.29. PowerShell_GetTrig1
function: PowerShell_GetTrig1 (int iSlot, int iPort, eEdge *pEdge, double *pdLevel, eTrigMode *peMode,
int *piNumRslts);
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
eEdge *pEdge - location to store the trigger edge direction setting in.
eTrigMode *peMode - location to store the trigger noise immunity mode setting in. (only used by PSA-
3202 or PSA-3102)
NOTE about the variable passed in: When the blade is configured for 2 pair operation, 4 pair SINGLE
signature operation, or the caller specifies an individual pairset for iPort, the variable pointed to
can be single storage locations. When the blade is configured for 4 pair DUAL signature
operation, and the connected port is specified, the variable pointed to must be a two element
array.
int *piNumRslts - pointer to the location to store the number of results stored in the parameter. On entry,
this must define the number of array elements allocated for the parameter. On return, it will be set to
indicate how many values were discovered in the Tcl result (1 for 2 pair operation, 4 pair SINGLE
signature operation, or for an individual pairset, 2 for a port configured for 4 pair DUAL signature
operation, where both pairset's configuration data is returned).
2.30. PowerShell_GetStatusTrig1
function: PowerShell_GetStatusTrig1 (int iSlot, int iPort, eTrigState *peState, int *piNumRslts);
description: reads trig1 status using the PowerShell command "trig1 stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1|2
eTrigState *peState - location to store the trigger status in.When the blade is configured for 2 pair
operation, there will be one value to return. When the blade is configured for 4 pair operation, there will
be two, one for each pairset.
NOTE about the variable passed in: When the blade is configured for 2 pair operation, or the caller
specifies an individual pairset for iPort, the variable pointed to can be single storage locations.
When the blade is configured for 4 pair operation, and the connected port is specified, the
variable pointed to must be a two element array.
int *piNumRslts - pointer to the location to store the number of results stored in the parameter. On entry,
this must define the number of array elements allocated for the parameter. On return, it will be set to
indicate how many values were discovered in the Tcl result (1 for 2 pair operation or for an individual
pairset, 2 for a port configured for 4 pair operation, where both pairset's configuration data is returned).
2.31. PowerShell_SetTrig2
function: PowerShell_SetTrig2 (int iSlot, int iPort, eEdge eEdg, double dLevel, eTrigMode eMode);
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
eEdge eEdg - defines the trigger edge direction. Legal values EDGE_RISING | EDGE_FALLING
double dLevel - defines the threshold voltage level for the trigger. Legal values 0.25 - 59.5
eTrigMode eMode - defines the trigger noise immunity mode. (only used by PSA-3202, PSA-3102)
Legal values: TRIGMODE_NORMAL | TRIGMODE_NOISY
2.32. PowerShell_GetTrig2
function: PowerShell_GetTrig2 (int iSlot, int iPort, eEdge *peEdge, double *pdLevel, eTrigMode *pMode
int *piNumRslts);
description: reads trig2 settings using the PowerShell command "trig2 ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
eEdge *pEdge - location to store the trigger edge direction setting in.
eTrigMode *peMode - location to store the trigger noise immunity mode setting in. (only used by PSA-
3202 or PSA-3102)
NOTE about the variable passed in: When the blade is configured for 2 pair operation, 4 pair SINGLE
signature operation, or the caller specifies an individual pairset for iPort, the variable pointed to
can be single storage locations. When the blade is configured for 4 pair DUAL signature
operation, and the connected port is specified, the variable pointed to must be a two element
array.
int *piNumRslts - pointer to the location to store the number of results stored in the parameter. On entry,
this must define the number of array elements allocated for the parameter. On return, it will be set to
indicate how many values were discovered in the Tcl result (1 for 2 pair operation, 4 pair SINGLE
signature operation, or for an individual pairset, 2 for a port configured for 4 pair DUAL signature
operation, where both pairset's configuration data is returned).
2.33. PowerShell_SetConfigPaverage
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
eMeasPeriod ePeriod - defines the period over which the measurement is averaged. Legal values:
2.34. PowerShell_GetStatusPaverage
description: reads paverage status using the PowerShell command "paverage stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
2.35. PowerShell_SetConfigVdcaverage
function: PowerShell_SetConfigVdcaverage (int iSlot, int iPort, eTrigSrc eSrc, eMeasPeriod ePeriod, eTimeout eTO);
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
eMeasPeriod ePeriod - defines the period over which the measurement is averaged. Legal values:
eTimeout eTO - defines the timeout to enforce. Legal values: TIMEOUT_10S | TIMEOUT_100S
2.36. PowerShell_GetConfigVdcaverage
function: PowerShell_GetConfigVdcaverage (int iSlot, int iPort, eTrigSrc *peSrc, eMeasPeriod *pePeriod, eTimeout
*peTO);
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
2.37. PowerShell_GetStatusVdcaverage
function: PowerShell_GetStatusVdcaverage (int iSlot, int iPort, eMeasState *peState, double *pdMeas,
int *piNumRslts);
description: reads vdcaverage status using the PowerShell command "vdcaverage stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
eMeasState *peState - location to store the measurement status in. Response should be:
double *pdMeas - location to store the measured voltage in. The value is only valid when the status
response is MEAS_READY
NOTE about the variables passed in: when the blade is configured for 2 pair operation, or the caller
specifies an individual pairset for iPort, the variables pointed to can be single storage
locations. When the blade is configured for 4 pair operation, and the connected port is
specified, the variables pointed to must be two element arrays.
int *piNumRslts - pointer to the location to store the number of results stored in each parameter. On entry,
this must define the number of array elements allocated for each parameter. On return, it will be set
to indicate how many values were discovered in the Tcl result (1 for 2 pair operation or for an
individual pairset, 2 for a port configured for 4 pair operation, where both pairset's configuration
data is returned).
2.38. PowerShell_SetConfigVdcpeak
function: PowerShell_SetConfigVdcpeak (int iSlot, int iPort, ePeak ePk, eTrigSrc eSrc, eMeasPeriod ePeriod, eTimeout
eTO);
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
eMeasPeriod ePeriod - defines the period over which the measurement is averaged. Legal values:
eTimeout eTO - defines the timeout to enforce. Legal values: TIMEOUT_10S | TIMEOUT_100S
2.39. PowerShell_GetConfigVdcpeak
function: PowerShell_GetConfigVdcpeak (int iSlot, int iPort, ePeak *pePk, eTrigSrc *peSrc,
eMeasPeriod *pePeriod, eTimeout *peTO);
description: reads vdcpeak settings using the PowerShell command "vdcpeak ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
2.40. PowerShell_GetStatusVdcpeak
function: PowerShell_GetStatusVdcpeak (int iSlot, int iPort, eMeasState *peState, double *pdMeas,
int *piNumRslts);
description: reads vdcpeak status using the PowerShell command "vdcpeak stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
eMeasState *peState - location to store the measurement status in. Response should be:
double *pdMeas - location to store the measured voltage in. The value is only valid when the status
response is MEAS_READY.
NOTE about the variables passed in: when the blade is configured for 2 pair operation, or the caller
specifies an individual pairset for iPort, the variables pointed to can be single storage locations.
When the blade is configured for 4 pair operation, and the connected port is specified, the
variables pointed to must be two element arrays.
int *piNumRslts - pointer to the location to store the number of results stored in each parameter. On entry,
this must define the number of array elements allocated for each parameter. On return, it will be set to
indicate how many values were discovered in the Tcl result (1 for 2 pair operation or for an individual
pairset, 2 for a port configured for 4 pair operation, where both pairset's configuration data is returned).
2.41. PowerShell_SetConfigVdctrace
function: PowerShell_SetConfigVdctrace (int iSlot, int iPort, eTrigSrc eSrc, eMeasPeriod ePeriod, eTimeout eTO);
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
eMeasPeriod ePeriod - defines the period over which the measurement is averaged. Legal values:
eTimeout eTO - defines the timeout to enforce. Legal values: TIMEOUT_10S | TIMEOUT_100S
2.42. PowerShell_GetConfigVdctrace
function: PowerShell_GetConfigVdctrace (int iSlot, int iPort, eTrigSrc *peSrc, eMeasPeriod *pePeriod,
eTimeout *peTO);
description: reads vdctrace settings using the PowerShell command "vdctrace ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
2.43. PowerShell_GetStatusVdctrace
function: PowerShell_GetStatusVdctrace (int iSlot, int iPort, eMeasState *peState, int *piNumStates, double *pdTime,
double *pdMeas, int *pLenResult);
description: reads vdctrace status using the PowerShell command "vdctrace stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
eMeasState *peState - location to store the measurement status in. Response should be:
This variable can be a scalar if the blade is configured for 2 pair operation, or if the blade is
configured for 4 pair operation, but iPort specifies an individual pairset. When iPort specifies the
connected 4 pair jack, peState must be an array 2 elements in length.
int *piNumStates - pointer to the location to store the number of results stored in the peState parameter. On
entry, this must define the number of array elements allocated for the parameter. On return, it will be
set to indicate how many values were discovered in the Tcl result (1 for 2 pair operation or for an
individual pairset, 2 for a port configured for 4 pair operation, one for each pairset).
double *pdTime - location of array to store the time trace points in. The values are only valid when the
status response is MEAS_READY.
double *pdMeas - location of array to store the measured voltage trace points in. The values are only valid
when the status response is MEAS_READY.
NOTE about the variables passed in: When the blade is configured for 2 pair operation, or the caller
specifies an individual pairset for iPort, pdTime and pdMeas must each be an array of
sufficient length to hold the full number of points returned in the Tcl result. When the trace
meter is configured for a standard length period, the result from each alternative will contain
256 points. When the trace meter is configured for an extended length period, the result from
each alternative will contain 1024 points.
The caller must specify the length of each array in the parameter pLenResult (see below).
When the blade is configured for 4 pair operation, and iPort addresses the connected 4 pair jack, each
variable pointed to must be an array that is twice as long as the number of points that the meter is
configured for (512 bytes for standard periods, 2048 for extended periods). All of the locations in a
given array must be contiguous. The data will be organized:
int *pLenResult - pointer to the location to store the number of results stored in each parameter. When the
blade is configured for 2 pair operation, pLenResult can be a scalar variable, and on input must be set
to the length of pdTime[] and pdMeas[]. When the blade is configured for 4 pair operation, and iPort
defines the connected 4 pair jack, pLenResult must be an array containing 2 elements. On entry
pLenResult[0] must be set to the number of elements in pdTime[] and pdMeas[] that will be used for
pairset A, and pLenResult[1] must be set to the number of elements in each array that will be used for
pairset B.
When the result contains data for an individual pairset, the number of trace points will be returned in
pLenResult[0]. When the result contains data for both pairsets, the number of trace points for pairset A
will be returned in pLenResult[0], and the .number of trace points for pairset B will be returned in
pLenResult[1]. One or both of the pairsets could be in the ARMED, TIMEOUT, MEASURING, or
READY state when the stat query is performed - the only case where > 1 trace sample is returned is
when the state is READY. The reason that the lengths need to be handled separately is to address the
case where one alternative is READY and the other is not.
2.44. PowerShell_SetConfigIdcaverage
function: PowerShell_SetConfigIdcaverage (int iSlot, int iPort, eTrigSrc eSrc, eMeasPeriod ePeriod, eTimeout eTO);
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
eMeasPeriod ePeriod - defines the period over which the measurement is averaged. Legal values:
eTimeout eTO - defines the timeout to enforce. Legal values: TIMEOUT_10S | TIMEOUT_100S
2.45. PowerShell_GetConfigIdcaverage
function: PowerShell_GetConfigIdcaverage (int iSlot, int iPort, eTrigSrc *peSrc, eMeasPeriod *pePeriod,
eTimeout *peTO);
description: reads idcaverage settings using the PowerShell command "idcaverage ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
2.46. PowerShell_GetStatusIdcaverage
function: PowerShell_GetStatusIdcaverage (int iSlot, int iPort, eMeasState *peState, double *pdMeas);
description: reads idcaverage status using the PowerShell command "idcaverage stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
eMeasState *peState - location to store the measurement status in. Response should be:
double *pdMeas - location to store the measured current in. The value is only valid when the status
response is MEAS_READY.
2.47. PowerShell_SetConfigIdcpeak
function: PowerShell_SetConfigIdcpeak (int iSlot, int iPort, ePeak ePk, eTrigSrc eSrc, eMeasPeriod ePeriod,
eTimeout eTO);
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
eMeasPeriod ePeriod - defines the period over which the measurement is averaged. Legal values:
eTimeout eTO - defines the timeout to enforce. Legal values: TIMEOUT_10S | TIMEOUT_100S
2.48. PowerShell_GetConfigIdcpeak
function: PowerShell_GetConfigIdcpeak (int iSlot, int iPort, ePeak *pePk, eTrigSrc *peSrc, eMeasPeriod *pePeriod,
eTimeout *peTO);
description: reads idcpeak settings using the PowerShell command "idcpeak ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
2.49. PowerShell_GetStatusIdcpeak
function: PowerShell_GetStatusIdcpeak (int iSlot, int iPort, eMeasState *peState, double *pdMeas);
description: reads idcpeak status using the PowerShell command "idcpeak stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
eMeasState *peState - location to store the measurement status in. Response should be:
double *pdMeas - location to store the measured current in. The value is only valid when the status
response is MEAS_READY.
2.50. PowerShell_SetConfigIdctrace
function: PowerShell_SetConfigIdctrace (int iSlot, int iPort, eTrigSrc eSrc, eMeasPeriod ePeriod, eTimeout eTO);
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
eMeasPeriod ePeriod - defines the period over which the measurement is averaged. Legal values:
eTimeout eTO - defines the timeout to enforce. Legal values: TIMEOUT_10S | TIMEOUT_100S
2.51. PowerShell_GetConfigIdctrace
function: PowerShell_GetConfigIdctrace (int iSlot, int iPort, eTrigSrc *peSrc, eMeasPeriod *pePeriod, eTimeout
*peTO);
description: reads idctrace settings using the PowerShell command "idctrace ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
2.52. PowerShell_GetStatusIdctrace
function: PowerShell_GetStatusIdctrace(int iSlot, int iPort, eMeasState *peState, double *pdTime, double *pdMeas,
int *pLenResult);
description: reads idctrace status using the PowerShell command "idctrace stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
eMeasState *peState - location to store the measurement status in. Response should be:
double *pdTime - location of array to store the time trace points in. The values are only valid when the
status response is MEAS_READY.
double *pdMeas - location of array to store the measured current trace points in. The values are only valid
when the status response is MEAS_READY.
NOTE about the variables passed in: pdTime and pdMeas must each be an array of sufficient length
to hold the full number of points returned in the Tcl result. When the trace meter is
configured for a standard length period, the result will contain 256 points. When the trace
meter is configured for an extended length period, the result will contain 1024 points.
int *pLenResult - pointer to the location to store the number of results stored in each array. On entry
pLenResult must be set to the number of elements in pdTime[] and pdMeas[]. On return, it will be set
to the number of results written to pdTime[] and pdMeas[].
2.53. PowerShell_SetConfigTimint
description: configures time interval settings using the PowerShell command "timint".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
eTimeMode eTimMode - defines the time interval measurement mode. Legal values:
eTrigSrc eStartSrc - defines the trigger source that starts the measurement. Legal values:
TRIG_SRC_EXT | TRIG_SRC_TRIG1
eEdge eStrtEdg - defines the edge direction for trig1. Legal values:
EDGE_RISING | EDGE_FALLING
double dStartLevel - defines the threshold level for trig1. Legal values: 0.25 - 59.5.
eEdge eStopEdg - defines the edge direction for trig2. Legal values: EDGE_RISING | EDGE_FALLING
double dStopLevel - defines the threshold level for trig2. Legal values: 0.25 - 59.5.
eTimeout eTO - defines the timeout to enforce. Legal values: TIMEOUT_10S | TIMEOUT_100S
eTrigMode eMode - defines the trigger noise immunity mode. Legal values:
TRIGMODE_NORMAL | TRIGMODE_NOISY
2.54. PowerShell_GetConfigTimint
description: reads time interval settings using the PowerShell command "timint ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
eTimeMode *peTimMode - the location to store the time interval measurement mode setting in.
eTrigSrc *peStartSrc - the location to store the start trigger setting in.
eEdge *peStrtEdg - the location to store the trig1 edge setting in.
double *pdStartLevel - the location to store the trig1 threshold level setting in.
eEdge *peStopEdg - the location to store the trig2 edge direction setting in.
double *pdStopLevel - the location to store the trig2 threshold level setting in.
eTrigMode *peMode - the location to store the trigger noise immunity mode setting in.
(only used by PSA-3102)
2.55. PowerShell_GetStatusTimint
description: reads time interval status using the PowerShell command "timint stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE a pairset (65 = ‘A’, 66 = ‘B’) must be specified when the blade is configured for 4 pair
operation.
eMeasState *peState - location to store the measurement status in. Response should be:
double *pdMeas - location to store the measured time in. The value is only valid when the status response
is MEAS_READY.
2.56. PowerShell_SetConfigItrans
function: PowerShell_SetConfigItrans (int iSlot, int iPort, double dCurrent1, double dTime1, double dCurrent2,
double dTime2, eTrigSrc eTrgSrc, eTrigOut eTrgOut, eSfb eFBS);
description: configures transient load settings using the PowerShell command "itrans".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
double dCurrent1 - the current setting for the first transient step. Legal values 0 - 2000mA (for PSA-3102),
512mA (for PSx-1200). Units mA.
double dTime1 - the duration of the first transient step. Legal values 0.0002s - 1s.
NOTE: when dCurrent1 is set > 1024mA, the maximum time is limited to 80ms.
NOTE: values in the range 0.0002 - 0.000999 will be passed to itrans as 200u - 999u. Any value >= 0.001
will be passed to itrans as msec (i.e. with an 'm' appended).
double dCurrent2 - the current setting for the second transient step. Legal values 0 -750mA
(for PSA-3102), 512mA (for PSx-1200). Units mA.
double dTime2 - the duration of the second transient step. Legal values 0.0002s - 1s.
NOTE: the PowerShell itrans command also supports the value HOLD for this parameter. HOLD is
indicated by passing the value 9999.
NOTE: values in the range 0.0002 - 0.000999 will be passed to itrans as 200u - 999u. Any value >= 0.001
will be passed to itrans as msec (i.e. with an 'm' appended).
eTrigOut eTrgOut - controls whether or not an external trigger event is generated when the transient starts.
Legal values TRG_OUT_EN | TRG_OUT_DIS
eSfb eFBS - controls whether or not Foldback Suppression is enabled when the next transient is applied
(only for PSA-3102). Legal values FSB_DIS | FSB_EN
2.57. PowerShell_GetConfigItrans
function: PowerShell_GetConfigItrans (int iSlot, int iPort, double *pdCurrent1, double *pdTime1,
double *pdCurrent2, double *pdTime2, int *piNumRslts);
description: reads the transient load settings using the PowerShell command "itrans ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
double *pdCurrent1 - pointer to the location to store the current setting for the first transient step in.
double *pdTime1 - pointer to the location to store the duration of the first transient step in.
double *pdCurrent2 - pointer to the location to store the current setting for the second transient step in.
double *pdTime2 - pointer to the location to store the duration of the second transient step in.
NOTE about the variables passed in: when the blade is configured for 2 pair operation, or the caller
specifies an individual pairset for iPort, the variables pointed to can be single storage locations.
When the blade is configured for 4 pair operation, and the connected port is specified, the
variables pointed to must be two element arrays.
int *piNumRslts - pointer to the location to store the number of results stored in each parameter. On entry,
this must define the number of array elements allocated for each parameter. On return, it will be set to
indicate how many values were discovered in the Tcl result (1 for 2 pair operation or for an individual
pairset, 2 for a port configured for 4 pair operation, where both pairset's configuration data is
returned).
2.58. PowerShell_SetConfigTrigPort
description: configures the TRIG PORT on the chassis Controller using the PowerShell command "trig_port".
parameters: eDir eDr - the direction of the signal. Legal values: TRGPORT_IN | TRGPORT_OUT
2.59. PowerShell_GetConfigTrigPort
description: configures the TRIG PORT on the chassis Controller using the PowerShell command "trig_port".
parameters: eDir *peDir - pointer to location to store the direction of the port in.
2.60. PowerShell_TrigOut
description: generates an event trigger with the defined slot,port using the PowerShell command "trigout".
parameters: int iSlot - the slot that the blade to output a trigger is installed in. Legal value: 1..12
int iPort - the port on the specified blade to output a trigger. Legal value: 1 | 2 | 65 | 66
2.61. PowerShell_GetPstatus
function: PowerShell_GetPstatus (int iSlot, int iPort, eLEDState *pePwr, int *piNumRslts);
description: read the status indicators from the defined slot,port using the PowerShell command "pstatus".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
eLEDState *pePwr - location to store the state of the PWR indicator. LED_ON = 1, LED_OFF = 2
NOTE about the variable passed in: when the blade is configured for 2 pair operation, or the caller
specifies an individual pairset for iPort, the variable pointed to can be single storage location.
When the blade is configured for 4 pair operation, and the connected port is specified, the
variable pointed to must be a two element array.
int *piNumRslts - pointer to the location to store the number of results stored in each parameter. On entry,
this must define the number of array elements allocated for pePwr. On return, it will be set to indicate
how many values were discovered in the Tcl result (1 for 2 pair operation or for an individual pairset,
2 for a port configured for 4 pair operation, where both pairset's data is returned).
2.62. PowerShell_CheckConnectionSingle
description: checks for a PSE connected to the defined slot,port using the PowerShell command "psa_conn_check".
parameters: int iSlot - the slot that the blade to check is installed in. Legal value: 1..12
int iPort - the port on the specified blade to check. Legal value: 1 | 2 | 65 | 66
eConnState *peState - location to store the connection state of the defined slot,port. Response:
CONN_CONNECTED | CONN_UNDETECTED
2.63. PowerShell_CheckConnectionAll
description: checks for a PSE connected to all slots,ports using the PowerShell command "psa_conn_check".
parameters: eConnState *peState - location to store the connection state of all ports in the chassis.
NOTE: the storage pointed to must be a 24 element array, in order to handle the case of a chassis populated
with 12 cards, therefore 24 ports. The storage must be contiguous locations! The library has NO WAY of
determining the length of the storage location passed, and will write to peState[0]..peState[23].
eState[0] = 1,1
eState[1] = 1,2
eState[2] = 2,1
eState[3] = 2,2
...
eState[23] = 12,2
2.64. PowerShell_DoConnect
function: PowerShell_DoConnect (int iSlot, int iPort, eEdge eEdg, double dLevel, double dCurrent, eTrigOut eTrOut,
ePSABoolean bMevent);
description: connects the defined port, sets trig1 parameters, and adjusts the current load using the PowerShell
command "psa_connect". If eTrout == TRG_OUT_EN, also generates a trigout when the connect is
performed.
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE a pairset (65 = ‘A’, 66 = ‘B’) can only be specified when the blade is configured for 4 pair
DUAL signature operation. The connected 4 pair port is the ony valid arguemtn when the
blade is configured for SINGLE signature operation.
eEdge eEdg - defines the trigger edge direction. Legal values EDGE_RISING | EDGE_FALLING
double dLevel - defines the threshold level for the trigger. Legal values 0.25 - 59.5
double dCurrent - the current level to be set, in units of mA. The legal value varies depending on the
model number of the blade being programmed (refer to the PSA-1200 and PSA-3000 Technical
Reference Manuals).
eTrigOut eTrout - defines whether or not to generate a trigger event when the port is closed. Legal values:
TRG_OUT_EN | TRG_OUT_DIS
ePSABoolean bMevent - defines whether or not multi-event class support should be enabled. Only used
with a PSA-3202 Legal values:
PSA_TRUE | PSA_FALSE
2.65. PowerShell_DoTriggeredConnect
function: PowerShell_DoTriggeredConnect (int iSlot, int iPort, eEdge eEdg, double dLevel, double dCurrent,
eTrigOut eTrOut, eTrConnState *peTrConn);
description: connects the defined port, sets trig1 parameters, and adjusts the current load using the PowerShell
command "psa_triggered_connect". If eTrout == TRG_OUT_EN, also generates a trigout when the
connect is performed.
NOTE that this differs from the PowerShell_DoConnect in that the connection will occur on the next
voltage transition meeting the trig1 configuration PRIOR to the execution of this command.
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE a pairset (65 = ‘A’, 66 = ‘B’) can only be specified when the blade is configured for 4 pair
DUAL signature operation. The connected 4 pair port is the ony valid arguemtn when the
blade is configured for SINGLE signature operation.
eEdge eEdg - defines the trigger edge direction. Legal values EDGE_RISING | EDGE_FALLING
double dLevel - defines the threshold level for the trigger. Legal values 0.25 - 59.5
double dCurrent - the current level to be set, in units of mA. The legal value varies depending on the
model number of the blade being programmed (refer to the PSA-1200 and PSA-3000
Technical Reference Manuals).
eTrigOut eTrout - defines whether or not to generate a trigger event when the port is closed.
Legal values TRG_OUT_EN | TRG_OUT_DIS
eTrConnState *peTrConn - pointer to storage allocated to store the response of the psa_triggered_connect
command in. Response should be TRCONN_CONNECTED | TRCONN_TIMEOUT.
2.66. PowerShell_DoDisconnect
description: powers down and disconnects the defined port using the PowerShell command "psa_disconnect".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE a pairset (65 = ‘A’, 66 = ‘B’) can only be specified when the blade is configured for 4 pair DUAL
signature operation. The connected 4 pair port is the ony valid arguemtn when the blade is
configured for SINGLE signature operation.
eTrigOut eTrout - defines whether or not to generate a trigger event when the port is disconnected.
Legal values TRG_OUT_EN | TRG_OUT_DIS
2.67. PowerShell_PowerPort
function: PowerShell_PowerPort (int iSlot, int iPort, int iClass, double dPower, ePortPwrStatus *pePStatus,
double *pdVoltage, int *piCurrent);
description: simulates a PD connected to the defined port, brings power up to a user specified condition using the
PowerShell command "power_port".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1|2
int iClass - defines the class that the port should indicate during classification. Legal values 0 - 4
double dPower - defines the final power draw of the port, in watts. Legal values 0.2 - 15.4
ePortPwrStatus *pePStatus - pointer to storage allocated by the caller to store the port's power status in.
double *pdVoltage - pointer to storage allocated by the caller to store the measured port voltage in.
int *piCurrent - pointer to storage allocated by the caller to store the programmed port current in.
2.68. PowerShell_PowerPortLLDP
function: PowerShell_PowerPortLLDP(int iSlot, int iPort, int iClass, double dPower, ePortPwrStatus *pePStatus,
double *pdVoltage, int *piCurrent, int iTimeout);
description: simulates a PD connected to the defined port, brings power up to a user specified condition using the
PowerShell command "power_port", including the optional “lldp” argument.
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1|2
int iClass - defines the class that the port should indicate during classification. Legal values 0 - 4
double dPower - defines the final power draw of the port, in watts. This is the value that will be used for the
LLDP request. Legal values 0.5 – 30.0. If the LLDP phase of the power up fails, and the power status is
PWR_POWERED_STANDBY, the test blade will be set to draw the default power for the defined class.
ePortPwrStatus *pePStatus - pointer to storage allocated by the caller to store the port's power status in.
double *pdVoltage - pointer to storage allocated by the caller to store the measured port voltage in.
int *piCurrent - pointer to storage allocated by the caller to store the programmed port current in.
int iTimeout – specifies the maximum amount of time to wait for the PSE to grant the requested power.
Legal values 2 – 120 seconds.
2.69. PowerShell_PowerBT
function: PowerShell_PowerBT (int iSlot, int iPort, ePDClass eClass, double dPower, ePortPwrStatus *pePStatus,
double *pdVoltageA, double *pdVoltageB, double *piCurrentA, double *piCurrentB, ePSABoolean
eUseLLDP, int iTimeout);
description: simulates a 4 pair PD, brings power up to a user specified condition using the PowerShell v5 PSA
command "power_bt".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the connected 4 pair port on the specified blade to set. Legal value: 1|2
ePDClass eClass - defines the class setting. Legal values are defined above in Enumerations.
double dPower - defines the final power draw of the port, in watts. Legal values 0.2 - 15.4
ePortPwrStatus *pePStatus - pointer to storage allocated by the caller to store the port's power status in.
double *pdVoltageA - pointer to storage allocated by the caller to store the measured port voltage for
Alternative A in.
double *pdVoltageB - pointer to storage allocated by the caller to store the measured port voltage for
Alternative B in.
double *piCurrentA - pointer to storage allocated by the caller to store the programmed port current for
Alternative A in.
double *piCurrentB - pointer to storage allocated by the caller to store the programmed port current for
Alternative B in.
int iTimeout – specifies the maximum amount of time to wait for the PSE to grant the requested power.
Legal values 2 – 120 seconds.
2.70. PowerShell_PowerCheck
description: reports the state of the defined port, using the PowerShell command "power_check".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
ePortPwrStatus *pePStatus - pointer to storage allocated by the caller to store the port's power status in.
PWR_POWERED
PWR_DOWN
PWR_POWERED_WO_LOAD
PWR_UNDETECTED
2.71. PowerShell_SetLoadPower
function: PowerShell_SetLoadPower (int iSlot, int iPort, double dPower, int iVport, int iIterations, eTrigOut eTrOut);
description: this is a convenience function that will set the power consumption of the defined port, using the PowerShell
command "psa_set_load". The load can be set with a high degree of accuracy if there are no meter
measurements armed, and the function can be allowed to perform a Vport measurement. If there is a meter
measurement armed, the function can still be used, with the Vport level to be used for calculating the active
load setting provided by the caller.
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
double dPower - defines the final power draw of the port, in watts. Legal values 0.5 – 37.5 (2-pair mode),
0.5 – 99.8 W (4-pair mode combined pairsets), 0.5-49.4W (4-pair mode, per pairset).
int iVport – the voltage to use when calculating the active load current setting required to draw the defined
power. This parameter is ignored unless iIterations = 0. Legal range 44 – 57 volts.
int iIterations – the number of times to measure Vport and refine the active load current setting. If there is a
meter measurement armed, pass the value 0 to communicate to the function that it should not
perform any Vport measurement, but should simply calculate the required active load setting using
the caller supplied Vport value. Legal range 0 – 5.
eTrigOut eTrgOut - controls whether or not an external trigger event is generated when the active load
setting is changed. Legal values TRG_OUT_EN | TRG_OUT_DIS
2.72. PowerShell_Wait
function: PowerShell_Wait (int iSlot, int iPort, eMeas eMes, int iTimeout, eMeasState *peState, int *piNumStates,
double *pdMeas, double *pdTime, int *piLenResult);
description: waits on the specified triggered measurement, running on the defined port, using the PowerShell command
"psa_wait".
parameters: int iSlot - the slot that the blade to measure with is installed in. Legal value: 1..12
int iPort - the port on the specified blade to measure with. Legal value: 1 | 2 | 65 | 66
VDCAVERAGE IDCAVERAGE
VDCPEAK IDCPEAK
VDCTRACE IDCTRACE
TIMINT
int iTimeout - time to wait for the measurement to complete, in seconds. Supported range 1-100 seconds.
eMeasState *peState - pointer to storage allocated by the caller to be used to return the status reported by
psa_wait in.
This variable can be a scalar if the blade is configured for 2 pair operation, or if the blade is
configured for 4 pair operation, but iPort specifies an individual pairset. When iPort specifies the
connected 4 pair jack, peState must be an array 2 elements in length.
int *piNumStates - pointer to the location to store the number of results stored in the peState parameter. On
entry, this must define the number of array elements allocated for the parameter. On return, it will be
set to indicate how many values were discovered in the Tcl result (1 for 2 pair operation or for an
individual pairset, 2 for a port configured for 4 pair operation, one for each pairset).
double *pdMeas - pointer to storage allocated by the caller to be used to store the measurement result in.
Whether or not this variable needs to be scalar or an array, and is an array the number of elements
needed, is a function of the meter being used, and the period (for trace meters).
double *pdTime - location of array to store the time trace points in. This parameter is only used when the
measurement type is trace. Pass NULL for non-trace measurement type.
NOTE: For the VDCTRACE meter, refer to PowerShell_GetStatusVdctrace for details about how the
pdMeas and pdTime variable needs to be configured.
int *pLenResult - pointer to the location to store the number of results stored in each array. On entry, for all
meters other than VDCTRACE, pLenResult must be set to the number of elements in pdTime[] and
pdMeas[]. On return, it will be set to the number of results written to pdTime[] and pdMeas[]. For the
VDCTRACE meter, refer to PowerShell_GetStatusVdctrace for details about how this variable needs
to be used.
2.73. PowerShell_Expire
description: forces the specified triggered measurement, running on the defined port, to terminate without completing.
This function uses the PowerShell command "psa_expire".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
VDCAVERAGE
VDCPEAK
VDCTRACE
IDCAVERAGE
IDCPEAK
IDCTRACE
TIMINT
2.74. PowerShell_GetSlotList
parameters: int *piSlot - location of array that will be used to store the list of valid slots identified by PowerShell.
NOTE: the storage location pointed to by piSlot MUST be at least 12 integers long, and must be
contiguous! The library has NO WAY of determining the length of the storage location passed, and will
write to piSlot[0]..piSlot[11].
2.75. PowerShell_GetErrString
description: retrieves an error string maintained by the API library. This string will be "No Error" if the last function
call succeeded, or will contain a message related to a failure if the the last function call returned an error
indication.
NOTE: this string is not persistent. It will be overwritten each time a function in the API library is called,
so it should be retrieved immediately after a function indicates an error, to prevent losing access to the
message associated with that error.
parameters: char *szErrStr - a character array that will be used to return the error string in.
int iLenErrStr - the length of the character array passed as the szErrStr parameter. If the indicated length is
shorter than the length of the error string, the error string will be truncated to fit the
available space.
NOTE: this parameter MUST accurately define the length of szErrStr, to prevent a buffer overrun. The
underlying API library is implemented in C, which does not provide any means to determine size or rank of
the character array.
NOTE: the only circumstance under which this function should return TCL_ERROR is if szErrStr == NULL.
2.76. PowerShell_Sequence
function: PowerShell_Sequence (int iLoopCount, char *pszSlotPortList, char *pszTestList, eTestRsltsDest eDest,
char *pszResultsFile, ePSABoolean eHighPower, ePSABoolean eBreak);
NOTE: this function was implemented to support PowerShell PSA version 3.4, and allowed the caller to
access the optional “-hp” command line argument. This function should be used to run conformance tests
with PSA-1200 Test Blades. To run conformance tests with PSA-3000 Test Blades, the function
PowerShell_SequenceAT should be used.
parameters: int iLoopCount - the number of times to loop the test. Legal values: 1..99
char *pszSlotPortList - string that defines the ports to be tested. This must take the form of a series of
valid PowerShell port specifications, separated by spaces, for example:
If the string "all" is passed, then all available ports are tested.
char *pszTestList - string that defines the tests to be performed. This must take the form of a series of valid
test names, separated by spaces, for example:
If the string "all" is passed, then all available conformance tests are performed.
eTestRsltsDest eDest - defines the destination to post results to. Legal values:
TEST_RESULTS_DEST_SPREADSHEET | TEST_RESULTS_DEST_TEXT
char *pszResultsFile - used to specify the absolute path to a text file to be used to store the test results in
when eDest == TEST_RESULTS_DEST_TEXT. If the results are to be written to the
default text file (see the PowerShell documentation for the "sequence" for details), pass the
string "default".
ePSABoolean eHighPower - includes the high power argument ("-hp") for the sequence command when set
to PSA_TRUE. Legal values: PSA_FALSE | PSA_TRUE
ePSABoolean eBreak - includes the break argument ("-break") for the sequence command when set to
PSA_TRUE. Legal values: PSA_FALSE | PSA_TRUE
2.77. PowerShell_SequenceAT
NOTE: this function should be used with PSA-3000 Test Blades, and PowerShell PSA version 4.0 or later.
For PSA-1200 Test Blades and PowerShell PSA version 3.4, see the function PowerShell_Sequence.
NOTE: Conformance tests are influenced by PowerShell PSA global variables defined in the PSA-3000
Technical Reference Manual, section 5 “Global PSE Description Parameters”. Utility functions that allow
you to set and query these variables are defined below, starting in section 2.78 PowerShell_SetPseClass.
parameters: int iLoopCount - the number of times to loop the test. Legal values: 1..99
char *pszSlotPortList - string that defines the ports to be tested. This must take the form of a series of
valid PowerShell port specifications, separated by spaces, for example:
If the string "all" is passed, then all available ports are tested.
char *pszTestList - string that defines the tests to be performed. This must take the form of a series of valid
test names, separated by spaces, for example:
If the string "all" is passed, then all available conformance tests are performed.
eTestRsltsDest eDest - defines the destination to post results to. Legal values:
TEST_RESULTS_DEST_SPREADSHEET | TEST_RESULTS_DEST_TEXT
char *pszResultsFile - used to specify the absolute path to a text file to be used to store the test results in
when eDest == TEST_RESULTS_DEST_TEXT. If the results are to be written to the
default text file, pass the string "default".
ePSABoolean eBreak - includes the break argument ("-break") for the sequence command when set to
PSA_TRUE. Legal values: PSA_FALSE | PSA_TRUE
int iClass – defines the class when eType == PSE_TYPE_1. Legal values: 0 | 1 | 2 | 3
ePSABoolean eNoReset – PSA_TRUE causes “-no_reset” to be included in the sequencer command line.
PSA_FALSE omits this argument.
2.78. PowerShell_SetPseClass
description: used to set the value of the PowerShell variable psaPseClass. This variable is used by the Conformance
Test Suite, which is accessed by calling PowerShell_Sequence. Refer to the PSA-3000 Technical
Reference Manual, section 5 “Global PSE Description Parameters” for details.
2.79. PowerShell_GetPseClass
parameters: ePseClass *peClass - the location to store the value retrieved from the PowerShell variable psaPseClass.
2.80. PowerShell_SetPseMps
description: used to set the value of the PowerShell variable psaPseMps. This variable is used by the Conformance Test
Suite, which is accessed by calling PowerShell_Sequence. Refer to the PSA-3000 Technical Reference
Manual, section 5 “Global PSE Description Parameters” for details.
2.81. PowerShell_GetPseMps
parameters: eMpsType *peType - the location to store the value retrieved from the PowerShell variable psaPseMps.
2.82. PowerShell_SetPseGrant
description: used to set the value of the PowerShell variable psaPseHpGrant. This variable is used by the Conformance
Test Suite, which is accessed by calling PowerShell_Sequence. Refer to the PSA-3000 Technical
Reference Manual, section 5 “Global PSE Description Parameters” for details.
2.83. PowerShell_GetPseGrant
parameters: eGrantType *peType - the location to store the value retrieved from the PowerShell variable
psaPseHpGrant.
2.84. PowerShell_GetVersion
description: returns the version string for the library. Will return an error if the buffer passed in is too small (indicated
by the iLenszLibVer parameter). Note that at the time this comment was written, the version string was 14
chars long, with the format "1.0 06/24/2009".
parameters: char *pszLibVer - pointer to a location to store the version string in.
2.85. PowerShell_SetLanState
description: configures the LAN setting using the PowerShell command "psa_lan".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2
2.86. PowerShell_GetLanState
description: reads the LAN setting using the PowerShell command "psa_lan ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1|2
2.87. PowerShell_GetLanStatus
description: queries the Ethernet Controller status using the PowerShell command "psa_lan stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1|2
char *szLanStatus - pointer to the char buffer pointed to copy the Tcl result into.
int iLenLanStatus - the length of the buffer pointed to by szLanStatus. The recommended buffer length 285
bytes.
NOTE: this parameter MUST accurately define the length of szLanStatus, to prevent a buffer overrun. The
underlying API library is implemented in C, which does not provide any means to determine size or rank of
the character array. If the Tcl result is longer than iLenLanStatus, the string being returned will be
truncated.
2.88. PowerShell_SetClass
description: this function that will set the active load to the current draw associated with the defined class. This function
may be used to define class 0..4 on PSx-3102 Test Blades. Classes 5..8 require a PSx-3202 Test Blade.
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
ePDClass eClass - defines the class setting. Legal values are defined above in Enumerations.
2.89. PowerShell_SetConfigMultiEvent
description: this function that will set the Multi-Event class load for the defined event to the defined current draw. This
function is only applicable for use with PSx-3202 Test Blades.
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
eMEventNum eEvent - defines the class setting. Legal values are defined above in Enumerations.
double dCurrent – the current signature to present for the defined class event.
2.90. PowerShell_GetConfigMultiEvent
function: PowerShell_GetConfigMultiEvent(int iSlot, int iPort, ePDClass *peClass, double *pdEv1, double *pdEv2,
double *pdEv3, double *pdEv4, double *pdEv5, int *piNumRslts);
description: this function read the Multi-Event class load settings. This function is only applicable for use with PSx-
3202 Test Blades.
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
ePDClass * peClass - pointer to the storage location to store the class value read from the blade in..
double *pdEv1 - pointer to the storage location to store the event 1 current value read from the blade in..
double *pdEv2 - pointer to the storage location to store the event 2 current value read from the blade in..
double *pdEv3 - pointer to the storage location to store the event 3 current value read from the blade in..
double *pdEv4 - pointer to the storage location to store the event 4 current value read from the blade in..
double *pdEv5 - pointer to the storage location to store the event 5 current value read from the blade in..
NOTE about the variables passed in: when the blade is configured for 2 pair operation, or the caller
specifies an individual pairset for iPort, the variables pointed to can be single storage locations.
When the blade is configured for 4 pair operation, and the connected port is specified, the
variables pointed to must be two element arrays.
int *piNumRslts - pointer to the location to store the number of results stored in each parameter. On entry,
this must define the number of array elements allocated for each parameter. On return, it will be set
to indicate how many values were discovered in the Tcl result (1 for 2 pair operation or for an
individual pairset, 2 for a port configured for 4 pair operation, where both pairset's configuration data
is returned).
2.91. PowerShell_SetMultiEventState
description: this function that will set the Multi-Event mode. This function is only applicable for use with PSx-3202
Test Blades.
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
2.92. PowerShell_GetStatusMultiEvent
description: this function reads the Multi-Event class load status. This function is only applicable for use with PSx-3202
Test Blades.
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..12
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
ePSABoolean *peState - pointer to the storage location to store the state read from the blade in.
ePSABoolean *peAuto - pointer to the storage location to store the autoclass state read from the blade in.
int *piEventCount - pointer to the storage location to store the event count read from the blade in.
ePSABoolean * peEv1LCE - pointer to the storage location to store the LCE status read from the blade in.
NOTE about the variables passed in: when the blade is configured for 2 pair operation, or the caller
specifies an individual pairset for iPort, the variables pointed to can be single storage locations.
When the blade is configured for 4 pair operation, and the connected port is specified, the
variables pointed to must be two element arrays.
int *piNumRslts - pointer to the location to store the number of results stored in each parameter. On entry,
this must define the number of array elements allocated for each parameter. On return, it will be set
to indicate how many values were discovered in the Tcl result (1 for 2 pair operation or for an
individual pairset, 2 for a port configured for 4 pair operation, where both pairset's configuration data
is returned).
2.93. PowerShell_ProcessCmd
description: evaluates the command string passed in pszCmd with the Tcl interpreter, and returns the Tcl result in the
buffer pszResponse. The string to be evaluated should be a valid Tcl command, and must be able to run to
completion - i.e. it cannot be a command that would require any interactive input (for example, the Tcl
command “gets stdin”).
parameters: char *pszCmd - pointer to the char buffer containing the command string. This string will be processed
with the Tcl “eval” command. Any valid form of Tcl command string should be acceptable, including the
use of ‘{‘ and ‘}’ or ‘”’ to delimit list arguments, and ‘[‘ ‘]’ brackets to delimit and embedded command
response. Examples:
psa_enable ?
set x "1 2 3"
set x {1 2 3}
set y [llength $x]
char *pszResponse – pointer to the char buffer pointed to copy the Tcl result into.
NOTE: the Tcl “eval” command returns a Tcl list result. To assist the calling context when parsing this list,
each list element is delimited with a ‘;’ character. For example, the response to “psa_enable ?” takes the
form:
PSA_Chassis=;192.168.221.140;Serial_No=;04AAD7BA5;PSA2400_Ctlr=;DISABLED;
PSA_Interactive=;ENABLED;PSE_Conf_Suite=;ENABLED;Adv_Resources=;ENABLED;
PSE_Multiport_Suite=;ENABLED;LLDP=;ENABLED;PHY_Performance_Suite=;ENABLED
NOTE: this parameter MUST accurately define the length of szResponse, to prevent a buffer overrun. The
underlying API library is implemented in C, which does not provide any means to determine size or rank of
the character array. If the Tcl result is longer than iLenResponse, the string being returned will be
truncated.
2.94. PowerShell_SetDebug
description: sets an internal variable that controls debug behavior. If the iState parameter == 1, attempts to write a
message to the file defined by szDbgFile. Note that the file open mode used in this case is "w", so this is a
destructive operation with respect to a pre-existing file of the same name.
The “debug” mode is primarily intended to be used to collect internal library function information to aid
Sifos in providing technical support. The information consists of API argument to PowerShell Tcl
translation, and result parsing.
2.95. PowerShell_GetDebug
returns: TCL_OK
2.96. PowerShell_QuickTest
function: PowerShell_QuickTest (int iNumPorts, int *piSlots, int *piPorts, ePseType eType, ePSABoolean eLLDP,
eDetAccept *peDetAccept, eDetReject *peDetReject, double *pdVportLow, double *pdVportHigh,
int *piLoadCap, double *pdPwrCap, eDisconShut *peDisconn, eOverload *peOverload,
eLLDPAlloc *peLLDPAlloc);
description: calls the example test function psa_quick_test (when connected to a PSA-3000) or psl_quick_test (when
connected to a PSL-3000). The tests are performed on the defined ports, based on the defined PSE type and
LLDP flag (for a Type-2 PSE).
NOTE: the underlying API library function was originally implemented to work with psa_quick_test
version 4.0.02 and psl_quick_test version 4.0.02. If the underlying script is modified, and any of
the result parameter names changed, the API function will not complete successfully. Any
modifications should be made to a copy of the psx_quick_test script.
parameters: int iNumPorts – defines the number of ports to be tested. Legal values: 4 – 8. This parameter also defines
the length of the array parameters that are passed to the API library.
NOTE: this parameter MUST accurately define the length of the array parameters, to prevent a buffer
overruns. The underlying API library is implemented in C, which does not provide any means to determine
size or rank of an array. All arrays must be at least iNumPorts elements long.
int *piSlots – pointer to an array that contains a list of slots to be used to form the slot,port arguments for
the underlying psx_quick_test command. The values in this array are paired with the values
located at the same indices in the piPorts array.
int *piPorts – pointer to an array that contains a list of ports to be used to form the slot,port arguments for
the underlying psx_quick_test command. The values in this array are paired with the values
located at the same indices in the piSlots array.
NOTE: each test result is stored in its respective array at the index related to the slot,port used to
measure it.
ePSABoolean eLLDP - PSA_TRUE = use LLDP | PSA_FALSE = don’t use LLDP. The underlying script
only pays attention to this when eType = PSE_TYPE_2.
eDetAccept *peDetAccept – pointer to the array to put the “Detect_Accept” results in.
eDetReject *peDetReject – pointer to the array to put the “Detect_Reject” results in.
double *pdVportLow – pointer to the array to put the “Vport_Low_Load” results in.
double *pdVportHigh – pointer to the array to put the “Vport_High_Load” results in.
int *piLoadCap – pointer to the array to put the “Load_Capacity” results in.
double *pdPwrCap – pointer to the array to put the “Power_Capacity” results in.
eDisconShut *peDisconn – pointer to the array to put the “Disconnects” results in.
eOverload *peOverload – pointer to the array to put the “Overloads” results in.
eLLDPAlloc *peLLDPAlloc – pointer to the array to put the “LLDP_Allocations” results in.
2.97. PowerShell_PSLSetup
description: configures a PSL-3402 test port using the PowerShell command "psl_setup".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24 | 99
int iPort - the port on the specified blade to set. Legal value: 1 | 2
2.98. PowerShell_GetPSLSetup
description: reads the PSL-3402 test port configuration using the PowerShell command "psl_setup ?".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24
int iPort - the port on the specified blade to set. Legal value: 1 | 2
ePLPortConfig *peConfig – pointer to the location to store the port configuration setting in
2.99. PowerShell_PLSetPassiveLoad
description: configures the PASSIVE load settings on a PSL-3402 using the PowerShell command "passive".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24 | 99
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
2.100. PowerShell_PLGetPassiveLoad
function: PowerShell_PLGetPassiveLoad (int iSlot, int iPort, int *piRes, int *piNumRslts);
description: reads the PASSIVE load settings from a PSL-3402 using the PowerShell command "passive ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
NOTE about the variable passed in: when the blade is configured for 2 pair operation, or the caller
specifies an individual pairset for iPort, the variable pointed to can be a single storage location.
When the blade is configured for 4 pair operation, and the connected port is specified, the
variable pointed to must be a two element array.
int *piNumRslts - pointer to the location to store the number of results stored in each parameter. On entry,
this must define the number of array elements allocated for each parameter. On return, it will be set to
indicate how many values were discovered in the Tcl result (1 for 2 pair operation or for an individual
pairset, 2 for a port configured for 4 pair operation, where both pairset's configuration data is
returned).
2.101. PowerShell_PLSetConfigPtrans
function: PowerShell_PLSetConfigPtrans (int iSlot, int iPort, double dCurrent, ePtransDuration eDuration,
ePtransTrig eTrig);
description: configures the transient load setting on a PSL-3402 using the PowerShell command "ptrans".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24 | 99
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
double dCurrent - the current setting for the transient step. Legal values 0 - 975mA when the addressed port
is configured for 2 pair operation, and 0 - 1950mA when the port is configured for 4 pair operation.
2.102. PowerShell_PLGetConfigPtrans
function: PowerShell_PLGetConfigPtrans (int iSlot, int iPort, double *pdCurrent, ePtransDuration *peDuration);
description: reads the transient load setting from a PSL-3402 using the PowerShell command "ptrans ?".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
double *pdCurrent – pointer to the location to store the current setting in.
ePtransDuration eDuration – pointer to the location to store the duration setting in.
2.103. PowerShell_PLSetPort
description: configures the PORT state of a PSL-3402 using the PowerShell command "port".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24 | 99
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
ePortState eState - the state of the port. Legal values: PORT_CONNECTED | PORT_ISOLATED
2.104. PowerShell_PLGetPort
description: reads the PORT state from a PSL-3402 using the PowerShell command "port ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
ePortState *peState – pointer to the location to store the state of the port in.
NOTE about the variable passed in: When the blade is configured for 2 pair operation, 4 pair SINGLE
signature operation, or the caller specifies an individual pairset for iPort, the variable pointed to
can be single storage locations. When the blade is configured for 4 pair DUAL signature
operation, and the connected port is specified, the variable pointed to must be a two element
array.
int *piNumRslts - pointer to the location to store the number of results stored in the parameter. On entry,
this must define the number of array elements allocated for the parameter. On return, it will be set to
indicate how many values were discovered in the Tcl result (1 for 2 pair operation, 4 pair SINGLE
signature operation, or for an individual pairset, 2 for a port configured for 4 pair DUAL signature
operation, where both pairset's configuration data is returned).
2.105. PowerShell_PLSetClass
function: PowerShell_PLSetClass (int iSlot, int iPort, ePDClass eClass, ePLAutoclass eAutoclass);
description: configures the class signature of a PSL-3402 test port, using the PowerShell command 'class'.
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24 | 99
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
ePDClass eClass - defines the class setting. Legal values are defined above in Enumerations
ePLAutoclass eAutoclass - defines whether or not to indicate that the emulated PD supports Autoclass.
Legal values: PL_AUTOCLASS_ENABLED | PL_AUTOCLASS_DISABLED.
2.106. PowerShell_PLGetClass
function: PowerShell_PLGetClass (int iSlot, int iPort, ePDClass *peClass, int *piNumRslts,
ePLAutoclass *peAutoclass);
description: reads the class signature from a PSL-3402 test port, using the PowerShell command 'class ?'.
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24 | 99
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
ePDClass *peClass – pointer to the location to store the class setting in.
NOTE about the variable passed in: when the blade is configured for 2 pair operation, or the caller
specifies an individual pairset for iPort, the variable pointed to can be a single storage location.
When the blade is configured for 4 pair operation, and the connected port is specified, the
variable pointed to must be a two element array.
int *piNumRslts - pointer to the location to store the number of results stored in the parameter. On entry,
this must define the number of array elements allocated for the parameter. On return, it will be set to
indicate how many values were discovered in the Tcl result (1 for 2 pair operation, 4 pair SINGLE
signature operation, or for an individual pairset, 2 for a port configured for 4 pair DUAL signature
operation, where both pairset's configuration data is returned).
ePLAutoclass *peAutoclass – pointer to the location to store the Autoclass setting in.
2.107. PowerShell_PLSetIload
description: sets the current load on a PSL-3402 using the PowerShell command "iload".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24 | 99
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
double dCurrent - t The legal value varies depend on the test port configuration - when configued for 2 pair
operation, the range is 0..975mA. When configured for 4 pair operation, the range is 0..1950mA.
double dInrushCurrent - the startup (inrush) current level to be set, in units of mA.
2.108. PowerShell_PLGetIload
function: PowerShell_PLGetIload (int iSlot, int iPort, double *pdCurrent, double * pdInrushCurrent);
description: reads the current load setting from a PSL-3402 using the PowerShell command "iload ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
double *pdCurrent - pointer to the storage location to store the current value read from the blade in. The
value is in units of mA.
double * pdInrushCurrent - pointer to the storage location to store the startup (inrush) current value read
from the blade in.
2.109. PowerShell_PLSetLanState
description: configures the LAN setting on a PSL-3402 using the PowerShell command "psa_lan".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24 | 99
int iPort - the port on the specified blade to set. Legal value: 1 | 2
NOTE: When a port is configured for 2PA, only N,2 can be addressed, and when configured for 2PB,
SINGLE, or DUAL only N,1 can be addressed. The addressing rules are enforced at the Tcl
command level, not in this function.
2.110. PowerShell_PLGetLanState
description: reads the LAN setting from a PSL-3402 using the PowerShell command "psa_lan ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2
NOTE: When a port is configured for 2PA, only N,2 can be addressed, and when configured for 2PB,
SINGLE, or DUAL only N,1 can be addressed. The addressing rules are enforced at the Tcl
command level, not in this function.
ePLLanLink *peLink - the location to store the LAN interface link behavior setting in.
2.111. PowerShell_PLGetLanStatus
description: queries the Ethernet Controller status from a PSL-3402 using the PowerShell command "psa_lan stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2
NOTE: When a port is configured for 2PA, only N,2 can be addressed, and when configured for 2PB,
SINGLE, or DUAL only N,1 can be addressed. The addressing rules are enforced at the Tcl
command level, not in this function.
ePLLanStatus *peStatus - pointer to the location to store the status enumeration value in.
2.112. PowerShell_PLGetPstatus
function: int CALLCONV PowerShell_PLGetPstatus(int iSlot, int iPort, eLEDState *peStateA, eLEDState *peStateB,
ePDClass *peClassA, ePDClass *peClassB, ePLPSEType *peType);
description: read the status information from the defined slot,port on a PSL-3402 using the PowerShell command
"pstatus stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
eLEDState *peStateA - location to store the state of the Alt A pairset in.
eLEDState *peStateB - location to store the state of the Alt B pairset in.
ePDClass *peClassA - location to store the assigned class for Alt A in.
ePDClass *peClassB - location to store the assigned class for Alt B in.
2.113. PowerShell_PLSetConfigVdcaverage
function: PowerShell_PLSetConfigVdcaverage (int iSlot, int iPort, ePLTrigSrc eTrigSrc, eMeasPeriod ePeriod);
description: configures vdcaverage settings on a PSL-3402 using the PowerShell command "vdcaverage".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24 | 99
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
PL_TRIG_SRC_EXT | PL_TRIG_IMMEDIATE
eMeasPeriod ePeriod - defines the period over which the measurement is averaged. Legal values:
MEAS_PERIOD_100m | MEAS_PERIOD_1s
2.114. PowerShell_PLGetConfigVdcaverage
function: PowerShell_PLGetConfigVdcaverage (int iSlot, int iPort, ePLTrigSrc *peSrc, eMeasPeriod *pePeriod);
description: reads vdcaverage settings from a PSL-3402 using the PowerShell command"vdcaverage ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
2.115. PowerShell_PLGetStatusVdcaverage
function: PowerShell_PLGetStatusVdcaverage (int iSlot, int iPort, eMeasState *peState, double *pdMeas,
int *piNumRslts);
description: reads vdcaverage status from a PSL-3402 using the PowerShell command "vdcaverage stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
eMeasState *peState - location to store the measurement status in. Response should be:
double *pdMeas - location to store the measured voltage in. The value is only valid when the status
response is MEAS_READY
NOTE about the variables passed in: when the blade is configured for 2 pair operation, or the caller
specifies an individual pairset for iPort, the variables pointed to can be single storage
locations. When the blade is configured for 4 pair operation, and the connected port is
specified, the variables pointed to must be two element arrays.
int *piNumRslts - pointer to the location to store the number of results stored in each parameter. On entry,
this must define the number of array elements allocated for each parameter. On return, it will be set
to indicate how many values were discovered in the Tcl result (1 for 2 pair operation or for an
individual pairset, 2 for a port configured for 4 pair operation, where both pairset's configuration
data is returned).
2.116. PowerShell_PLSetConfigVdcpeak
function: PowerShell_PLSetConfigVdcpeak (int iSlot, int iPort, ePeak ePk, ePLTrigSrc eTrigSrc, eMeasPeriod
ePeriod);
description: configures vdcpeak settings on a PSL-3402 using the PowerShell command "vdcpeak".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24 | 99
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
PEAK_MIN | PEAK_MAX
PL_TRIG_SRC_EXT | PL_TRIG_IMMEDIATE
eMeasPeriod ePeriod - defines the period over which the measurement is averaged. Legal values:
MEAS_PERIOD_100m | MEAS_PERIOD_1s
2.117. PowerShell_PLGetConfigVdcpeak
function: PowerShell_PLGetConfigVdcpeak (int iSlot, int iPort, ePeak *pePk, ePLTrigSrc *peSrc, eMeasPeriod
*pePeriod);
description: reads vdcpeak settings from a PSL-3402 using the PowerShell command"vdcpeak ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
2.118. PowerShell_PLGetStatusVdcpeak
function: PowerShell_PLGetStatusVdcpeak (int iSlot, int iPort, eMeasState *peState, double *pdMeas,
int *piNumRslts);
description: reads vdcaverage status from a PSL-3402 using the PowerShell command "vdcaverage stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
eMeasState *peState - location to store the measurement status in. Response should be:
double *pdMeas - location to store the measured voltage in. The value is only valid when the status
response is MEAS_READY
NOTE about the variables passed in: when the blade is configured for 2 pair operation, or the caller
specifies an individual pairset for iPort, the variables pointed to can be single storage
locations. When the blade is configured for 4 pair operation, and the connected port is
specified, the variables pointed to must be two element arrays.
int *piNumRslts - pointer to the location to store the number of results stored in each parameter. On entry,
this must define the number of array elements allocated for each parameter. On return, it will be set
to indicate how many values were discovered in the Tcl result (1 for 2 pair operation or for an
individual pairset, 2 for a port configured for 4 pair operation, where both pairset's configuration
data is returned).
2.119. PowerShell_PLSetConfigIdcaverage
function: PowerShell_PLSetConfigIdcaverage (int iSlot, int iPort, ePLTrigSrc eTrigSrc, eMeasPeriod ePeriod);
description: configures idcaverage settings on a PSL-3402 using the PowerShell command "idcaverage".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24 | 99
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
PL_TRIG_SRC_EXT | PL_TRIG_IMMEDIATE
eMeasPeriod ePeriod - defines the period over which the measurement is averaged. Legal values:
MEAS_PERIOD_100m | MEAS_PERIOD_1s
2.120. PowerShell_PLGetConfigIdcaverage
function: PowerShell_PLGetConfigIdcaverage (int iSlot, int iPort, ePLTrigSrc *peSrc, eMeasPeriod *pePeriod);
description: reads idcaverage settings from a PSL-3402 using the PowerShell command"idcaverage ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
2.121. PowerShell_PLGetStatusIdcaverage
function: PowerShell_PLGetStatusIdcaverage (int iSlot, int iPort, eMeasState *peState, double *pdMeas);
description: reads idcaverage status from a PSL-3402 using the PowerShell command "idcaverage stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
eMeasState *peState - location to store the measurement status in. Response should be:
double *pdMeas - location to store the measured current in. The value is only valid when the status
response is MEAS_READY
2.122. PowerShell_PLSetConfigIdcpeak
function: PowerShell_PLSetConfigIdcpeak (int iSlot, int iPort, ePeak ePk, ePLTrigSrc eTrigSrc, eMeasPeriod ePeriod);
description: configures idcpeak settings on a PSL-3402 using the PowerShell command "idcpeak".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24 | 99
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
PEAK_MIN | PEAK_MAX
PL_TRIG_SRC_EXT | PL_TRIG_IMMEDIATE
eMeasPeriod ePeriod - defines the period over which the measurement is averaged. Legal values:
MEAS_PERIOD_100m | MEAS_PERIOD_1s
2.123. PowerShell_PLGetConfigIdcpeak
function: PowerShell_PLGetConfigIdcpeak (int iSlot, int iPort, ePeak *pePk, ePLTrigSrc *peSrc, eMeasPeriod
*pePeriod);
description: reads idcpeak settings from a PSL-3402 using the PowerShell command"idcpeak ?".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
2.124. PowerShell_PLGetStatusIdcpeak
function: PowerShell_PLGetStatusIdcpeak (int iSlot, int iPort, eMeasState *peState, double *pdMeas);
description: reads idcpeak status from a PSL-3402 using the PowerShell command "idcpeak stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
eMeasState *peState - location to store the measurement status in. Response should be:
double *pdMeas - location to store the measured current in. The value is only valid when the status
response is MEAS_READY
2.125. PowerShell_PLSetConfigPaverage
description: configures paverage settings on a PSL-3402 using the PowerShell command "paverage".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24 | 99
int iPort - the port on the specified blade to set. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
eMeasPeriod ePeriod - defines the period over which the measurement is averaged. Legal values:
MEAS_PERIOD_100m | MEAS_PERIOD_1s
NOTE: there is no PowerShell_PLGetConfigPaverage function, as the TCL API does not support a paverage config
query. If attempted, the user is told to use vdcaverage ?.
2.126. PowerShell_PLGetStatusPaverage
description: reads idcaverage status from a PSL-3402 using the PowerShell command "idcaverage stat".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
2.127. PowerShell_PLTrigOut
description: generates an event trigger with the PSL-3424 Controller using the PowerShell command "trigout".
parameters: none
2.128. PowerShell_PLDoDisconnect
description: powers down and disconnects the defined PSL-3402 port using the PowerShell command
"psa_disconnect".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24 | 99
int iPort - the port on the specified blade to set. Legal value: 1 | 2
2.129. PowerShell_PLCheckConnectionSingle
function: PowerShell_PLCheckConnectionSingle (int iSlot, int iPort, ePLPortConfig eConfig, eConnState *peState);
description: checks for a PSE connected to the defined PSL-3402 slot,port using the PowerShell command
"psl_conn_check".
parameters: int iSlot - the slot that the blade to check is installed in. Legal value: 1..24
int iPort - the port on the specified blade to check. Legal value: 1 | 2 | 65 | 66
eConnState *peState - location to store the connection state of the defined slot,port. Response:
CONN_CONNECTED | CONN_UNDETECTED
2.130. PowerShell_PLCheckConnectionAll
description: checks for a PSE connected to all PSL-3402 slots,ports using the PowerShell command "psl_conn_check".
eConnState *peState - location to store the connection state of all ports in the chassis.
NOTE: the storage pointed to must be a 24 element array. The storage must be contiguous locations! The
library has NO WAY of determining the length of the storage location passed, and will write to
peState[0]..peState[23].
eState[0] = p1
eState[1] = p2
eState[2] = p3
eState[3] = p4
...
eState[23] = p24
2.131. PowerShell_PLSetLoadPower
function: PowerShell_PLSetLoadPower (int iSlot, int iPort, double dPower, int iIterations, eTrigOut eTrOut);
description: this is a convenience function that will set the power consumption of the defined PSL-3402 port, using the
PowerShell command "psl_set_load".
parameters: int iSlot - the slot that the blade to read is installed in. Legal value: 1..24
int iPort - the port on the specified blade to read. Legal value: 1 | 2 | 65 | 66
NOTE: N,A and N.B port addressing can only be used when a test port is configured for 4 pair
operation. When a port is configured for 2PA, only N,2 can be addressed, and when configured
for 2PB, SINGLE, or DUAL, only N,1 can be addressed. The addressing rules are enforced at
the Tcl command level, not in this function.
double dPower - defines the final power draw of the port, in watts. Legal values 0.5 – 42.5 (2-pair mode,
pairset), 0.5 – 97.5 W (4-pair mode).
int iIterations – the number of times to measure Vport and refine the active load current setting. If there is a
meter measurement armed, pass the value 0 to communicate to the function that it should not
perform any Vport measurement, but should simply calculate the required active load setting using
the caller supplied Vport value. Legal range 0 – 5.
eTrigOut eTrgOut - controls whether or not an external trigger event is generated when the active load
setting is changed. Legal values TRG_OUT_EN | TRG_OUT_DIS
2.132. PowerShell_PLPowerPSE
function: int CALLCONV PowerShell_PLPowerPSE(int iSlot, int iPort, ePDClass eClass, ePLAutoclass eAuto, double
dPower, eTrigOut eTrg, ePSABoolean eUseLLDP, ePLPSEType ePSEType, int iTimeout, ePortPwrStatus
*peStatus, double *pdVoltageA, double *pdVoltageB, double *pdCurrent, ePDClass *pAssignedCls);
description: controls a PSL-3402 test port to get a PSE to furnish power using the command "power_pse".
parameters: int iSlot - the slot that the blade to set is installed in. Legal value: 1..24
ePDClass eClass - defines the class setting. Legal values are defined above in Enumerations.
ePLAutoclass eAuto - defines the class setting. Legal values are defined above in Enumerations.
double dPower - defines the final power draw of the port, in watts. Legal values 0.5 – 42.5 (2-pair mode,
pairset), 0.5 – 97.5 W (4-pair mode).
eTrigOut eTrg - defines whether or not to generate a trigger event when the port is connected. Legal values
TRG_OUT_EN | TRG_OUT_DIS
ePSABoolean eUseLLDP - flag that defines whether or not the additional LLDP arguments are used in the
"power_pse" command synthesized by this function. Note that the lldp_xx force <power>
arg will be used. Legal values: PSA_FALSE | PSA_TRUE
ePLPSEType ePSEType - defines the PSE type, and by association the 802.3 Power via MDI TLV format
to use. Legal values: PL_PSE_TYPE_AT | PL_PSE_TYPE_BT
int iTimeout – specifies the LLDP timeout to be used by the underlying Tcl “power_pse” command.
ePortPwrStatus *pePStatus - pointer to storage allocated by the caller to store the port's power status in.
double *pdVoltageA - pointer to storage allocated by the caller to store the measured port voltage for
Alternative A in.
double *pdVoltageB - pointer to storage allocated by the caller to store the measured port voltage for
Alternative B in.
double *piCurrent - pointer to storage allocated by the caller to store the programmed port current in.
ePDClass *pAssignedCls - pointer to storage allocated by the caller to store the assigned class in.
There are type differences in C# that you will need to keep in mind:
Special consideration must be given to passing strings that need to be written to by the API function. The string MUST
be declared using the System.Text.StringBuilder object, with a defined length. For example:
The DLL runtime has no way to determine the length of space that has actually been allocated for a string, so for any
API call that includes a string that will be written to by the API function, there will be a corresponding argument that is
used to pass the length of the string to the API function.
The value passed to the API function MUST accurately define the length, or you WILL encounter runtime errors related
to illegal memory location access.
A number of methods that perform configuration or status queries include the “ref” modifier keyword for parameters
that will be filled in by the underlying API function. When these methods are called, the calling context must include
the “ref” keyword with the related parameters.
A C# .NET class that defines enumerations and methods for each of the API functions is located in the source module
PowerShellv5API.cs.
There are type differences in VB .NET that you will need to keep in mind:
Special consideration must be given to passing strings that need to be written to by the API function. The string MUST
be declared using the System.Text.StringBuilder object, with a defined length. For example:
The DLL runtime has no way to determine the length of space that has actually been allocated for a string, so for any
API call that includes a string that will be written to by the API function, there will be a corresponding argument that is
used to pass the length of the string to the API function.
The value passed to the API function MUST accurately define the length, or you WILL encounter runtime errors related
to illegal memory location access.
Visual Basic .NET compatible declarations and enumerations are located in the source module PowerShellv5API.vb.
Parameters that are only passed in to API functions, and are not used to return values, are declared as being passed
“ByVal”.
Most parameters that are passed to API functions for the purpose of being used to return values are declared as being
passed “ByRef”. The exception to this is when passing strings. As discussed above in Type Differences, it is
necessary to use fixed length strings allocated in VB as the storage location for any value that is to be returned by the
API library. These strings are passed “ByVal”, even though they are being written to by the underlying library
functions.
For example, this function accepts strings as inputs, but does not write to those strings:
The variable to be passed as “szErrStr” needs to be declared with space already allocated:
The value passed for iLenErrStr would be LEN_PWRSHELL_ERR_STR_BUF, communicating the length of the string
(treated as a character array in the API) that can be written to by the PowerShell_GetErrString function.
This function reads the value of the enumeration variable “eSetting”, which is passed by value:
This function writes a value to the enumeration variable “eSetting”, which is passed by reference:
The table below shows the cross reference of API to LabView types that you will need to keep in mind when defining
pass parameters on the Parameters tab of the Call Library Function Configure… dialog:
C char array parameters are defined for the Call Library Function as Type = String, String Format = C String
Pointer.
When passing a string that needs to be written to by an API function, the Minimum Size field MUST be used to define
the length of that string.
The DLL runtime has no way to determine the length of space that has actually been allocated for a string, so for any
API call that includes a string that will be written to by the API function, there will be a corresponding argument that is
used to pass the length of the string to the API function.
The value passed to the API function MUST accurately define the length, or you will most likely encounter runtime
errors related to illegal memory location access. For example, the size to use for the LabView string passed to the
function PowerShell_GetErrString is defined by the macro LEN_PWRSHELL_ERR_STR_BUF, located in the
header file PowerShellAPI.h.
When the parameter being passed to an API function is an array, it is also necessary to correctly specify the length of
that array when the associated parameter is defined on the Parameters tab of the Call Library Function dialog.
4.2. Enumerations
The LabView Enum control can be used to define an enumeration to be passed to an API function. The Enum Data
Range Representation can be set to Unsigned Long (U32), and the Edit Items tab on the Enum Properties dialog
can be used to define the enumeration names and associated values. The enumerations used by the API library are
defined in the header file PowerShellAPI.h.
NOTE: the LabView Enum control always includes a definition for the value 0. In the LabView example furnished by
Sifos, in any case where 0 is not defined for a given API function parameter, the value 0 in the LabView Enum control
is identified with the name “UNKNOWN”.
The “Function” tab on the Call Library Function properties dialog allows the Calling convention to be specified. This
must be set to stdcall (WINAPI).
C prototype:
int CALLCONV PowerShell_Init(char *szChassisIPAddress, char *szRCFile);
LabView prototype (as shown in the Function prototype field on the “Function” tab of the Call Library Function
properties dialog:
long PowerShell_Init(CStr ChassisIPAddress, CStr RCFile);
C prototype:
int CALLCONV PowerShell_SetPassiveLoad(int iSlot, int iPort, int iRes,
int iCap);
LabView prototype:
long PowerShell_SetPassiveLoad(unsigned long Slot, unsigned long Port,
unsigned long Resistance, unsigned long Capacitance);
C prototype (the variables that the Resistance and Capacitance are stored in must be passed as pointers, also referred to
as pass by reference):
int CALLCONV PowerShell_GetPassiveLoad(int iSlot, int iPort, int *piRes,
int *piCap);
LabView prototype (in this case, note the use of the ‘*’ indicating parameters that are being passed by reference):
long PowerShell_GetPassiveLoad(unsigned long Slot, unsigned long Port,
unsigned long *pResistance, unsigned long *pCapacitance);
When an API parameter is defined as pass by reference, the resulting Call Library Function node in LabView must
have a node of the correct type and size connected to the related INPUT terminals of the Call Library Function node. In
the case of the PowerShell_GetPassiveLoad function shown above, a Simple Numeric node would be
connected to the terminals of the Call Library Function node that are designated for pResistance and pCapacitance.
When a LabView program is loaded and executed for the first time, the API DLL is loaded into memory (specifically,
memory associated with the LabView.exe process). If LabView is kept running, the DLL stays loaded for the lifetime
of that LabView process, and is not unloaded until LabView exits.
The PowerShell_Init function is used to initialize the PowerShell PSA software environment, loading Tcl and
connecting to a PSA chassis. This function can only be called once during the lifetime of the LabView process using
the API DLL. If the PowerShell_Init function is called again, it will return an error. The function
PowerShell_GetInitStatus should be used to test for whether or not the init function needs to be called.
If the LabView program needs to connect to a different PSA chassis, the function
PowerShell_ConnectToChassis can be used at any time.
There is a known issue first identified when using API library version 4.1.7 or older with LabView, where an error is
indicated when the API library is unloaded. This actually occurs when the Tcl DLL that the API library by necessity
uses is unloaded. It has been determined that there is an invalid memory access exception occurring in the Tcl library,
only at unload time. The API library is implemented in C++, and has the Tcl library unload wrapped in a try/catch
block. This correctly handles the error for all other runtime environments that the API library has been used with to-
date. The error mechanism in LabView is unexpected, and appears to be related to memory management in this
application context. To prevent an issue where Task Manager is needed to kill LabView.exe, call the function
PowerShell_UnInit before exiting the LabView program.
LabView VIs for each of the API functions are located under the path: Example_Code\PowerShellv5API\LabView
in the API Library .ZIP archive.
Each VI contains output terminals for inputs that are required by all VIs, to facilitate wiring up VIs in a LabView
program. These terminals include DLL Path, Slot, and Port. An API VI example Front Panel is shown in Figure
4.6-1, and the associated Block Diagram in Figure 4.6-2.
Figure 4.6-1
The various functions in the API library can only be called one at a time, and there are groups of functions that must be
called in a specific order. The API VIs do not natively exhibit the data dependent behavior that LabView objects need
to exhibit to implicitly control execute sequence. For example, it is necessary to configure a meter before attempting to
perform a measurement with that meter.
In order to facilitate the correct sequencing of the API VIs, the error in and error out terminals of the Call
Library Function node are brought out to error cluster terminals of each VI. These terminals should be connected
between objects to insure that they will sequence in the exact order desired. This is illustrated in Figure 4.6-3.
Figure 4.6-2
The example PowerShellAPI_LabView_Example.vi shows how to use various API functions, and how to
wire them up to achieve a desired sequence flow.
Figure 4.6-3
5.1. C Code
A C program example named PowerShellv5API_Example.c is included in the API Library .ZIP archive, under
the directory \Example_Code\PowerShellv5API\C_program. The associated project was created using Microsoft
Visual Studio 2005.
5.2. C# Code
A C# .NET example named UsingTheAPI.cs is included in the API Library .ZIP archive, under the directory
\Example_Code\PowerShellv5API\ Csharp_program\PowerShellv5API_Example. The associated project was
created using Microsoft Visual Studio 2005. Note that this directory also contains the class module
PowerShellv5API.cs, which contains enumerations and methods for each of the API functions.
A VB.NET example named UsingTheAPI.vb is included in the API Library .ZIP archive, under the directory
\Example_Code\PowerShellv5API\VB_NET_program\PowerShellv5API_Example. The associated project was
created using Microsoft Visual Studio 2005. Note that this directory also contains the source module
PowerShellv5API.vb, which contains enumerations and declarations for each of the API functions.
Figure 5.4-1
The API library needs to be loaded, and the initial connection to the PSA established, before any actions can be
performed with the instrument. Each VI that encapsulates a function call in the API library requires an input that defines
the path to the DLL file that contains that function call. Note that the Path String object located at the upper left of the
Front Panel, which contains the path to the DLL in the example directory. The output terminal of this object is
connected to the input of the first VI to be executed, as shown in the Block Diagram in Figure 5.4-2.
Note that Voltage meters exhibit a different behavior when the instrument is configured for 4 pair operation, where the
meter will return two measured values, one for Alt A and the other for Alt B. The underlying API functions handle this
by returning an array, so the corresponding “4pr”VIs provide output terminals that need to be correctly unpacked. Use
of this type of VI is illustrated in the 4 pair example program.
The remaining figures and discussion is related to the 2 pair example program. The sequence flow concepts are the
same in the 4 pair example.
Figure 5.4-2
In this case, the first VI called is PowerShell_SetDebug.vi, which contains a Call Library Function node that calls the
PowerShell_SetDebug function in the API DLL. The purpose of this function is to provide the means to have the
API library generate debug output that can be used by Sifos support in the case of any unexpected behavior by the API
library. The use of this VI is optional, and it can be omitted if no debug information is required.
The API library is written to support a variety of application environments. As described above, the API library
initializes a Tcl interpreter, and loads the PowerShell PSA extensions. The Tcl interpreter supports direct output to a
console (also referred to as “stdout”). In the case of LabView, there is no stdout channel available, and a runtime
error will occur unless Tcl is configured to disable the stdout channel. This is accomplished by calling the
PowerShell_ManageStdout function.
The initial connection to the PowerSync Analyzer chassis is performed by the PowerShell_Init function. This
function requires the IP address of the chassis, and the name of a Runtime Configuration (“RC”) file. An example RC
file is furnished with the LabView API example – the principal difference between this RC file and the default files
used by PowerShell PSA is that this file defines a 0 sec wait time for attempting the connection to the PSA chassis.
NOTE: as described above, once the DLL has been loaded and successfully initialized, the PowerShell_Init
function cannot be called again for the lifetime of the LabView process that loaded the DLL. The example program
contains logic that uses the return value from the function PowerShell_GetInitStatus to determine whether or
not the API library has been previously initialized. If yes, then the init function can be bypassed. The example program
shows an alternative, where the TRUE case includes a call to the PowerShell_ConnectToChassis function if
the library is detected as being already initialized. This is illustrated in the Block Diagram shown in Figure 5.4-3.
Figure 5.4-3
There is a service function named PowerShell_Wait that will test for up to a specified time limit for a meter to
have completed a measurement. If the measurement completes in the specified time, the measured value is returned. If
the measurement does not complete, a status (such as MEAS_TIMEOUT) is returned.
This function had to be exposed by two different VIs, to handle different data elements that need to be passed to the
underlying API function based on the meter being used. For any meter that returns a single value (VDCAverage,
VPDCPeak, IDCAverage, IDCPeak, Time Interval), the VI PowerShell_Wait can be called. The
PowerShell_Wait VI uses a pointer to one DOUBLE as the input value, and returns one DOUBLE value on the
output terminal. For any meter that returns a list of values (VDCTrace and IDCTrace), the VI
PowerShell_WaitTrace must be used. This VI passes a pointer to a 1-dimension array of DOUBLE to the
underlying API function, and returns a 1-dimension array of DOUBLE on the output terminal that contains the voltage
or current trace data points. It also passes a pointer to a 1-dimension array of DOUBLE to the underlying API function,
and returns a 1-dimension array of DOUBLE on the output terminal that contains the time that each data point was
measured at. This is shown in Figure 5.4-4. Note that this Block Diagram also illustrates how the output can be used to
build a Cluster, which can then be converted to the 2-dimension array that is needed as the input to an XY Graph object.
Figure 5.4-4
As of March, 2024, an example program that demonstrates how to work with the PSL-3424 has been added to the API
package. This additional example program is named PowerShellAPI_PSL-3424_Example.vi. Front panel
shown in Figure 5.4-5. This example uses a Flat Sequence structure to control the order in which the VI Call Function
objects are executed, shown in Figure 5.4-6.
Figure 5.4-5
Figure 5.4-6