11-14-2006 04:24 PM
Implementing device driver for DMM PXI 4070 for an in-house test program.
My workstation connects to a PXI controller with one DMM card.
Running the demo from NI-DMM for Window 2000/XP CD on my workstation is
find.
But, using the same lib file, nidmm_32.lib, as one in the demo, the
instruction
checkErr(niDMM_init(m_ResourceName, idQuery, reset, &vi)) fails and returns
Error Code = -1074135030.
I have double checked the parameters of the function:
m_ResourceName = "DAQ::5::INSTR",
idQuery = 1, and
reset = 1,
I am passing the address of vi seesion veraible to the function.
The following is the code segment I havd. It is almost the same as the
demo
found in the CD coming with the device.
When carrying out checkErr(niDMM_init(m_ResourceName, idQuery, reset, &vi))
, it jumps to the 'Error:' session, and the error code -1074135030 is shown
in
the debugger.
ViSession vi = VI_NULL
ViBoolean idQuery = VI_TRUE
ViBoolean reset = VI_TRUE
ViStatus error = VI_SUCCESS
ViInt32 measurementType = NIDMM_VAL_DC_CURRENT
ViReal64 powerlineFreq = 60
//m_PLFreq.GetItemData(m_PLFreq.GetCurSel())
ViReal64 range = 0.0200
//atof(m_RangeVal.GetBuffer(20))
ViReal64 resolution = 0.0000001
//atof(m_ResolutionVal.GetBuffer(20))
ViReal64 reading = 0.000
ViChar tempString[40]
ViChar modeStr[20]
ViChar dataStr[20]
ViChar rangeStr[20]
ViBoolean overRange = VI_FALSE
//if(mode == REAL || mode == CHECK || mode == ECHO || mode == ECHOCHECK)
//{
/*- Initiate the DMM and create a session
--------------------------------*/
checkErr(niDMM_init(m_ResourceName, idQuery, reset, &vi))
/*- Configure Powerline Frequency
----------------------------------------*/
checkErr(niDMM_ConfigurePowerLineFrequency (vi, powerlineFreq))
/*- Configure DC Measurement
---------------------------------------------*/
checkErr(niDMM_ConfigureMeasurement(vi, measurementType, range,
resolution))
/*- Read DC volts
--------------------------------------------------------*/
checkErr(niDMM_Read (vi, NIDMM_VAL_TIME_LIMIT_AUTO, &reading))
/*- Find out if the measurement is over range ----------------------*/
niDMM_IsOverRange(vi, reading, &overRange)
/*- Display Reading
------------------------------------------------------*/
checkErr(niDMM_FormatMeasAbsolute (measurementType, range, resolution,
reading, modeStr, rangeStr, dataStr))
sprintf(tempString, "%s %s", dataStr, modeStr)
strcpy(m_res, dataStr)
Error:
if (vi)
{
niDMM_close(vi)
}
if (error < VI_SUCCESS)
{
ViChar errorMessage[256] = ""
/*- Get the error description
--------------------------------------------*/
niDMM_error_message(VI_NULL, error, errorMessage)
}
}
NI Software : Measurement Studio for Visual Studio .Net version 7.1
NI Hardware : Digital Multimeters (DMMs) device PXI-4070
Driver Version : 2.5
OS : Windows 2000
11-15-2006 07:13 PM - edited 11-15-2006 07:13 PM
Message Edited by Travis W on 11-15-2006 07:21 PM
07-10-2007 10:49 AM
I have the same error
The reply to this post does not make sense. The device cannot be renamed since it is a traditional daq device. The referenced article lists the Instrument Descriptor exactly as the post describes. I can't get anywhere with this problem either
07-11-2007 12:42 PM - edited 07-11-2007 12:42 PM
Message Edited by Nick F on 07-11-2007 12:43 PM
07-12-2007 09:17 PM