User`s guide

15
4
Universal Library Description and Use
The Universal Library consists of a set of functions that are callable from your program. These functions are
grouped according to their purpose. All of the groups except for Miscellaneous are based on which type of
device they are used with.
Important - Read the UL documentation, Readme file, and run the example programs
In order to understand the functions, please read the board-specific information section contained in this
manual and in the Readme files supplied on the Universal Library disk. We also urge you to examine and run
one or more of the example programs supplied prior to attempting any programming of your own. Following
this advice can save you hours of frustration and wasted time.
General UL language interface description
The interface to all languages is a set of function calls and a set of constants. The list of function calls and
constants are identical for each language. All of the functions and constants are defined in a "header" file for
each language. Refer to the sections below, and especially to the example programs for each language. This
manual is brief with respect to details of language use and syntax. For more detailed information, review the
example programs. Example programs for each language are located in the installation directory.
Function arguments
Each library function takes a list of arguments and most return an error code. Some functions also return data
via their arguments. For example, one of the arguments to cbAIn() is the name of a variable in which the
analog input value will be stored. All function arguments that return data are listed in the "Returns" section of
the function description.
Constants
Many functions take arguments that must be set to one of a small number of choices. These choices are all
given symbolic constant names. For example, cbTIn() takes an argument called Scale that must be set to
CELSIUS, FAHRENHEIT, or KELVIN. These constant names are defined, and are assigned a value in the "header"
file for each language. Although it is possible to use the numbers rather than the symbolic constant names, we
strongly recommend that you use the names. Using constant names make your programs more readable and
more compatible with future versions of the library. The numbers may change in future versions, but the
symbolic names always remain the same.
Options arguments
Some library functions have an argument called Options. The Options argument is used to turn on and off
various optional features associated with the function. If you set Options = 0, the function sets all of these
options to the default value, or OFF.
Some options can have an alternative value, such as DTCONNECT and NODTCONNECT. If an option can have
more than one value, one of the values is designated as the default. Individual options can be turned on by
adding them to the Options argument. For example:
Options = BACKGROUND will turn on the "background execution" feature.
Options = BACKGROUND+CONTINUOUS will select both the "background execution" and the "continuous
execution" feature.