beautypg.com

Blink led, Get error message – Measurement Computing SWITCH User Manual

Page 28

background image

Switch & Sense 8 User's Guide Template

Software Library Reference (ICalUSB.dll)

28

Arguments

DeviceNum

A number assigned by IcalUsb to the physical device. By default, if there is only one device in the system,

this number is 0.

PortNum

The port number to access. Valid entries are defined in the header file CbUsb.h and are shown below.
RELAY_PORT (0)

: Relay settings

FILTER_PORT (2): Filter settings

BitNum

The bit number to access. Each port is eight bits wide so valid settings are from 0 to 7.

DataValue

A user-defined integer variable that sets the state of the specified bit. Valid settings are 0 or 1.

Return values

CBUSB_SUCCESS (0):

Call completed successfully.

Blink LED

long cbUSBBlink (int DeviceNum)

Test communication with a specific Switch & Sense 8. When this function is called, the Status LED (closest to

the USB cable) on the back of the target Switch & Sense 8 blinks ten times.

Arguments

DeviceNum

A number assigned by IcalUsb to the physical device. By default, if there is only one device in the system,

this number is 0.

Return values

CBUSB_SUCCESS (0):

Call completed successfully.

Get error message

long cbUSBGetErrMsg (long ErrCode, char *ErrMsg)

Converts the return value from any of the library functions into an error message. There are nine library-specific

error messages. In addition, any system errors that occur as the result of a library function cal l will return the

associated Win32 error message.

Arguments

ErrCode

The return value from any of the library function calls.

ErrMsg

A pointer to a user defined character string to receive the error message text.
The application must allocate the ErrMsg string to be at least CBUSB_ERRSTRLEN long.
CBUSB_ERRSTRLEN

is defined to be 80 characters. Failure to allocate this string correctly can result in a

severe system error.

Return values

CBUSB_SUCCESS (0):

Call completed successfully.

This manual is related to the following products: