ASP.net Web Form through Serial Port

exinvilab

New Member
I have done some changes to my coding and tested it. It is still not working perfectly hence i hope to have some guidance here.\[code\]Imports SystemImports System.DataImports System.ConfigurationImports System.CollectionsImports System.WebImports System.Web.SecurityImports System.Web.UIImports System.Web.UI.WebControlsImports System.Web.UI.WebControls.WebPartsImports System.Web.UI.HtmlControlsImports System.IO.PortsPartial Class Main Inherits System.Web.UI.PageProtected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load Dim Serialport7 As New IO.Ports.SerialPort With Serialport7 .PortName = "COM7" .BaudRate = 9600 .Parity = Parity.None .DataBits = 8 .StopBits = StopBits.One End With Try Serialport7.Open() Catch ex As Exception MsgBox(ex.ToString) End Try Dim ReceivedData As String ReceivedData = http://stackoverflow.com/questions/15719901/Serialport7.ReadLine() If ReceivedData.Substring(0, 1) ="T" Then TextBox1.Text = ReceivedData.Remove(0, 1) ElseIf ReceivedData.Substring(0, 1) = "H" Then TextBox2.Text = ReceivedData.Remove(0, 1) End If TextBox3.Text = System.DateTime.Now Serialport7.Close()End SubEnd Class\[/code\]The errors i have encountered:
  • TextBox2 is not displaying the reading, only TextBox1 is showing the reading.
  • The Web form is not refreshing hence my readings are not updated. Is there any way i can auto update the Web form ?
Appreciates all guidance.Thanks.
 
Back
Top