[SENSe:]DIGital:DATA:BIT?

34980A

[SENSe:]DIGital:DATA:BIT?

Syntax

[SENSe:]DIGital:DATA:BIT? <bit>, (@<ch_list>)

Description

This command queries the state of individual bits on the specified digital input channels and sends the results directly to the instrument's output buffer. Note that if the specified channels are presently configured as outputs, this command will return the last value output from the channels (the channels are not reconfigured as inputs).

Used With:

  • 34950A Digital I/O Module (digital input channels only)

  • 34952A Multifunction Module (digital input channels only)

  • 34959A Breadboard Module (digital input channels only)

Parameters

Name

Type

Range of Values

Default Value

<bit>

 

Numeric

Bit number on the specified channel. The acceptable range is based on the channel width set by the CONFigure:DIGital:WIDTh command.

BYTE (8 Bits):  0 (LSB) to 7 (MSB)
WORD (16 Bits):  0 (LSB) to 15 (MSB)
LWORd (32 Bits):  0 (LSB) to 31 (MSB)

34959A: Only valid configurations are BYTE/WORD.

This is a required parameter

<ch_list>

Numeric

One or more digital input channels in the form (@sccc).

34950A: s101 through s104, s201 through s204
34952A: s001 through s004
34959A: s001 or s002

This is a required parameter

Remarks

  • If the specified channels are presently configured as outputs (see CONFigure:DIGital:DIRection? command), this command will return the last value output from the channels (the channels are not reconfigured as inputs). To reconfigure the channels as an input, use the CONFigure:DIGital:DIRection command.

  • On the 34950A, it is not valid to read a channel while buffered (memory) I/O is enabled (see [SENSe:]:DIGital:MEMory:ENABle command).

Return Format

This command returns "0" or "1" indicating the value of the bit on each digital input channel specified. Multiple responses are separated by commas.

Examples

The following program segment configures channel 101 on the 34950A in slot 3 as an output and then reads the output value (the channel is not reconfigured as an input). Then, the channel is reconfigured as an input and the value is again read (this time, the actual input from the channel is returned).

CONF:DIG:WIDTH BYTE,(@3101)  !Set channel width
SOUR:DIG:DATA:BYTE 64,(@3001)  !Channel is an output
DIG:DATA:BIT? 0,(@3001)
 !Returns "0" for bit 0, channel remains as output
CONF:DIG:DIR INP,(@3001)  !Channel is an input
DIG:DATA:BIT? 0,(@3001)
 !Returns actual input from bit 0

The following program segment configures channel 3 on the 34952A in slot 5 for a width of 16 bits and then reads the value of bit 12. The value is transferred to the instrument's output buffer.

CONF:DIG:WIDTH WORD,(@5003)  !Set channel width
DIG:DATA:BIT? 12,(@5003)
 !Returns value of bit 12

Typical Response:  0

See Also

CONFigure:DIGital

CONFigure:DIGital:DIRection

CONFigure:DIGital:WIDTh

[SENSe:]DIGital:DATA[:<width>]?

[SENSe:]:DIGital:MEMory:ENABle