Page: 50/81 User Manual PSU-CTRL-2D, Rev.1-00: Software Interface
data incorrectly received from the device. It also deactivates the
handshake lines to clear the communication buffer of the device and
to reset the communication speed to the default value of 9600 baud.
Note that the function
is automatically called
to establish a clean communica-
tion start independent of the previous data transfers.
Function COM_HVPSU2D_GetBufferState
int COM_HVPSU2D_GetBufferState
(WORD PortNumber, BOOL & Empty);
Command: Z
©
Response: Z
E
©
Saves the state of the device's input data buffer in the variable
Empty
and returns an error code according to Tab. 10.
When a large amount of data should be transferred to the device, this
function can be used to ensure that the input data buffer contains
enough free space. If the return value of the variable
Empty
is false,
the input buffer is not empty and there is no guarantee that the device
will be able to receive the data. This situation can occur if the device
has just received a large amount of data and has not yet finished
processing it. In such a case, the call to the function
should be repeated after several
milliseconds until the return value becomes
true
.
The response to the direct command (
Z
©
) contains one Boolean
character (
E
) for the variable
Empty
.
Function COM_HVPSU2D_DevicePurge
int COM_HVPSU2D_DevicePurge (WORD PortNumber,
BOOL & Empty);
Command: z
©
Response: z
E
©
Clears the device's output data buffer and saves the state of the de-
vice's input data buffer in the variable
Empty
like the function
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]