Help With Exception please
Posted: Thu Jun 19, 2014 11:01 am
Hello All. Below is a exception that I have been getting and the code that throws it. I can't seem to figure it out. I was hoping that someone could shed some light on it or let me know how to handle it. I have tried catching it but it still closes the program. Thanks
Exception:
An unhandled exception of type 'Phidgets.PhidgetException' occurred in Phidget21.NET.dll
Additional information: PhidgetException 9 (Value is Unknown (State not yet received from device, or not yet set by user)
Program Code:
Public Class ReservoirCalibration
Dim WithEvents Bridge1 As Phidgets.Bridge
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
End Sub
Private Sub ReservoirCalibration_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
Bridge1 = New Phidgets.Bridge
Bridge1.open()
Timer1.Start()
Bridge1.bridges(0).Enabled = True
Catch outofrange As System.ArgumentOutOfRangeException
Catch ex As Phidgets.PhidgetException
MessageBox.Show(ex.ToString())
End Try
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
LoadCell1Raw.Text = Bridge1.bridges(0).BridgeValue.ToString
End Sub
End Class
Exception:
An unhandled exception of type 'Phidgets.PhidgetException' occurred in Phidget21.NET.dll
Additional information: PhidgetException 9 (Value is Unknown (State not yet received from device, or not yet set by user)
Program Code:
Public Class ReservoirCalibration
Dim WithEvents Bridge1 As Phidgets.Bridge
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
End Sub
Private Sub ReservoirCalibration_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
Bridge1 = New Phidgets.Bridge
Bridge1.open()
Timer1.Start()
Bridge1.bridges(0).Enabled = True
Catch outofrange As System.ArgumentOutOfRangeException
Catch ex As Phidgets.PhidgetException
MessageBox.Show(ex.ToString())
End Try
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
LoadCell1Raw.Text = Bridge1.bridges(0).BridgeValue.ToString
End Sub
End Class