CALCulate:COMPare:DATA

From Keysight 34970A/34972A

CALCulate:COMPare:DATA

Syntax

CALCulate:COMPare:DATA <data>[,(@<ch_list>)]

CALCulate:COMPare:DATA? [(@<ch_list>)]

Description

This command sets the digital data for pattern comparisons on the specified digital input channels. You can use the pattern comparison feature to generate an alarm when a specific digital pattern is detected.

Used With:

  • 34907A   Multifunction Module (digital input channels only)

Parameters

Name Type Range of Values Default Value
<data> Numeric An 8-bit digital pattern for comparison, specified as an integer from 0 to 255. This is a required parameter.
<ch_list> Channel List

One or more channels, as shown:

(@301) - channel 01 on the module in slot 300.

(@301:302) - channels 01 and 02 on the module in slot 300.

(@101,201:202,302) - channel 01 on the module in slot 100, channels 01 and 02 on the module in slot 200, and channel 02 on the module in slot 300.

If you omit the optional <ch_list> parameter, this command applies to the currently defined scan list.

Remarks

  • Note that the specified channels do not have to be part of the scan list to generate an alarm. Alarms are evaluated continuously as soon as you enable them. Alarms are evaluated constantly on the multifunction module, but alarm data is stored in reading memory only during a scan.
  • 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).
  • After specifying the desired digital pattern, use the CALCulate:COMPare:STATe command to enable pattern comparisons on the specified channels. If you want to monitor the state of specific bits, use the CALCulate:COMPare:DATA command in conjunction with the CALCulate:COMPare:MASK command to specify a mask pattern.
  • Use the CALCulate:COMPare:TYPE command to specify whether an alarm or hardware interrupt condition is generated when a specific bit pattern or bit pattern change is detected.
  • A Factory Reset (*RST command) clears the digital pattern and turns off the pattern comparison mode. An Instrument Preset (SYSTem:PRESet command) or Card Reset (SYSTem:CPON command) does not clear the data and does not turn off the pattern comparison mode.

Return Format

The query returns the comparison pattern as a decimal value (binary and hexadecimal values are converted to their decimal equivalents). Multiple responses are separated by commas.

Examples

The following query returns the comparison pattern selected for channel 01 of the 34907A multifunction module in slot 300.

CALC:COMP:DATA? (@301) !Always returns decimal equivalent

Typical Response: 140

 

The following program segment sets the digital pattern for the 34907A multifunction module in slot 100 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 #HF6,(@101) !Set comparison pattern (1111 0110)
CALC:COMP:TYPE EQUAL,(@101) !Generate alarm on pattern match
OUTP:ALARM2:SOUR (@101) !Enable alarms
CALC:COMP:STAT ON,(@101) !Enable pattern comparison mode

 

The following query returns the comparison pattern selected for the 34907A multifunction module in slot 100.

CALC:COMP:DATA? (@101) !Always returns decimal equivalent

Typical Response: +246

See Also

CALCulate Subsystem Introduction

CALCulate:COMPare:MASK

CALCulate:COMPare:STATe

CALCulate:COMPare:TYPE

OUTPut:ALARm{1|2|3|4}:SOURce