Jump to content
  • 0

2 issues with TC-32 on Linux

Mark Rivers


I have run into 2 problems with the TC-32 on Linux.  These problems do not occur on Windows with the equivalent function calls.

The first problem is that the TC-32 contains 2 DIO ports.  Port 0 is an 8-bit input port, and Port 1 is a 32-bit output port.  On Windows this function queries the number of DIO ports:

cbGetConfig(BOARDINFO, boardNum_, 0, BIDINUMDEVS,     &numIOPorts_);

It correctly returns 2.

On Linux this function queries the number of DIO ports:

     ulDIOGetInfo(daqDeviceHandle_, DIO_INFO_NUM_PORTS, 0, &infoValue);

It returns infoValue=4, not 2.

My driver queries and prints the following information for each port.





These are the definitions of the INFO_PORT_TYPE in uldaq.h:

        /** FirstPortA */

        FIRSTPORTA = 10,

        /** FirstPortB */

        FIRSTPORTB = 11,

        /** SecondPortA */

        SECONDPORTA = 14,

        /** SecondPortB */

        SECONDPORTB = 15,

My driver has a poller thread that reads from all of the DIO ports reported when querying the number, providing that are not write-only ports.  That is done with this call on Linux:

        status = ulDIn(daqDeviceHandle_, (DigitalPortType)digitalIOPort_[i], &data);

The problem is that this returns error=50 for ports 2 and 3.

2023/04/26 16:54:38.151 MultiFunction::pollerThread Error: Calling DIn, err=50 Invalid port type specified

2023/04/26 16:54:38.152 portNumber=2

I suspect that the problem is that ports 2 and 3 are intended for use on the TC-32 expansion module.  However, I need a way to determine if these ports really exist, i.e. if an expansion module is installed.

The second problem is that on Linux,   I get an error when setting open thermocouple detect.  This error does not happen on Windows.

This is my function:

int MultiFunction::setOpenThermocoupleDetect(int addr, int value)


  int status=0;

  static const char *functionName = "setOpenThermocoupleDetect";

  if ((boardType_ != USB_TEMP) && (boardType_ != USB_TEMP_AI)) {

    #ifdef _WIN32

      status = cbSetConfig(BOARDINFO, boardNum_, addr, BIDETECTOPENTC, value);


      OtdMode mode = value ? OTD_ENABLED : OTD_DISABLED;

      status = ulAISetConfig(daqDeviceHandle_, AI_CFG_CHAN_OTD_MODE, addr, mode);


    reportError(status, functionName, "Setting thermocouple open detect mode");


  return status;


On Linux = ulAISetConfig is returning error 24.  This is the report from my driver:

2023/04/26 15:48:47.764 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported

The equivalent function call on Windows does not return an error.




Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I will investigate why the digital port issue and report back later. 

As for the second issue, there are two enumerations for enabling open TC detection. Use AI_CFG_OTD_MODE with the TC-32.  AI_CFG_CHAN_OTD_MODE is used with our USB-2416 and USB-2408 series devices.

Link to comment
Share on other sites

  • 0

Regarding the number of ports issue, I tested both drivers, and the Linux driver returned four ports with or without the expansion module attached. On the other hand, the Windows driver returns four ports only when the expansion module is attached. I will report this issue to engineering.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...