Specifications

Chapter 2 Command System RIGOL
M300 Programming Guide 2-9
CALCulate:COMPare:MASK
Syntax CALCulate:COMPare:MASK <mask>[,(@<ch_list>)]
CALCulate:COMPare:MASK? [(@<ch_list>)]
Description Pattern comparisons can compare just the specified bits and ignore the other bits. This
command sets the pattern of the active bits and the bits to be ignored (named the mask
value) for the pattern comparison on the specified DIO channel.
Parameters
Name
Type
Range
Default
<mask> Integer
8 bit: 0 to 255 (0000 0000 to 1111 1111)
16 bit: 0 to 65535 (0000 0000 0000 0000 to
1111 1111 1111 1111)
32 bit: 0 to 42,9496,7295 (0000 0000 0000
0000 0000 0000 0000 0000 to 1111 1111
1111 1111 1111 1111 1111 1111)
Set the active bits to 1 and the bits to be
ignored to 0.
None
<ch_list>
Channel
List
One or more channels (only the DIO
channels), the rules are as follows:
(@101): channel 01 on the module in Slot1;
(@101:103): channel 01 through 03 on the
module in Slot1;
(@101:103,301): channel 01 through 03 on
the module in Slot1 and channel 01 on the
module in Slot3;
If the parameter
is omitted, this
command will be
applied to the
whole scan list.
Explanation This command is only valid for the DIO channels on the multifunction module. The
specified DIO channels do not have to be part of the scan list.
The range of <mask> depends on the bit setting of the channel. When the setting
value of <mask> exceeds the range, the instrument will convert the setting value to a
binary number and then take the bit setting of the channel as the parameter value
automatically. For example, when the channel is set to 8 bit and <mask> is set to 256
(the binary number is 1 0000 0000), the actual setting value is 0 (0000 0000).
This command is used in conjunction with the
CALCulate:COMPare:DATA command to
set the alarm value (refer to the Example”).
A Factory Reset (the
*RST command) clears the mask and turns off the pattern
comparison mode. An Instrument Preset (the
SYSTem:PRESet command) and Card
Reset (the
SYSTem:CPON command) does not clear the mask and does not
turn off the
pattern comparison mode.
Return
Format
The query returns a decimal value. Multiple return values are separated by commas.
Example
CALC:COMP:MASK 129,(@301) /*Set the mask value to 1000 0001. The active bits are
bit7 and bit0*/
CALC:COMP:DATA 154,(@301) /*Set the alarm value to 1001 1010*/
CALC:COMP:TYPE EQU,(@301) /*The instrument generates an alarm
when the input
pattern matches the alarm value*/
CALC:COMP:STAT ON,(@301) /*Enable the pattern comparison mode. The instrument
generates an alarm when the bit7 and bit0 of the input
pattern of the channel are 1 and 0 respectively*/
Related
commands
CALCulate:COMPare:DATA
CALCulate:COMPare:STATe
CALCulate:COMPare:TYPE