RTP Series API Programming Reference  1.2.1
Session Management

Functions

EXPORT int PwrSnsr_FindResources (const char *Delimiter, int ValBufferSize, char Val[])
 Returns a delimited string of available resources. These strings can be used in the initialize function to open a session to an instrument. More...
 
EXPORT int PwrSnsr_GetMinimumSupportedFirmware (int *Version)
 Gets the minimum supported firmware as an integer. Format is YYYYMMDD. More...
 
EXPORT int PwrSnsr_SetTimeOut (SessionID Vi, long Milliseconds)
 Sets the time out in milliseconds for I/O. More...
 
EXPORT int PwrSnsr_GetTimeOut (SessionID Vi, long *Val)
 Returns the time out value for I/O in milliseconds. More...
 
EXPORT int PwrSnsr_init (char *ResourceName, SessionID *Vi)
 Initialize a communication session with a supported USB power sensor. More...
 
EXPORT int PwrSnsr_close (SessionID Vi)
 Closes the I/O session to the instrument. Driver methods and properties that access the instrument are not accessible after Close is called. More...
 
EXPORT int PwrSnsr_GetError (SessionID Vi, int *ErrorCode, int ErrorDescriptionBufferSize, char ErrorDescription[])
 This function retrieves and then clears the error information for the session. Normally, the error information describes the first error that occurred since the user last called the Get Error or Clear Error function. More...
 
EXPORT int PwrSnsr_ClearError (SessionID Vi)
 This function clears the error code and error description for the given session. More...
 
EXPORT int PwrSnsr_reset (SessionID Vi)
 
EXPORT int PwrSnsr_self_test (SessionID Vi, int *TestResult)
 Performs an instrument self test, waits for the instrument to complete the test, and queries the instrument for the results. If the instrument passes the test, TestResult is 0. More...
 
EXPORT int PwrSnsr_SetFetchLatency (SessionID Vi, int Latency)
 Set the period the library waits to update fetch measurements in ms. More...
 
EXPORT int PwrSnsr_GetFetchLatency (SessionID Vi, int *Latency)
 Get the period the library waits to update fetch measurements in ms. More...
 

Detailed Description

Session management functions

Function Documentation

◆ PwrSnsr_ClearError()

EXPORT int PwrSnsr_ClearError ( SessionID  Vi)

This function clears the error code and error description for the given session.

Parameters
ViThe SessionID handle that you obtain from the PwrSnsr_init function. The handle identifies a particular instrument session.
Returns
Success (0) or error code.

◆ PwrSnsr_close()

EXPORT int PwrSnsr_close ( SessionID  Vi)

Closes the I/O session to the instrument. Driver methods and properties that access the instrument are not accessible after Close is called.

Parameters
ViThe SessionID handle that you obtain from the PwrSnsr_init function. The handle identifies a particular instrument session.
Returns
Success (0) or error code.

◆ PwrSnsr_FindResources()

EXPORT int PwrSnsr_FindResources ( const char *  Delimiter,
int  ValBufferSize,
char  Val[] 
)

Returns a delimited string of available resources. These strings can be used in the initialize function to open a session to an instrument.

Parameters
DelimiterThe string used to delimit the list of resources ie. "|", " ", ";", etc.
ValBufferSizeNumber of elements in Val.
ValThe return string.
Returns
Success (0) or error code.

◆ PwrSnsr_GetError()

EXPORT int PwrSnsr_GetError ( SessionID  Vi,
int *  ErrorCode,
int  ErrorDescriptionBufferSize,
char  ErrorDescription[] 
)

This function retrieves and then clears the error information for the session. Normally, the error information describes the first error that occurred since the user last called the Get Error or Clear Error function.

Parameters
ViThe SessionID handle that you obtain from the PwrSnsr_init function. The handle identifies a particular instrument session.
ErrorCode
ErrorDescriptionBufferSize
ErrorDescription
Returns
Success (0) or error code.

◆ PwrSnsr_GetFetchLatency()

EXPORT int PwrSnsr_GetFetchLatency ( SessionID  Vi,
int *  Latency 
)

Get the period the library waits to update fetch measurements in ms.

Parameters
ViThe SessionID handle that you obtain from the PwrSnsr_init function. The handle identifies a particular instrument session.
LatencyFetch latency in ms.
Returns
Success (0) or error code.

◆ PwrSnsr_GetMinimumSupportedFirmware()

EXPORT int PwrSnsr_GetMinimumSupportedFirmware ( int *  Version)

Gets the minimum supported firmware as an integer. Format is YYYYMMDD.

Returns
Success (0) or error code.

◆ PwrSnsr_GetTimeOut()

EXPORT int PwrSnsr_GetTimeOut ( SessionID  Vi,
long *  Val 
)

Returns the time out value for I/O in milliseconds.

Parameters
ViThe SessionID handle that you obtain from the PwrSnsr_init function. The handle identifies a particular instrument session.
ValTime out in milliseconds. -1 denotes infinite time out.
Returns
Success (0) or error code.

◆ PwrSnsr_init()

EXPORT int PwrSnsr_init ( char *  ResourceName,
SessionID Vi 
)

Initialize a communication session with a supported USB power sensor.

Parameters
ResourceNameName of the resource. The resource descriptor is in the following format:
USB::[VID]::[PID]::[Serial Number]::SNSR
Where serial number is the USB power meter’s serial number in decimal format,
and the VID and PID are in hexidecimal format.
e.g. For serial number 1234, VID of 0x1bfe and PID of 0x5500:
USB::0x1BFE::0x5500::1234::SNSR
Multiple channel synthetic meters can be defined by combining more than one descriptor separated by a semicolon.
Channel assignment is determined by the order in the list, in other words CH1 would be the first listed resource,
CH2 the second resource, etc.
e.g. Define a synthetic peak power meter using serial number 1234 for CH1 and serial number 4242 for CH2:
USB::0x1BFE::0x5500::1234::SNSR;USB::0x1BFE::0x5500::4242::SNSR
ViThe SessionID handle
Returns
Success (0) or error code.

◆ PwrSnsr_reset()

EXPORT int PwrSnsr_reset ( SessionID  Vi)

Places the instrument in a known state.

Parameters
ViThe SessionID handle that you obtain from the PwrSnsr_init function. The handle identifies a particular instrument session.
Returns
Success (0) or error code.

◆ PwrSnsr_self_test()

EXPORT int PwrSnsr_self_test ( SessionID  Vi,
int *  TestResult 
)

Performs an instrument self test, waits for the instrument to complete the test, and queries the instrument for the results. If the instrument passes the test, TestResult is 0.

Parameters
ViThe SessionID handle that you obtain from the PwrSnsr_init function. The handle identifies a particular instrument session.
TestResultError or success code.
Returns
Success (0) or error code.

◆ PwrSnsr_SetFetchLatency()

EXPORT int PwrSnsr_SetFetchLatency ( SessionID  Vi,
int  Latency 
)

Set the period the library waits to update fetch measurements in ms.

Parameters
ViThe SessionID handle that you obtain from the PwrSnsr_init function. The handle identifies a particular instrument session.
LatencyFetch latency in ms.
Returns
Success (0) or error code.

◆ PwrSnsr_SetTimeOut()

EXPORT int PwrSnsr_SetTimeOut ( SessionID  Vi,
long  Milliseconds 
)

Sets the time out in milliseconds for I/O.

Parameters
ViThe SessionID handle that you obtain from the PwrSnsr_init function. The handle identifies a particular instrument session.
MillisecondsTime out in milliseconds. Use -1 for infinite time out.
Returns
Success (0) or error code.