
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 + … Flagn; // 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 + … Flagn ‘ Visual Basic format
channel Flags& = DafAnalog& + DafBipolar& + DafUnsigned& ‘ Visual Basic
example
Programmer’s Manual 938395 Daq API Command Reference 4.1-7
Kommentare zu diesen Handbüchern