Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-6 ni.comThe language header file defines each of the ibsta status bits. You cantest for an ibsta status bit being set using the bitwise and operator(& in C/C++). For example, the ibsta ERR bit is bit 15 of ibsta.To check for an NI-488.2 error, use the following statement after eachNI-488.2 call:if (ibsta & ERR)printf("NI-488.2 error encountered");Error Variable (iberr)If the ERR bit is set in ibsta, an NI-488.2 error has occurred. When anerror occurs, the error type is specified by iberr. To check for an NI-488.2error, use the following statement after each NI-488.2 call:if (ibsta & ERR)printf("NI-488.2 error %d encountered", iberr);Note The value in iberr is meaningful as an error only when the ERR bit is set in ibsta,indicating that an error has occurred.For more information about error codes and solutions, refer to Chapter 5,Debugging Your Application, or Appendix C, Error Codes and Solutions.Count Variables (ibcnt and ibcntl)The count variables are updated after each read, write, or commandfunction. In addition, ibcnt and ibcntl are updated after specific488.2-style functions in certain error cases. Refer to the NI-488.2 Helpfunction reference for an explanation of how each function uses the countvariables.ibcnt is defined to be the type int while ibcntl is the size of type longint. For all cases, if the sizes of ibcnt and ibcntl are the same, ibcntand ibcntl are equal. If the size of ibcnt is smaller than the sizeof ibcntl, ibcnt is equal to the low-order bits of ibcntl. Forcross-platform compatibility, all applications should use ibcntl.DTAS 1 2 brd Device Trigger StateDCAS 0 1 brd Device Clear StateTable 4-1. Status Word Layout (Continued)MnemonicBitPosHexValue Type Description