Agilent E1330B Digital I/O Module Register Information
127
Appendix B
Writing a
16-Bit Word
Similar to the last program example, this program outputs a 16-bit word to your
peripheral device. To write a 16-bit word, two consecutive ports are required (i.e.
ports 0 and 1, 1 and 2, 2 and 3, or 3 and 4). Both ports must be configured exactly
the same. Configure consecutive port registers by addressing the lower port's
register and sending a 16-bit word. Handshaking is accomplished using the lower
port's handshake lines.
BASIC Version
10 Base_addr = DVAL("1FE400",16)
20 !Logical Address 144.
30 WRITEIO -9826,BaDVAL("18",16);DVAL("3232",16)
40 !Sets Ports 0 & 1 Handshake Register to leading edge handshake
50 !and flag driven transfer.
60 WRITEIO -9826,BaDVAL("1C",16);DVAL("0000",16
70 !Sets Ports 0 & 1 Delay Register to 0.
80 WRITEIO -9826,BaDVAL("20",16);DVAL("0000",16)
90 !Sets Ports 0 & 1 Normalization Register (polarity) to positive-true
100 !(High = true).
110 WRITEIO -9826,BaDVAL("10",16);DVAL("0000",16)
120 !Sets Ports 0 & 1 Status Control bit 6 to enable output.
130 WRITEIO -9826,BaDVAL("0C",16);DVAL("0202",16)
140 !Sets Ports 0 & 1 Transfer Control Register bit 1 to Enable Handshake.
150 WRITEIO -9826,BaDVAL("14",16);512
160 !Sets Ports 0 & 1 Data Register to the value to output.
170 REPEAT
180 UNTIL BIT(READIO ( 9826,BaDVAL("0C",16)),1)
190 !If more data to send, repeat lines 150 - 180.
200 WRITEIO 9826,BaDVAL("0C",16);DVAL("0000",16)
210 !Clears Ports 0 & 1 Transfer Control Register bit 1 to Disable Handshake.
220 END
C Version
The C program is similar to that shown for writing an 8-bit byte except the data sent
to the registers must be 16 bits.
Содержание E1330B
Страница 2: ......
Страница 10: ...8 Notes ...
Страница 11: ...9 Notes ...
Страница 12: ...10 Notes ...
Страница 25: ...Configuring the Agilent E1330B Digital I O Module 23 Chapter 2 Figure 2 6 J1 and J2 Connector Pinouts ...
Страница 32: ...30 Configuring the Agilent E1330B Digital I O Chapter 2 Notes ...
Страница 42: ...40 Using the Agilent E1330B Digital I O Module Chapter 3 Notes ...
Страница 58: ...56 Understanding the Agilent E1330B Digital I O Module Chapter 4 Notes ...
Страница 104: ...102 Agilent E1330B Digital I O Module Command Reference Chapter 5 Notes ...
Страница 146: ...144 Error Messages Appendix C Notes ...