Measurement Computing   Easy to Use | Easy to Integrate | Easy to Support catalog banner

IOtech DaqX dll programming - 3000 series channel numbers

Expand / Collapse
 

IOtech DaqX dll programming - 3000 series channel numbers


For the most part, IOtech device programming is accomplished using the DaqCOM2 COM component. This component is a wrapper around the DaqX.dll and shields the programmer from the intricacies of the DaqX.dll. Some customer prefer to use C++ and instead of DaqCOM2 they use the DaqX.dll. When doing the question about channel numbers for the 3000 series products off arise. For instance, if you have a DaqBoard3031USB board, it has 64 channels single ended or 32 channels differential. The lower channels begin at zero and precede upward. For example, the first eight differential channel numbers are 0 through 7. Common sense would say that channel 8 would be 8 but that's not the case, instead channel 8 is 256. Likewise for single ended, the first 16 channels are 0 through 15, channel 16 starts at 256. To make this issue easier, the following function can be used to calculate the correct number:

int ConvertChanNum(INT mode, INT ChanNum)
{
      int chan=0;

      if(mode == SINGLE_ENDED) // SE mode
      {
            if(ChanNum < 16)
                  chan = ChanNum;
            else
                  chan = 256 - 16 + ChanNum;
      }
      else  // DE mode
      {
            if(ChanNum < 8)
                  chan = ChanNum;
            else
                  chan = 256 + int((ChanNum - 8)/8) * 16 + (ChanNum - 8) % 8;
      }
      
      return chan;
}



Rate this Article:
Tags:

Add Your Comments


For comments email TechSupport@mccdaq.com.

Details
Article ID: 50624

Last Modified:12/1/2016 8:30:25 AM

Article has been viewed 2,362 times.

Options