Below is code for a very simple procedure. I enable a timer, every 50 ms I check if a flag in another form is set indicating to update some text boxes (text boxes hold data for motor controller) I am 100% sure that the algorithm is working correctly to the point where I write to the text box. Does anybody know why I cannot write to the text boxes in my Real_Time_Display form? If I write the text boxes upon loading the form, it works fine. But when accessing from the interrupt nothing happens. ThanksPublicClassReal_Time_Display
PrivateSharedWithEvents myTimer2 AsNew System.Windows.Forms.Timer()
PrivateSharedSub TimerEventProcessor(myObject AsObject, ByVal myEventArgs AsEventArgs) Handles myTimer2.Tick
'Get data and update form here
If (GlobalVariables.Update_dataFlag = True) Then
GlobalVariables.Update_dataFlag = False
Real_Time_Display.txtTempM1.Text = Main.realTime_DisplayData(1).ToString
Real_Time_Display.txtTempM2.Text = Main.realTime_DisplayData(2).ToString
Real_Time_Display.txtAmbientTemp.Text = Main.realTime_DisplayData(3).ToString
Real_Time_Display.txtVoltage.Text = Main.realTime_DisplayData(4).ToString
Real_Time_Display.txtCurrentM1.Text = Main.realTime_DisplayData(5).ToString
Real_Time_Display.txtCurrentM2.Text = Main.realTime_DisplayData(6).ToString
EndIf
EndSub
'Form load events
PrivateSub Real_Time_Display_Load(sender AsObject, e AsEventArgs) HandlesMyBase.Load
myTimer2.Interval = 50 'Interval for count in milliseconds. We need to poll
myTimer2.Enabled = True'Start the timer
EndSub
EndClass
PrivateSharedWithEvents myTimer2 AsNew System.Windows.Forms.Timer()
PrivateSharedSub TimerEventProcessor(myObject AsObject, ByVal myEventArgs AsEventArgs) Handles myTimer2.Tick
'Get data and update form here
If (GlobalVariables.Update_dataFlag = True) Then
GlobalVariables.Update_dataFlag = False
Real_Time_Display.txtTempM1.Text = Main.realTime_DisplayData(1).ToString
Real_Time_Display.txtTempM2.Text = Main.realTime_DisplayData(2).ToString
Real_Time_Display.txtAmbientTemp.Text = Main.realTime_DisplayData(3).ToString
Real_Time_Display.txtVoltage.Text = Main.realTime_DisplayData(4).ToString
Real_Time_Display.txtCurrentM1.Text = Main.realTime_DisplayData(5).ToString
Real_Time_Display.txtCurrentM2.Text = Main.realTime_DisplayData(6).ToString
EndIf
EndSub
'Form load events
PrivateSub Real_Time_Display_Load(sender AsObject, e AsEventArgs) HandlesMyBase.Load
myTimer2.Interval = 50 'Interval for count in milliseconds. We need to poll
myTimer2.Enabled = True'Start the timer
EndSub
EndClass