Keysight E1458A 96-Channel Digital I/O Module User Guide 43Input/Output of Data Bytes and Bits Using the Keysight E1458A Digital I/O ModuleIn this manual the physical data lines are indicated as Dn_1. The n should bereplaced with the port number for the input operation. For example, bit 3 of port6 affects the state of data line D6_3.Byte InputThe SCPI command requesting an 8-bit byte from a data port is:MEASure:DIGital:DATAn[:BYTE][:VALue]?This command instructs the Keysight E1458A Digital I/O Module to return adecimal value between 0 and 255, indicating the condition of the data lines onport n, following completion of the input handshake. The value returned dependsupon the programmed state of the port POLarity. In the default state (POSitivepolarity) if all data lines are at a TTL Low level, the returned value will be 0; if alllines are at a TTL High level, the returned value will be 255. For example, thefollowing BASIC program code will request and display the decimal value of thedata lines on port 2.120 OUTPUT @Dio;"MEAS:DIG:DATA2?"130 ENTER @Dio;Result140 DISP "Decimal value of port 2 data lines ";ResultPort numbers range from 0 to 11 for single-port operations. The section"Multiple-Port Operations" later in this chapter describes port numbering formultiple-port operations. For a single port, the returned decimal value will havethe following correspondence to the port data lines:OutputOutput operations can involve single bits, 8-bit bytes, or multiple bytes.Single-bit output operations always expect a value of 0 or 1. Byte ormultiple-byte output operations can accept numbers in decimal, hexadecimal,octal, or binary formats.Bit OutputThe SCPI command for setting the state of a single bit on a data port is:[SOURce:]DIGital:DATAn[:type]:BITm Dn_7 Dn_6 Dn_5 Dn_4 Dn_3 Dn_2 Dn_1 Dn_0Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0MSB LSB