Specifications

ZVx Programming Examples
1043.0009.50 D.1 E-2
Annex D Programming Examples
The following examples explain the programming of the instrument and can serve as a basis to solve
more complex programming tasks.
QuickBASIC has been used as programming language. However, the programs can be translated into
other languages.
D.1 Including IEC-Bus Library for QuickBasic
REM --- Include IEC-bus library for quickbasic -.Example for path definition
’$INCLUDE: ’c:\qbasic\qbdecl4.bas’
D.2 Initialization and Default Status
The IEC bus as well as the settings of the instrument are brought into a defined default status at the
beginning of every program. Subroutines "InitController" and "InitDevice" are used to this
effect.
D.2.1 Initiate Controller
REM ------------ Initiate controller -----------
REM InitController
iecaddress% = 20 ’IEC-bus address of the
’instrument
CALL IBFIND("DEV1", analyzer%) ’Open port to the instrument
CALL IBPAD(analyzer%, iecaddress%) ’Inform controller on instrument
’address
CALL IBTMO(analyzer%, 11) ’Response time to 1 sec
REM
************************************************************************
D.2.2 Initiate Instrument
The IEC-bus status registers and instrument settings of the analyzer are brought into the default status.
REM ------------ Initiate instrument --------------
REM InitDevice
CALL IBWRT(analyzer%, "*CLS") ’Reset status register
CALL IBWRT(analyzer%, "*RST") ’Reset instrument
REM
*************************************************************************