Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI435X_Normal_Scanning returns -10240 (noDriverError) error on NI4350

I have written some code that works on my lap top but not on another computer.
I believe I have installed the drivers the same on both systems.

Problem: NI435X_Init and subsequent calls to NI435X_Normal_Scanning return -10240 (NoDriverError) returned.

The test panel for this product works! So I know that the drivers are installed correctly.

Further info:
Operating System: XP
Compiler: VC6++
Product: NI4350

my code: ( I call InitController and then I call GetValue )
int CNI_435x_ADC::InitController()
{
int status = SENSOR_STATUS_OK;
ViStatus error = VI_SUCCESS;
ViString resourceName[16];
int nistatus=0;
static int warncnt=0;

if(m_DAQsession!=NULL)
return status;

_stprintf((ViString)resourceName,_T("DAQ::%d"),m_ControllerAddress); // m_ControllerAddress is 1 (from Measurement & Automation)

if ((nistatus=NI435X_init ((ViString)resourceName, 1, 1, &m_DAQsession)) < NI435X_SUCCESS)
{
ViChar tmpvi[256];
NI435X_error_message(m_DAQsession,nistatus,tmpvi);
CString tmp;tmp.Format("NI435X_init %x(%d) %s",nistatus,nistatus,tmpvi);
if(warncnt++<5)
AfxMessageBox(tmp);
status = SENSOR_ERROR;
}
return status;
}

double CNI_435x_ADC::GetValue()
{
int status=SENSOR_STATUS_OK;
int nistatus=0;
ViString channelString[16];
ViInt16 mode = NI435X_VOLTAGE;
ViReal64 lowLimit=m_Min;
ViReal64 highLimit=m_Max;
ViReal64 scanBuffer=0.0;
static int warncnt=0;
_stprintf((ViString)channelString,_T("%d"),m_Channel);

if (nistatus=NI435X_Normal_Scanning(m_DAQsession,
(ViString)channelString,
mode, lowLimit, highLimit,
1, &scanBuffer) < NI435X_SUCCESS)
{
ViChar tmpvi[256];
NI435X_error_message(m_DAQsession,nistatus,tmpvi);
CString tmp;tmp.Format("NI435X_Normal_Scanning %x(%d) session ID %d %s",nistatus,nistatus,m_DAQsession,tmpvi);
if(warncnt++<5 && m_DAQsession!=NULL)
AfxMessageBox(tmp);
status = SENSOR_ERROR;
}
else
{
// convert to internal units (Temperature=celcuis,pressure=psi,...)
m_Value = GetValueFromCalTable(scanBuffer/m_UnitsConv);
// Remove error from the calibrated error values
m_Value = m_Value*m_Gain + m_Offset;
//m_Value = scanBuffer/m_UnitsConv;
}

return m_Value;
}

Thanks for your help
Matt
0 Kudos
Message 1 of 5
(3,465 Views)
Matt,

Welcome to the NI Discussion Forums, and congratulations on your first post.

In regard to your post, and the -10240 error that you are seeing, I have a suggestion that may resolve the problem that you are seeing. The 435x boards can be kind of tricky to work with, because they have two different drivers available for them. The first driver is NI-DAQ. NI-DAQ provides all the base level functionality necessary to work with the boards, including the test panel that you mentioned in your post. In addition to NI-DAQ, there is a second driver that can run on top of NI-DAQ to work with the 435x boards. This second driver is known as NI-435x and can be downloaded by following the link below:

NI-435x Driver Download

The NI-435x Driver has additional functionality not found as part of NI-DAQ, and makes programming the boards easier. I suspect from reading your post that you have installed NI-DAQ correctly, but you have not installed NI-435x on your second computer. I believe that installing NI-435x should resolve the error that you are seeing.

Please post back if you have any additional questions.

Regards,
Jed R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,454 Views)
I installed NIDAQ 7.3 and then installed 435x driver and I have the same problem.
My code works on my laptop and not my other system.
How can I tell what is missing from the other system?
0 Kudos
Message 3 of 5
(3,444 Views)
After uninstalling and reinstalling (4350 driver first) the drivers, I'm good to go.
Thanks for the help
0 Kudos
Message 4 of 5
(3,437 Views)
Matt,

I'm glad to hear that you were able to get everything going, and hope it wasn't too difficult.

In the future, if you need any help, just start a new thread so that this forum can assist you.

Best of luck with your application.

Regards,
Jed R.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 5
(3,435 Views)