Measurement Computing Data Acquisition Systems rev.10.4 User Manual
Page 50

Mask and Flag Definitions
There are a number of parameter types which represent bit-masked values. These bit-masks are used to
represent complex settings or states which may not be easily represented by a single value. These parameter
data types can be identified by the postfix …Flag or …Mask in the data type name. Special care should be
execercised when using these types since one parameter value can represent a number of different states or
conditions. These parameter types have a set of pre-defined bit-mask enumerations which represent indvidual
states or conditions. These pre-defined enumerations can be found with the …Flag and …Mask type
definitions found in the DaqX header files (DaqX.c, DaqX.bas, DaqX.pas)
Setting/Constructing Mask and Flag Values
Mask and Flag parameter values can be constructed by “adding” the desired flags together: The following
illustrates how to do this in C/C++ and Visual Basic:
C/C++
Value = Flag1 + Flag2 + Flag3 + … Flag
n
;
// C language format
channelFlags = DafAnalog + DafBipolar + DafUnsigned;
// C language
example
Visual Basic
Value = Flag1 + Flag2 + Flag3 + … Flag
n
‘
Visual
Basic
format
channel Flags& = DafAnalog& + DafBipolar& + DafUnsigned& ‘ Visual Basic
example
An equivalent method is to logically “or” the flags together. See language documentation to use the “or”ing
method.
4.1-6 Daq API Command Reference
938395
Programmer’s
Manual