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:
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)
Question
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.
IOPort=0 DIO_INFO_PORT_TYPE=10, DIO_INFO_PORT_IO_TYPE=1
IOPort=1 DIO_INFO_PORT_TYPE=11, DIO_INFO_PORT_IO_TYPE=5
IOPort=2 DIO_INFO_PORT_TYPE=14, DIO_INFO_PORT_IO_TYPE=1
IOPort=3 DIO_INFO_PORT_TYPE=15, DIO_INFO_PORT_IO_TYPE=5
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);
#else
OtdMode mode = value ? OTD_ENABLED : OTD_DISABLED;
status = ulAISetConfig(daqDeviceHandle_, AI_CFG_CHAN_OTD_MODE, addr, mode);
#endif
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.
Thanks,
Mark
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now