Chapter 6: programming, 1 overview, 2 standardized interface – Sensoray 2518 User Manual
Page 19: 3 board configuration functions
Sensoray Model 2518/2519 Ethernet Smart A/D™
16
Programming
Chapter 6: Programming
6.1 Overview
The Smart A/D™ is programmed by means of a small,
powerful built-in command set. Commands are issued to
the Smart A/D™ server by a client, which can be any
host on the same Ethernet network. Some commands
cause the unit to respond by returning data to the client.
This chapter details the embedded Smart A/D™
command set and the programming interface which
encapsulates the command access methods.
6.2 Standardized Interface
Because of the complexity of both network programming
and the native Smart A/D™ command set, a standardized
application programming interface (API) has been
developed. This API enables access to Smart A/D™
functions through an interface that is consistent for all
supported operating system and hardware platforms.
6.2.1 Distribution Diskette
The API consists of several software components that are
distributed on floppy diskette with the Smart A/D™. The
files on the distribution diskette include:
•
SmartAD.dll
—Windows Dynamic Link Library for
Sensoray Smart A/D™ boards.
•
Application programming examples and demonstration
programs.
6.2.2 API Functions
The remainder of this chapter focuses on the functional
characteristics of each API function by discussing what
happens on the Smart A/D™ when an API function is
executed, and the meaning of any values that are passed
to or received from a function.
In some cases, arguments that are passed to or from an
API function are specified as void. These arguments
employ nomenclature borrowed from the C/C++
languages to indicate that no parameter value is passed.
Similarly, an argument that is prefixed with an asterisk
(“*”) is indicative of a pointer.
You should refer to the documentation on the distribution
diskette for detailed, up-to-date information about the
current API release. This is recommended because:
•
API arguments and return values shown in this
document are only representative of the actual
parameter values and ordering used.
•
API functions often include additional arguments that
are not discussed here.
•
The current version of the API may not include all
functions or sensor types listed in this document.
•
The API may contain additional platform-specific
functions, not mentioned here, that are essential to the
creation of working application programs.
6.2.3 Channel Numbering Convention
Many of the API functions require a sensor channel
number as a parameter. By convention, channel numbers
on Smart A/D™ boards always begin at zero.
Channel numbers range from 0 to 7 on the model 2518,
and from 0 to 15 on the model 2519.
6.3 Board Configuration Functions
6.3.1 ResetBoard()
This function, which invokes a “soft reset,” provides a
means for forcing the Smart A/D™ to its reset state
without altering the states of any other boards in the
system. A soft reset has the same effect on the Smart
A/D™ as a hard system reset.
After executing this function, the Smart A/D™ is in its
default state. See Section 2.5 for detailed information
about the default state of the Smart A/D™.
6.3.2 GetFaultFlags()
The Smart A/D™ employs a hardware status register to
provide rapid access to the states of various hardware
fault conditions. In addition, the API maintains a log of
fault events that have occurred in the API software
functions. The status of all of these fault conditions, both
hardware and software, are available through the
GetFaultFlags function.
Arguments:
void
Returns:
void
Arguments:
void
Returns:
FaultFlags