Page: 48/81 User Manual PSU-CTRL-2D, Rev.1-00: Software Interface
Communication Control
Function COM_HVPSU2D_Open
int COM_HVPSU2D_Open (WORD PortNumber,
WORD COMNumber);
Opens the communication channel and returns an error code accord-
ing to Tab. 10.
The function opens the channel with the number
PortNumber
and
attaches it to the serial port with the number
COMNumber
. The variable
PortNumber
must be lower than the number of implemented chan-
nels
COM_HVPSU2D_MAX_PORT
(see the declaration file
COM-
HVPSU2D.h
).
The serial port number
COMNumber
must point to a valid serial port to
which the controller is attached. Note that this number is the number
of the COM port, i.e.
COMNumber = 1
points to the port COM1. The
function accepts all numbers that are supported by the operating sys-
tem, i.e. any port between COM1 and COM255 can be used for the
communication.
prior to any other
communication function. If the function returns an error, the communi-
cation channel remains closed and no data communication is possi-
ble.
Function COM_HVPSU2D_Close
int COM_HVPSU2D_Close (WORD PortNumber);
Closes the communication channel and returns an error code accord-
ing to Tab. 10.
You can use this function to free the used port for another application.
If an application that has exclusively used the software interface
COM-HVPSU2D.dll
finishes, the opened communication channel
closes automatically. Thus, the programmer does not need to call the
function
explicitly.
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]