Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -50251 using DAQmx. No idea what's the problem.

I'm getting "The specified software component is not available. The component was not loaded." Error number: -50251 when using DaqMX 7.3. I do a DAQmxResetDevice, a DAQmxCreateTask, and then a DAQmxCreateDOChan on a 6023E. What am I doing wrong?
0 Kudos
Message 1 of 7
(5,337 Views)
I just created a VI in which I do exactely what you are describing and I am not getting an error. However, there are a couple of things that you can try:

1. make sure that you are not using NI-DAQ traditional and NI-DAQmx on the same device at the same time. It is a good practice to always reset the device for traditional in MAX before running your VI.

2. a resource on the device cannot be used by two tasks at the same time. That can cause conflicts. For example, you cannot have two inpedent tasks using the counters.

I hope this answers your question. If not, please post more details about your application.

Thanks

Serges
0 Kudos
Message 2 of 7
(5,337 Views)
Hi, Serges:

I got the the same trouble too. Followings are my codes:

...
long l_iRet ;
TaskHandle l_TaskHandle=0 ;
char l_sMsgTemp[255]="" ;


DAQmxCreateTask("", &l_TaskHandle ) ;
if( (l_iRet = DAQmxCreateAIVoltageChan( l_TaskHandle,
"Dev1/ai0",
"",
DAQmx_Val_Diff,
-10.0,
10.0,
DAQmx_Val_Volts,
NULL
) ) !=0 )
{
// l_iRet = -50251
DAQmxGetErrorString( l_iRet, l_sMsgTemp, 255) ;
ShowMessage(l_sMsgTemp) ;

}
else
ShowMessage("Completed!!") ;
DAQmxClearTask(l_TaskHandle) ;

...


Besides that, I had tried "NIDAQmxResetDevice" and "NIDAQmxSelfCal" successfully.

The DAQ hardware I used: PCI 6032E
Driver version: 7.2
Programming tool: Borland C++ Builder

Could you please help me ...
Thanks

Michael
0 Kudos
Message 3 of 7
(5,336 Views)
I too am having a similar problem with my code. I'm writing a DLL in Visual C++ 6.0 for use with my Borland C++ Builder 5. I've pretty much copied the (working) NI example code line for line when it comes to calling the NIDAQmx functions. While as I said the example works fine (compilied in Visual C++ 6.0) my Borland C++ written program and MS VC++ written DLL produce the error Status Code -50521.

Heres my code:

#include
//#include
//#include
#include "NIDAQmx.h"
#include "WriteDigChan_Fn.h"
#ifndef WINAPI
#define WINAPI __stdcall
#endif

#ifndef DAQmxErrChk
#define DAQmxErrChk(functionCall) {if (DAQmxFailed(error=(functionCall))) { goto Error; } }
#endif

//...
//...

extern "C"
int __decls
pec(dllexport) WINAPI initDO0()
{
int32 error=0;
TaskHandle taskHandle=0;
uInt8 data[8]={1,0,0,0,0,0,0,0};
char errBuff[2048]={'\0'};

DAQmxErrChk (Configure_WriteDigChan("Dev1/port0/line0:7",&taskHandle));
DAQmxErrChk (Start_WriteDigChan(taskHandle));
DAQmxErrChk (Write_WriteDigChan(taskHandle,data));

Error:
if( DAQmxFailed(error) )
DAQmxGetExtendedErrorInfo(errBuff,2048);
if( taskHandle!=0 )
Stop_WriteDigChan(taskHandle);
if( DAQmxFailed(error) )
MessageBox (NULL, errBuff, "DAQmx Error", NULL );
MessageBox (NULL, "Click OK to continue...", "DAQmx DLL", NULL );
return 0;

}

//...
//...


I'm using a PCI 6221 M series
NIDAQ 7.3


Any ideas would be appreciated..

Thanks
Bergen
0 Kudos
Message 4 of 7
(5,336 Views)
I found the answer to the problem at another post:

click here to see post

basically it has to do with Borland Builder throwing floating point exceptions and can be overcome by adding the following to your code:

#include

//...

myfunction(){
_control87(MCW_EM, MCW_EM);

//...

}

Bergen
0 Kudos
Message 5 of 7
(5,338 Views)

Hi all,

I got a PCI 6024e card and as I want to test it with a Thermocouple two errors were displayed, which are error -50251 and error -200477. And as I run the self test, it wasn't running and instead of that, I also read some unknown ASCII character from panel test. Could anyone help me fix my problem ? Thanks in advance.

Jayadi Lukito

0 Kudos
Message 6 of 7
(4,755 Views)
I installed the NiDAQ 8.3 and the problems were solved. Just want to share to everyone.
Message 7 of 7
(4,735 Views)