User`s manual
Agilent E1330B Digital I/O Module Register Information 123
Appendix B
Reading the
ID, Device
Type, and
Status
Registers
The following examples read the module ID, DEVICE ID, and STATUS registers
from the module.
IBASIC Version 10 !**********************************************************
20 !************** READREG *********
30 !**********************************************************
40 !OPTION BASE 0 is default
50 !Set up arrays to store register names and addresses
60 DIM Reg_name$(0:2)[32], Reg_addr(0:2)
70 !
80 !Read register names and addresses into the arrays
90 READ Reg_name$(*)
100 READ Reg_addr(*)
110 !
120 !Set base Address variable
130 Base_addr = DVAL ("1FE400",16)
140 !
150 !Map the A16 address space
160 !
170 !CONTROL 16,25;2 ! used only with V360 Controller
180 !Call the subprogram Read_regs
190 Read_regs(Base_addr, Reg_name$(*),Reg_addr(*))
200 !
210 DATA Identification Register, Device Register, Status Register
220 DATA 00, 02, 04
230 END
This subprogram steps through a loop that reads each register and prints its contents
320 SUB Read_regs(Base_addr, Reg_name$(*),Reg_addr(*))
330 FOR Number = 0 to 2
340 Register = READIO(-9826,Base_addr + Reg_addr(number))
350 PRINT Reg_name$(number);" = "; IVAL$(Register, 16)
360 NEXT Number
370 SUBEND
This program returns:
Identification Register = FFFF
Device Register = FF50
Status Register = (dependent on current status, default is FFBE)