View Single Post
 
Old 02-22-2015, 01:40 AM
Hyadain Hyadain is offline
Newcomer
 
Join Date: Feb 2015
Posts: 1
Unhappy Weighing software

Good Day to everyone!

I was developing a digital weighing scale for the additional features for our thesis. Now i am having a problem in my program, the serial port was working just fine but i receive many data from it. I am using an RS232 Weighing Sensor by e-Gizmo. Documentation about the hardware is here: https://docs.google.com/file/d/0BxdL...BRRWN0WVU/edit

Here's the actual hardware that i have:
http://i.imgur.com/4co1dVT.jpg
http://i.imgur.com/gG7uYFO.jpg


In my simple program (just to see what my device is sending me) im having this output:
http://i.imgur.com/Bnxv17j.png?1

I just want the label consistently change when i recieve data from my device like on this video:
https://www.youtube.com/watch?v=W-d1TvMlBUs




Now Here's my code:
Code:
Imports System.IO
Imports System.IO.Ports
Imports System.Threading
Public Class Form1
Dim incomingByte As String = ""
Dim sec As Integer
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
With SerialPort1 'Connection ko po sa serial port
.Close()
.PortName = "COM3"
.BaudRate = 9600
.Parity = Parity.None
.DataBits = 8
.StopBits = StopBits.One
.DtrEnable = True
.RtsEnable = True
.ReceivedBytesThreshold = 1
End With
SerialPort1.Open()
Label1.Text = SerialPort1.ReadExisting() 'Dito po ung reading ng data from serial port

Timer1.Interval = 1000
Timer1.Enabled = True
sec = 0

End Sub

Private Sub readport()
Label1.Text = SerialPort1.ReadExisting() 'declaration po para ma call sa time tick
End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Call readport()
sec = sec + 1
Label2.Text = sec
End Sub
End Class


I am using Visual Basic 2013 for my program.
I hope someone can help me, im so desperate to finish this program.
Thanks in Advance~!

Last edited by Flyguy; 02-23-2015 at 01:46 AM.
Reply With Quote