Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Checking if a Scope Device is simulated

I have some simulated Devices in NI MAX for testing purposes.

For DAQmx devices I detect the simulated state with the IsSimulated Property like below:

 

Imports NationalInstruments.DAQmx

 

Public Class HardwareLoader

 

Private Function CheckHardwareStatus() As AICore.EHardwareStatus

  Dim devices As List(Of String)

  Dim device As Device = Nothing 

  devices.AddRange(DaqSystem.Local.Devices)

  For Each d As String In _devices
    Dim dev As Device = DaqSystem.Local.LoadDevice(d)
    If dev.IsSimulated Then
      hrdwrStatus = AICore.EHardwareStatus.Simulated
      device = d

      Exit For

   End If
  ..

..

End Function

..

..

End Class

 

I want to do something similar with a Scope device using the NationalInstruments.ModularInstruments Class.

 

Here parts of my code:

 

Public Class HardwareLoader

Private _device As DeviceInfo
Private _devices As List(Of DeviceInfo)

..

 

Dim modularInstruments As New ModularInstrumentsSystem("NI-Scope")
If _devices Is Nothing AndAlso modularInstruments.DeviceCollection.Count > 0 Then
  _devices = New List(Of DeviceInfo)
  For Each d In modularInstruments.DeviceCollection
    _devices.Add(d)
  Next
  End If

 

If devices.Count > 0 Then
For Each d In devices

  ' This is the position I need to do the simulated checking

Next

 ..

..

End Class

 

Unfortunatey there's no 'IsSimulated' Property or 'LoadDevice' Method in the DeviceInfo Class. Is there any way to get this Device information?

 

Patrick

0 Kudos
Message 1 of 1
(961 Views)