Programming Examples; Example: Reading The Registers (Basic) - Agilent Technologies E1463A User's Manual And Scpi Programming Manual

32-channel, 5 amp, form c switch scpi programming guide
Hide thumbs Also See for E1463A:
Table of Contents

Advertisement

Programming Examples

Example: Reading
the Registers
(BASIC)
Appendix B
This section provides example programs in BASIC and C/HP-UX, including:

Example: Reading the Registers (BASIC)

Example: Reading the Registers (C/HP-UX)
Example: Making Measurements (BASIC)
Example: Making Measurements (C/HP-UX)
Example: Scanning Channels (BASIC)
Example: Scanning Channels (C/HP-UX)
This BASIC programming example reads the Manufacturer ID Register,
Device Type Register and Status Register on the Form C switch.
10
!*****************************************************
20
! ******
30
!*****************************************************
40
OPTION BASE 1
Set up arrays to store register names and addresses
50
!
60
DIM Reg_name$(1:3)[32], Reg_addr(1:3)
70
!
Read register names and addresses into the arrays
80
!
90
READ Reg_name$(*)
100
READ Reg_addr(*)
110
!
Set base address variable
120
!
130
Base_addr = DVAL("DE00",16)
140
!
Map the A16 address space in the controller
150
!
160
!
170
CONTROL 16,25;2
Call the subprogram Read_regs
180
!
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
300
!
and prints its contents
310
!
320
SUB Read_regs(Base_addr, Reg_name$(*), Reg_addr(*))
330
!
340
For Number = 1 to 3
350
Register = READIO(-16,Base_addr + Reg_addr(number))
360
PRINT Reg_name$(number); " = "; IVAL$(Register,16)
370
Next Number
380
SUBEND
READREG
Register-Based Programming 85
*****

Advertisement

Table of Contents
loading

Table of Contents