CALCulate:COMPare:STATe

34980A

CALCulate:COMPare:STATe

Syntax

CALCulate:COMPare:STATe <mode>, (@<ch_list>)

CALCulate:COMPare:STATe? (@<ch_list>)

Description

This command disables or enables the pattern comparison mode on the specified digital input channels. You can use the pattern comparison feature to generate an alarm or hardware interrupt condition (34950A only) when a specific digital pattern is detected. Pattern comparisons always start on the lowest-numbered channel in the bank and extend to all channels involved in the channel width (see CONFigure:DIGital:WIDTh command).  

Used With:

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

  • 34952A Multifunction Module (digital input channels only)

Parameters

Name

Type

Range of Values

Default Value

<mode>

Boolean

{OFF|0|ON|1}

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

This is a required parameter

Remarks

  • Pattern comparisons are performed on a per-bank basis (i.e., the entire bank is reserved for the pattern comparison). For example, if you are using channels 101 and 102 for pattern comparison (assumes 34950A) and then perform a static read of channel 103, the module will perform a pattern comparison on channels 101 and 102.

  • For the 34950A only, pattern comparisons can be performed with or without handshaking (see CONFigure:DIGital:HANDshake command). If you are using handshaking, the specified digital pattern is evaluated with each handshaking operation. If you are not using handshaking, the specified digital pattern is evaluated continuously as soon as you enable the pattern comparison mode.

  • For the 34950A only, hardware interrupts are reported on the INTR line (one line is available per bank). See the [SENSe:]DIGital:INTerrupt[:ENABle] command to enable interrupts to be reported.

  • You can use a pattern comparison to start or stop a buffered (memory) transfer. See the [SENSe:]DIGital:MEMory:COMPare:ACTion command for additional information.

  • A Factory Reset (*RST command) turns off the pattern comparison mode. An Instrument Preset (SYSTem:PRESet command) or Card Reset (SYSTem:CPON command) does not turn off the pattern comparison mode.

Return Format

The query command returns "0" (OFF) or "1" (ON) for the specified bank. Multiple responses are separated by commas.

Examples

The following program segment sets the digital pattern for the 34950A in slot 3 and then enables the pattern comparison mode. When the data read from the bank is equal to the comparison pattern, a hardware interrupt will be generated. In this example, handshaking is not used.

CALC:COMP:DATA:BYTE 140,(@3101)  !Set comparison pattern (1000 1100)
DIG:INT:MODE COMPARE,(@3101)  !Interrupt on pattern match
DIG:INT:ENAB ON,(@3101)  !Enables interrupts on channel 101
CALC:COMP:STAT ON,(@3101)
 !Enable pattern comparison mode

The following query returns the state of the pattern comparison mode for Channel 101 on the module in slot 3.  

CALC:COMP:STAT? (@3101)

Typical Response:  1

See Also

CALCulate:COMPare:DATA

CALCulate:COMPare:MASK

CALCulate:COMPare:TYPE

CONFigure:DIGital:HANDshake

OUTPut:ALARm<n>:SOURce

[SENSe:]DIGital:INTerrupt[:ENABle]

[SENSe:]DIGital:MEMory:COMPare:ACTion

STATus:MODule:SLOT[n]:ENABle