User`s manual

122 Agilent E1330B Digital I/O Module Register Information
Appendix B
Resetting the
Module
The following program resets the Agilent E1330 Digital I/O module (Bit 6 of the
Port Control/Status Register set to "1" then to"0"). Reset enables all four ports for
input, all other bits of other registers set to "0" IBASIC Version.
IBASIC Version 10 Base_addr = DVAL("1FE400",16)
!Logical Address 144.
20 Reg_addr = 04
!Offset for Status Control Register.
30 !Write a 0 then a 1 to bit 0 of status register.
40 WRITEIO -9826, Base_addr + Reg_addr; 1
50 WRITEIO -9826, Base_addr + Reg_addr; 0
60 END
C Version #include <stdio.h>
#include <chpib.h>
#define LOG_ADDR 144
#define BASE_ADDR (long) ((0x1FC000) + (64 * LOG_ADDR))
main ()
{
int reg_addr;
float send_data[3];
char state[2] = {13,10};
send_data[0] = BASE_ADDR + reg_addr;
send_data[1] = 16;
send_data[2] = 1;
IOEOI (7L, 0); IOEOL (7L, " ",0);
IOOUTPUTS (70900L, "DIAG:POKE ",10);
IOEOI (7L, 1); IOEOL (7L, " ",state,0);
IOOUTPUTA (70900L, send_data, 3);
send_data[2] = 0;
IOEOI (7L, 0); IOEOL (7L, " ",0);
IOOUTPUTS (70900L, "DIAG:POKE ",10);
IOEOI (7L, 1); IOEOL (7L, " ",state,0);
IOOUTPUTA (70900L, send_data, 3);
return 0;
}