Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Device.SelfTest() fails - but the device is ok

The SelfTest call fails miserably - but the hardware IS working fine and it IS registered!
NationalInstruments.DAQmx.DaqException: Network device is not reserved for this host.

Status Code: -201388
   at nNIMSSAIL100.StatusObserverT<nNIMSSAIL100::ApiTraits<nNIMSSAIL100::DotNetApi> >.CheckWithName(StatusObserverT<nNIMSSAIL100::ApiTraits<nNIMSSAIL100::DotNetApi> >* , tCaseInsensitiveBasicString<wchar_t\,_STL::char_traits<wchar_t>\,_STL::allocator<wchar_t>\,nNIDMXS100::tLocaleConsideringWideStringComparitor\,nNIDMXS100::tLocaleConsideringWideStringCaseForcer>* pName)
   at NationalInstruments.DAQmx.Device.SelfTest()
   at Strecon.Drivers.NI.Configurator.SelfTestAll()



ResponseObject
 ro = new ResponseObject(); try
{ string[] devs = NationalInstruments.DAQmx.DaqSystem.Local.Devices; System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach(string sdev in devs) { NationalInstruments.DAQmx.Device niDevice = NationalInstruments.DAQmx.DaqSystem.Local.LoadDevice(sdev); niDevice.SelfTest(); sb.AppendLine("\t" + sdev + " Tested"); } log.Debug("Self tests performed, msg:\n" + sb.ToString()); } catch(Exception ex) { log.Error("Failure in SelfText", ex); ro.Error("Failure in selftest, see logfile for details"); } return ro;
0 Kudos
Message 1 of 3
(5,694 Views)

@Larover88 wrote:
The SelfTest call fails miserably - but the hardware IS working fine and it IS registered!
NationalInstruments.DAQmx.DaqException: Network device is not reserved for this host.

Status Code: -201388
   at nNIMSSAIL100.StatusObserverT<nNIMSSAIL100::ApiTraits<nNIMSSAIL100::DotNetApi> >.CheckWithName(StatusObserverT<nNIMSSAIL100::ApiTraits<nNIMSSAIL100::DotNetApi> >* , tCaseInsensitiveBasicString<wchar_t\,_STL::char_traits<wchar_t>\,_STL::allocator<wchar_t>\,nNIDMXS100::tLocaleConsideringWideStringComparitor\,nNIDMXS100::tLocaleConsideringWideStringCaseForcer>* pName)
   at NationalInstruments.DAQmx.Device.SelfTest()
   at Strecon.Drivers.NI.Configurator.SelfTestAll()



ResponseObject
 ro = new ResponseObject(); try
{ string[] devs = NationalInstruments.DAQmx.DaqSystem.Local.Devices; System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach(string sdev in devs) { NationalInstruments.DAQmx.Device niDevice = NationalInstruments.DAQmx.DaqSystem.Local.LoadDevice(sdev); niDevice.SelfTest(); sb.AppendLine("\t" + sdev + " Tested"); } log.Debug("Self tests performed, msg:\n" + sb.ToString()); } catch(Exception ex) { log.Error("Failure in SelfText", ex); ro.Error("Failure in selftest, see logfile for details"); } return ro;

How many times is your foreach loop running?  Are you certain that the device supports SelfTest?

0 Kudos
Message 2 of 3
(5,688 Views)

Hi Larover88,

 

Cannot really say this is my field of expertise and may be shooting blanks here... Are you sure the device is properly reserved before initializing the self test?

If you perform a self test in MAX, does it generate any errors?

Which version of DAQmx is installed?

 

Have you seen this KB article stating "...there is no Self-Test VI or function in DAQmx prior to 8.9 in LabVIEW, LabWindows/CVI, Visual Basic..." ?

 

How Can I Perform a Reset/Self-Test of My NI-DAQ Device Programmatically?

http://digital.ni.com/public.nsf/allkb/124D580AE300335E86256FDD006CE798

 

Best regards,

Robert P-F
Applications Engineer
National Instruments
0 Kudos
Message 3 of 3
(5,681 Views)