Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -200088 on NI PCIe-6259, TaskHandle Issues

Solved!
Go to solution

Hi all, I'm working on getting a force/torque sensor to work in a custom Qt application, but I keep running into the same error with the function

 

DAQmxCreateAIVoltageChan(taskHandle, daqPhysicalChannel.c_str(), 0, DAQmx_Val_Cfg_Default, -maxVoltage, maxVoltage, DAQmx_Val_Volts, "")

 

which always return an error type of -200088: DAQmxErrorInvalidTask.

 

I tried returning the values for TaskHandle that were being generated by DAQmxCreateTask, and everytime the program ran there would be a different value generated for TaskHandle, from -793410048 to 1387431424, with no rhyme or reason inbetween from my perspective.

 

I tried hard-coding values of TaskHandle for the library, still the same error.

 

Has anyone experienced anything like this before?

 

I know that the F/T sensor works normally, as I can run it using the provided software and read values from it that way. I'm building the library in Visual Studio 2012 and running the program in Windows 8 additionally, and very similar code is working on another computer in the lab on VS 2010 in Windows 7.

0 Kudos
Message 1 of 6
(6,179 Views)

Hi ConfusedInCanada,

 

It is possible for you if you can provide us screenshots of the code you are using? This will help us to find faster a workaround for your issue

0 Kudos
Message 2 of 6
(6,154 Views)

Absolutely!

 

 

int cstarAtiDaqAPI::Initialize(double maxVoltage, float initialTransformations[])
{
if(isInitialized()) {
return 0;
}

short sts; // return value from functions

int32 returnCode = 0;

this->maxVoltage = maxVoltage;

// convert the calibration file path to (char *) as required by the ATIDAQ API
char *path = (char *)std::calloc(calfilepath.size() + 1, sizeof(char));
strncpy(path, calfilepath.c_str(), calfilepath.size() + 1);

// create Calibration struct
DEBUG_MESSAGE("Loading calibration file from " + calfilepath);
cal=createCalibration(path,1);
if (cal==NULL) {
// the file calibration could not be loaded
LOG_ERROR("Error reading calibration file. Path: " + calfilepath);
return -1;
}

// /*********************************************
// * DAQmx Configure Code
// *********************************************/
DEBUG_MESSAGE("Creating Task Handle");
DAQmxLogErrorMessage(returnCode = DAQmxCreateTask("",&taskHandle));
DEBUG_MESSAGE_IF(returnCode == 0, "Created Task Handle with success");
if(returnCode < 0)
return returnCode;

// TODO: implement device changing
//DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai16:21",0,DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,"");
//using sensor Red Knee connector 0

DEBUG_MESSAGE("Creating voltage channels");
DAQmxLogErrorMessage(returnCode = DAQmxCreateAIVoltageChan(taskHandle, daqPhysicalChannel.c_str(), 0, DAQmx_Val_Cfg_Default, -maxVoltage, maxVoltage, DAQmx_Val_Volts, ""));
DEBUG_MESSAGE_IF(returnCode == 0, "Created voltage channels with success");
if(returnCode < 0)
return returnCode;

 

The final portion for "Creating voltage channels" is where the the -200088 return code is generated. 

 

For the actual initialization:

 

// Path for calibration file
    std::string calFilePath("C:/Program Files (x86)/ATI Industrial Automation/ATIDAQFT.NET/CalibrationFiles/FT6573.cal");
    std::string physicalChannel("Dev1/ai0:5");

    shoulderSensor = new cstarAtiDaqAPI(calFilePath, physicalChannel, NULL);


shoulderSensor->Initialize();


My first thought was that it was an issue with the physical channel strings, but the sensor is working fine and the software says it's running as "dev1"; changing the value causes the sensor to stop reading. 

 

Has anyone seen this type of issue before?

 

Sorry if I'm not providing the right details, I'll provide more code/information if there is anything else someone would like to see. 

0 Kudos
Message 3 of 6
(6,139 Views)

I have been looking in the syntaxis you used in your function DAQmxCreateAIVoltageChan and it should be similar as the one described below:

 

DAQmxCreateAIVoltageChan (taskHandle, "Dev1/ai0", "Voltage", DAQmx_Val_Cfg_Default, -10.0, 10.0, DAQmx_Val_Volts, NULL);

 

I do not know what exactly this function is doing in your code: daqPhysicaChannel.c_str() but I assume that it assign the correct parameters.

 

Try to verify also if you are closing correctly the task this could be one of the reasons of getting error -200088 

Message 4 of 6
(6,124 Views)

Hi jbore,

 

It is indeed the same functionality as the code that you posted, but I was wondering if you could elaborate on what you meant by properly closing the taskhandle?

 

I'm not quite sure what Taskhandle does or why it generates the values that it does.

 

I've included the code for my initialize function here, I'll update if I manage to solver the problem. 

 

Thanks!

0 Kudos
Message 5 of 6
(6,068 Views)
Solution
Accepted by ConfusedInCanada

To anyone who is interested,

 

I managed to solve the problem last week regarding the F/T sensor, it was an issue regarding the build version of the software; the program will run in Windows 32 bit but not Windows 64 bit.

 

This was on Windows 8, as an aside the 64bit version worked fine on Windows 7 on another machine. If you are running into this issue I recommend recompiling your libraries in 32 bit, and if that fails turning to another version of Windwos. Oddly enough the National Instruments software for reading from the F/T sensor worked just fine, so there were presumably a few issues on the code on my end.

 

Good luck!

0 Kudos
Message 6 of 6
(5,988 Views)