Download Print this page

Advantech PCL-848A/B User Manual page 51

Multifunction ieee-488 interface card

Advertisement

10
'FILE NAME : EXAMPLE.4
20
'Program Example : AD500 PMU PROGRAMMING
30
'
40
'Purpose : This program measures 16 channel of voltages and
50
'display them. If the voltage of any channel is
60
'greater than a certain level then it close a
70
'relay to drive an alarm.
80
'
90
'Remark : The AD500 has a 16 channel multiplexer in alot 0
100
'and 16 channel relay actuator in slot 1. The };
110
'voltage measurement is done by an HP3478A DVM.
120
'The AD500 has an address of 9 and HP3478A has an
125
'address of 23.
130
'
140
'Initialization
150
'
160
CLS _
170
DIM V(16)
180
DEF SEG=&HD000
190
ABORT%=9 : ENTER%=6 : OUTPUT%=3: STATUS%=42: TRIGGER%=48
200
TIMEOUT%=45 : EOL%=12 : ADDR3478%=23 : ADDR500%=9
210
V.LIMIT=2 ' Voltage limit
220
'Set handshake timeout & init IEEE-488 bus
230
CALL ABORT% : FOR Y=0 TO 300 : NEXT Y 'Wait for ADSOOA reset
240
T%=5000 : CALL TIMEOUT%(T%) ' Set timeout 5 sec.
250
'Init ADSOOA terminator
260
OUTEOL%=2 : OUTEOLS=CHR$(13) : INEOL%=0 : INEOLBYTE%=10
270
CALL EOL%(ADDR500%,OUTEOL%,OUTEOL$,INEOL%,INEOLBYTE%)
280
'Set the DVM and Multiplexer
290
'
300
D$="FlT3RAN5"
310
CALL OUTPUT%(ADDR3478%,D$) ' Send DVM setting string
320
GOSUB 770 ' Error check
330
IF ER%<>0 THEN PRINT "Error when setting DVM." : END
340
'
350
D$="DW0,16;DW1,0";
360
CALL OUTPUT%(ADDR500%,D$) ' Open relays of Multiplexer
370
'and Actuator
380
GOSUB 770 ' Error check
390
IF ER%<>0 THEN PRINT "Error when setting AD500." : END
400
'
410
CHAPTER 4 PROGRAMMING TECBNIQUES
45

Advertisement

loading