Page: 41/81 User Manual PSU-CTRL-2D, Rev.1-00: Software Interface
As a first parameter, most of the interface functions require the vari-
able
PortNumber
, which is the number of the communication
channel that should be used for the operation in question.
This number is an unsigned integer that must be lower than
COM_HVPSU2D_MAX_PORT
, i.e. it must be in the range from 0 to 15.
The return value of most functions contains a number indicating
the success of the operation. The return value is a signed
32-bit number (
int
). The last return value can be
reloaded by the function
ble
10 summarizes the possible return values together
with the error messages, which can also be obtained
. If a data
transfer failure has occurred, you can find the reason by
calling the functions
. The former returns the last
I/O error, the latter the corresponding error message (see Tab. 11).
If you encounter any problems with the error messages or with estab-
lishing the communication, please contact the manufacturer of the de-
vice.
Direct Command Control
As an alternative, direct control by a terminal program or another
software is possible. When using self-written software instead of the
supplied dynamic link library
COM-HVPSU2D.dll
, the programmer
must make sure to collect the data response after issuing a command
and to handle the possible communication errors.
The hardware communication protocol uses 8 data bits, 2 stop bits,
and even parity. The commands use ASCII characters only. Each
data transfer consists of a command character, optional control data,
and a termination character.
The termination character is the Carriage-Return code (CR, 0D hexa-
decimal; in the following text, it is referred to as the symbol
©
). The
termination character initiates the command execution in the device,
which then responses with ASCII characters that are similar to the
command.
Most parameters are transferred as a sequence of hexadecimal digits
in uppercase; the most significant digit is transferred first. In several
CGC Instruments
Tel.: +49 (371) 355 098–55
Hübschmannstr. 18 | D–09112 Chemnitz
Fax: +49 (371) 355 098–60
internet: www.cgc-instruments.com
e–mail: [email protected]