aske1204 / open-hardware-monitor

Automatically exported from code.google.com/p/open-hardware-monitor
0 stars 0 forks source link

using dll in vb.net - cannot get values from motherboard #679

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What is the expected output? What do you see instead?

I would expect to see voltages, temperatures and fan speed (as your app shows) 
but sensors only showing Fan Control

What version of the product are you using? On what operating system?

Latest - Windows 8.1

Does anyone have a sample app in vb.net that I could look at if not - I can 
successfully retrieve names of all devices that has sensors - and can get 
details from CPU - but for motherboard only fan control is showing - whereas it 
shows fine when running your app

Original issue reported on code.google.com by wingnut1...@gmail.com on 28 Mar 2015 at 8:25

GoogleCodeExporter commented 9 years ago
Problem solved - needed to add subhardware.Update() line to get it to work - 
code I used below if useful to anyone else

For i As Integer = 0 To cp.Hardware.Count() - 1
            Dim hardware = cp.Hardware(i)
            hardware.Update()

            Select Case hardware.HardwareType
                Case HardwareType.Mainboard
                    TextBox3.AppendText("Motherboard: " & hardware.Name & vbCrLf & vbCrLf)
                    For k = 0 To hardware.SubHardware.Count - 1
                        Dim subhardware = hardware.SubHardware(k)
                        subhardware.Update()
                        TextBox3.AppendText(subhardware.Name & vbCrLf & vbCrLf)
                        For j = 0 To subhardware.Sensors.Count - 1
                            Dim sensor = subhardware.Sensors(j)
                            Select (sensor.SensorType)
                                Case 0
                                    TextBox3.AppendText("Voltage: " & sensor.Name & " - " & sensor.Value & vbCrLf)
                                Case 1
                                    TextBox3.AppendText("Clock: " & sensor.Name & " - " & sensor.Value & vbCrLf)
                                Case 2
                                    TextBox3.AppendText("Temperature: " & sensor.Name & " - " & sensor.Value & vbCrLf)
                                Case 3
                                    TextBox3.AppendText("Load: " & sensor.Name & " - " & sensor.Value & vbCrLf)
                                Case 4
                                    TextBox3.AppendText("Fan Speed: " & sensor.Name & " - " & sensor.Value & vbCrLf)
                                Case 5
                                    TextBox3.AppendText("Flow: " & sensor.Name & " - " & sensor.Value & vbCrLf)
                                Case 6
                                    TextBox3.AppendText("Fan Control: " & sensor.Name & " - " & sensor.Value & vbCrLf)
                                Case 7
                                    TextBox3.AppendText("Level: " & sensor.Name & " - " & sensor.Value & vbCrLf)
                                Case 8
                                    TextBox3.AppendText("Factor: " & sensor.Name & " - " & sensor.Value & vbCrLf)
                                Case 9
                                    TextBox3.AppendText("Power: " & sensor.Name & " - " & sensor.Value & vbCrLf)
                                Case 10
                                    TextBox3.AppendText("Data: " & sensor.Name & " - " & sensor.Value & vbCrLf)
                                Case Else
                                    TextBox3.AppendText(sensor.SensorType & " - " & sensor.Name & " - " & sensor.Value & vbCrLf)
                            End Select
                        Next
                        TextBox3.AppendText(vbCrLf)
                    Next

End Select

Original comment by wingnut1...@gmail.com on 9 Apr 2015 at 10:49