0

I´m trying to get the "last arrival date" property out of the device manager in vb.net. I tried it already with the Win32_PnPEntity, but this property is not included. Is there another function to get this property?

I need this to check how long a "NI PXI Express Chassis" is already ON. It is connected via Thunderbolt and contains a digital multimeter, which need a warmup time of 30 minutes. So before i start the measurements, i have to check, if the warmup time is already over.

Here is my Code actual Code, but as i said, it doesn´t offers this property:

    Dim path As System.Management.ManagementPath = New ManagementPath()
    path.Server = "."
    path.NamespacePath = "root\CIMV2"
    Dim scope As ManagementScope = New ManagementScope(path)
    Dim query As ObjectQuery = New ObjectQuery("SELECT * FROM Win32_PnPEntity WHERE Name LIKE 'NI PXI Express Chassis Control Device'")
    Dim searcher As ManagementObjectSearcher = New ManagementObjectSearcher(scope, query)
    Dim queryCollection As ManagementObjectCollection = searcher.Get()
    Dim m As ManagementObject
    For Each m In queryCollection
        Console.WriteLine("Device Name : {0}", m("Name"))
        Console.WriteLine("Availability : {0}", m("Availability"))
        Console.WriteLine("Caption : {0}", m("Caption"))
        Console.WriteLine("ClassGuid : {0}", m("ClassGuid"))
        Console.WriteLine("CompatibleID : {0}", m("CompatibleID"))
        Console.WriteLine("ConfigManagerErrorCode : {0}", m("ConfigManagerErrorCode"))
        Console.WriteLine("ConfigManagerUserConfig : {0}", m("ConfigManagerUserConfig"))
        Console.WriteLine("CreationClassName : {0}", m("CreationClassName"))
        Console.WriteLine("Description : {0}", m("Description"))
        Console.WriteLine("DeviceID : {0}", m("DeviceID"))
        Console.WriteLine("ErrorCleared : {0}", m("ErrorCleared"))
        Console.WriteLine("ErrorDescription : {0}", m("ErrorDescription"))
        Console.WriteLine("HardwareID : {0}", m("HardwareID"))
        Console.WriteLine("InstallDate : {0:G}", m("InstallDate"))
        Console.WriteLine("LastErrorCode : {0}", m("LastErrorCode"))
        Console.WriteLine("Manufacturer : {0}", m("Manufacturer"))
        Console.WriteLine("Name : {0}", m("Name"))
        Console.WriteLine("PNPClass : {0}", m("PNPClass"))
        Console.WriteLine("PNPDeviceID : {0}", m("PNPDeviceID"))
        Console.WriteLine("PowerManagementCapabilities : {0}", m("PowerManagementCapabilities"))
        Console.WriteLine("PowerManagementSupported : {0}", m("PowerManagementSupported"))
        Console.WriteLine("Present : {0}", m("Present"))
        Console.WriteLine("Service : {0}", m("Service"))
        Console.WriteLine("Status : {0}", m("Status"))
        Console.WriteLine("StatusInfo : {0}", m("StatusInfo"))
        Console.WriteLine("SystemCreationClassName : {0}", m("SystemCreationClassName"))
        Console.WriteLine("SystemName : {0}", m("SystemName"))

    Next
    Console.ReadLine()

The property i need: Screenshot device-manager

Thanks for your help.

djv
  • 15,168
  • 7
  • 48
  • 72
Duryon
  • 1
  • 2
  • [NI-SCOPE .NET Class Library 17.1](http://www.ni.com/download/ni-scope-.net-class-library-17.1/7313/en/) – Jimi Feb 27 '19 at 14:25
  • I am already using NIDMMDotNET1700-Libary. Do you know already the function Name i need? – Duryon Feb 27 '19 at 14:39
  • Do you have some examples which you can share or some code that needs a fix? – LuckyLikey Feb 27 '19 at 14:51
  • You need version 17.10 of the NI-SCOPE driver and components. Possibly, Visual Studio 2013. You can make it work with VS 2015/2017 with manual *intervention*. They have a Forum for this. – Jimi Feb 27 '19 at 15:21
  • I installed the NI-Scope Driver and components. Any advice where to look? On the first look there is no such function in the Driver-.dll. By the way i am using VS2013 on Win10 64-Bit, so hopefully the Driver will work. – Duryon Feb 28 '19 at 09:26

0 Answers0