pipx40_setMaskPattern

 

VB

Function

pipx40_setMaskPattern (ByVal vi As Long, ByVal subUnit As Long, ByRef pattern As Long) As Long

C++

ViStatus

pipx40_setMaskPattern (ViSession vi, ViUInt32 subUnit, ViPUInt32 pattern);

 

Parameter

I/O

Description

vi

in

Instrument handle

subUnit

in

Numeric variable indicating in which sub-unit actions will take place

pattern

in

Pointer/reference to the one-dimensional array (vector) containing the mask pattern to be set

Return Value

0 = Successful operation. Negative values are error codes and positive values are warnings. To get a description of the error, pass the error code to pipx40_error_message.

Description

Sets a sub-unit's switch mask to the supplied bit-pattern.

Remarks

The number of least significant bits corresponding to the size of the sub-unit are written into the mask. A '1' bit in the mask disables the corresponding switch for the pipx40_setChannelState, pipx40_setCrosspointState and pipx40_setChannelPattern functions.

An error is reported by those functions if an attempt is made to activate a masked channel.

 

This facility is particularly useful for matrix sub-units, where it can be used to guard against programming errors that could otherwise result in damage to matrix switches or external circuits.

 

For a Matrix sub-unit, the mask data is folded into the vector on its row-axis. See Data formats.

 

Certain single-channel multiplexer (MUX type) sub-units have a default channel (that is, a channel that is connected when the sub-unit is in a 'cleared' state). This channel cannot be masked, and an error is given if an attempt is made to mask it.

Warning

The data array pointed to must contain sufficient bits to represent the mask pattern for the specified sub-unit, or undefined data will be written to the more significant bits.

Visual Basic Note

To use this function in Visual Basic, it must be passed a pointer to the first element of the data array. For example (assuming a zero-based array):

pipx40_setMaskPattern(vi, subUnit, pattern(0))

Example Code

See the description of pipx40_setChannelPattern for example code using a pattern-based function.