Programming—
DM 5010
PROGRAMMING
AIDS
This
discussion of programming considerations and
the
program
examples are provided to aid in developing pro
grams to control the DM 5010. The program examples were
designed using
a
TEKTRONIX 4050-Series controller and
the
DM5010;
some
examples also use other TM 5000
programmable
instruments.
An initial
programming
consideration is
setting the
DM
5010
message terminator, GPIB address, and Talk
Only
mode switches.
To determine
their settings, press the INST
ID
button.
The
number displayed
is the selected GPIB pri
mary address;
the far right
decimal illuminates if the LF/EOI
message
terminator is
selected; the minus sign illuminates if
the
Talk Only
mode is selected. To change switch settings,
refer qualified
service personnel to the Maintenance section
of this
manual.
The
serial poll routine can be
expanded to decode infor
mation
about the
event causing the SRQ. In example 1,
lines 510 and 520 clear the busy bit in the status
byte; lines
530
through 560 decode the status byte, and lines 1000
through
7030 print the event class on the
controller
display.
Program example
7 uses
the
MONITOR
SRQ to detect
measurements above or below
limits
set by the LIMITS
command,
or overrange. Lines 1020, 1040, and 1045 de
code the status
byte and initiate the appropriate print out
on
the controller
display.
In program example
2,
line 130, the controller polls the
instrument at
address 16 to clear the power-on SRQ.
Line
160
turns SRQ off to inhibit additional SRQs. After SRQ
OFF, the
ERR? query may be inserted
in the program where
it is necessary to determine
an event state.
In the program examples, variable
D is assigned to the
DM
5010
GPIB primary address, which is assumed to be
set to decimal
16.
Using a variable name eliminates repeat
ing the
address decimal number and allows the address in
the program to
be easily changed.
Handling
Service Requests
At power-on, the DM 5010 asserts SRQ. The power-on
SRQ is incorporated
to inform the controller if the power
source is
interrupted during
program operation, since it may
interfere with proper
program execution.
The DM 5010 can
also
assert
SRQ for other events, if SRQ is enabled (see
Table 3-1,
Error Query and Status Information). Some con
trollers
have the capability of ignoring SRQs; the other con
trollers
require
servicing all
SRQs. If SRQs are to be
serviced
in the program, be sure to enable its interrupt.
Interrupt Handler
—
an interrupt driven routine to service
SRQs
when
they occur during program operation. An inter
rupt handler basically consists of an ON
SRQ statement in
the
beginning of the program, and a serial poll routine some
where
in the program. The ON SRQ statement directs pro
gram
control to the serial poll routine
when
an SRQ occurs.
See
program example 1
or 3,
line 110 for ON SRQ state
ments.
When an SRQ interrupt occurs, the controller per
forms the
serial poll routine.
In a POLL statement, the first
variable returns
the instruments position in the list of GPIB
addresses;
the
second variable returns the status byte. A
serial
poll of one instrument
on the bus is illustrated
in ex
ample
3, line 1000. Line 400 in example 4 polls three instru
ments
on
the bus, using the variable names for each
instrument address.
In each example, the POLL returns the
status
byte
from the instrument asserting SRQ. Program
example
9,
lines 150, 160, and 170 comprise a serial poll
using
4050-Series WBYTE
and RBYTE statements.
Front
Panel Lockout
The
front panel may be locked out so that only the con
troller may change instrument settings. To lock out the front
panel, first assert REN
(true). REN must remain
true as long
as lock out is
desired. For 4050-Series controllers, the RUN
statement
automatically asserts REN; the END statement
unasserts
REN. Then send the interface message LLO
(decimal 17 with ATN). This is done in the 4050-Series con
troller with
the WBYTE statement.
Finally,
address the in
strument
by sending a setting or query command using a
@D: statement or
send
only the listen address using
a
WBYTE statement. After these three steps, the front pan
el is
locked out and remains so until REN goes false or a
<GTL> message (decimal 1 with
ATN) is sent. See pro
gram example
4, lines
150 and
190; and example 5, lines
130
and
220.
Using INIT
Using
the
INIT
command simplifies the program because
it usually
takes fewer
commands to set the instrument state
than
specifying all settings
individually.
In program example
6,
line 150, the DM5010 receives the INIT command, fol
lowed by
a series of commands that change the instrument
state
from
the
INIT (power-on)
settings to the desired state.
Invalidating
a
Pending
Reading
Following
a change to the
applied input,
it may
be desir
able to
invalidate
the
pending reading since it no longer re
flects
the current measurement
conditions One way to
invalidate
a
pending reading is to send the instrument a set
ting
command—this causes the instrument to delete data in
the
output buffer.
Another way is to input a reading to the
controller
and ignore
it.
ADD JAN
1982
3-29
Summary of Contents for DM 5010
Page 14: ...DM 5010 2994 00 DM 5010 Programmable Digital Multimeter xii ADD JUL 1986...
Page 27: ...Operating Instructions DM 5010 2994 03 Fig 2 3 DM 5010 front panel controls and connectors 2 3...
Page 38: ......
Page 134: ......
Page 208: ......
Page 222: ......
Page 250: ......
Page 251: ...Section 8 DM 5010 OPTIONS No options are available 8 1...
Page 252: ......
Page 270: ......
Page 272: ...DM 5010 2994 37 Fig 10 2 Location of DM 5010 adjustments and test points...
Page 273: ......
Page 274: ......
Page 275: ......
Page 276: ...DM 5010 2994 112 DM 5010 BLOCK DIAGRAM...
Page 281: ......
Page 282: ......
Page 291: ......
Page 293: ......
Page 294: ......
Page 297: ......
Page 298: ......
Page 303: ......
Page 304: ...I...
Page 305: ......
Page 310: ......
Page 311: ......
Page 315: ......
Page 318: ......
Page 321: ......
Page 323: ......
Page 326: ......
Page 332: ...2994 57...
Page 334: ......
Page 335: ......
Page 336: ......
Page 337: ...63 REV JUN 1986...
Page 338: ...FIG 1 EXPLODED DM 5010...
Page 339: ......
Page 340: ......
Page 341: ......
Page 347: ......