CALCulate:COMPare:TYPE

34980A

CALCulate:COMPare:TYPE

Syntax

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

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

Description

This command configures the specified digital input channels to generate an alarm or hardware interrupt condition (34950A only) when a specific bit pattern or bit pattern change is detected. This command is used in conjunction with the CALCulate:COMPare:DATA command which sets the data bit pattern and the CALCulate:COMPare:MASK command which sets the mask bit pattern. 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>

Discrete

{EQUal|NEQual}

NEQual ("not equal")

<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

  • Select EQUal to generate an alarm or interrupt when the data read from the specified channel is equal to CALCulate:COMPare:DATA, after being masked by CALCulate:COMPare:MASK.

  • Select NEQual ("not equal") to generate an alarm or interrupt when the data read from the bank is not equal to CALCulate:COMPare:DATA after being masked by CALCulate:COMPare:MASK.

  • The channel width takes precedence over the specified digital pattern. If the specified pattern is greater than the channel width, additional bits will be ignored. For example, if you set the channel width to "BYTE" and then specify a pattern of "256" (1 0000 0000), the pattern will be truncated to "0000 0000" (the leading "1" will be ignored).

  • 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) clears the pattern compare setting and turns off the pattern comparison mode. An Instrument Preset (SYSTem:PRESet command) or Card Reset (SYSTem:CPON command) does not clear the pattern compare setting and does not turn off the pattern comparison mode.

Return Format

The query command returns "EQU" or "NEQ" for the specified bank. Multiple responses are separated by commas.

Examples

The following program segment sets the digital pattern for the 34952A in slot 5 and then enables the pattern comparison mode. When the data read from the bank is equal to the comparison pattern, an alarm will be generated on Alarm 2.

CALC:COMP:DATA:WORD #HF6,(@5001)  !Set comparison pattern (1111 0110)
CALC:COMP:TYPE EQUAL,(@5001)
 !Generate alarm on pattern match
OUTP:ALARM2:SOUR (@5001)  !Enable alarms
CALC:COMP:STAT ON,(@5001)  !Enable pattern comparison mode

The following query returns the pattern compare settings on Channel 1 on the module in slot 5.

CALC:COMP:TYPE? (@5001)

Typical Response:  EQU

See Also

CALCulate:COMPare:DATA

CALCulate:COMPare:MASK

CALCulate:COMPare:STATe

CONFigure:DIGital:HANDshake

OUTPut:ALARm<n>:SOURce

[SENSe:]DIGital:INTerrupt[:ENABle]

[SENSe:]DIGital:MEMory:COMPare:ACTion

STATus:MODule:SLOT[n]:ENABle