beautypg.com

Measurement Computing Data Acquisition Systems rev.10.4 User Manual

Page 51

background image

Reading/Interpreting Mask and Flag Values

Reading and interpretting mask and flag parameters returned by the DaqX driver can be a bit trickier. What is
needed here is to logically “and” the flags that are of interest with the flags returned from the DaqX API.
Those flag bits which are set (bit value =1 )


C/C++

Flags = Flag1 + Flag2 + Flag3 + … Flag

n

; // C language format

If ((Flags & returnedFlags) == Flags) ;

//

C

language

format

{

// Code for flagsSet condition

} else {

// Code for flags NOT set condition

}

// C Language Example

acqFlags = DaafTriggered + DaafAcqActive;

// C language

example

if ((acqFlags & acqReturned) == acqFlags) {

{

printf(“Acquisition has been triggered and post-trigger data is being acquired\n”);

} else {

if (acqReturned & DaafAcqActive) {

printf(“ Acquistion is active but has not been triggered\n”);

} else {

printf(“Acquisition is not active\n”);

}

}


Visual Basic

Value

= Flag1 + Flag2 + Flag3 + … Flag

n

‘ Visual Basic format

channel Flags& = DafAnalog& + DafBipolar& + DafUnsigned&

‘ Visual Basic

example

Programmer’s Manual

938395

Daq API Command Reference 4.1-7