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

34980A

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

Syntax

[SENSe:]DIGital:DATA[:<width>]? [<format>,] (@<ch_list>)

Description

This command reads 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

<width>

Discrete

{BYTE|1|WORD|2|LWORd|4}

BYTE (or "1" byte):  8 bits
WORD (or "2" bytes):  16 bits
LWORd (or "4" bytes):  32 bits

34959A: Only valid configurations are BYTE/WORD.

If no <width> is specified, the currently configured width is used (see CONFigure:DIGital:WIDTh command).

<format>

Discrete

{DECimal|BINary|HEXadecimal|OCTal}

DECimal

<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

  • Depending on the width specified, the channel numbering is modified as shown below. For example, if you specify the width as a 16-bit WORD on the 34950A, channels 101 and 102 are combined and addressed collectively as channel 101.  

    34950A

    Bank 2

    Bank 1

    BYTE (8 Bits):

    Ch 204

    Ch 203

    Ch 202

    Ch 201

    Ch 104

    Ch 103

    Ch 102

    Ch 101

    WORD (16 Bits):

    Ch 203

    Ch 201

    Ch 103

    Ch 101

    LWORd (32 Bits):

    Ch 201

    Ch 101

     

     

     

    34952A

    Bank 1

     

    BYTE (8 Bits):

    Ch 4

    Ch 3

    Ch 2

    Ch1

     

    WORD (16 Bits):

    Ch 3

    Ch 1

     

    LWORd (32 Bits):

    Ch 1

     

  • 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). Changing the channel width will disable buffered operations and clear memory on the specified digital channels.

  • Use the [SENSe:]DIGital:DATA:BIT? command to query the state of individual bits on the specified digital input channels.

  • The selected width is stored in volatile memory and will be set to BYTE when power is turned off or after a Factory Reset (*RST command).

Return Format

This command returns a value representing the bit pattern on each digital channel specified. Multiple responses are separated by commas. The output from this command is not affected by the settings of the FORMat:READing commands.

Examples

The following program segment configures channels 101 and 103 on the 34950A in slot 3 as outputs and then reads the output values (the channels are not reconfigured as inputs). Then, the channels are reconfigured as inputs and the values are again read (this time, the actual inputs from the channels are returned).

SOUR:DIG:DATA:WORD 12364,(@3101,3103)  !Channels are outputs
DIG:DATA:WORD? (@3101,3103)
 !Returns "12364,12364", channels remain as outputs
CONF:DIG:DIR INP,(@3101,3103)  !Channels are inputs
DIG:DATA:WORD? (@3101,3103)
 !Returns actual input from channels

Typical Response:  65487,64972

The following program segment queries the byte values from digital input channels 201 and 203 on the 34950A in slot 3 and returns the corresponding hexadecimal values to the instrument's output buffer.

CONF:DIG:DIR INP,(@3201,3203)  !Channels are inputs
DIG:DATA:BYTE? HEX,(@3201,3203)

Typical Response:  00F0,0060

The following program segment queries the word values from digital input channels 1 and 3 on the 34952A in slot 5 and returns the corresponding decimal values to the instrument's output buffer.

CONF:DIG:DIR INP,(@5001,5003)  !Channels are inputs
DIG:DATA:WORD? (@5001,5003)

Typical Response:  61440,65280

See Also

CONFigure:DIGital

CONFigure:DIGital:DIRection

CONFigure:DIGital:WIDTh

[SENSe:]DIGital:DATA:BIT?

[SENSe:]:DIGital:MEMory:ENABle