Question reading data from weighing scale

maxhunter

New member
Joined
Nov 14, 2010
Messages
2
Programming Experience
Beginner
I have a digital weighing scale I need to connect to the PC using RS232 communication port. Every time I weigh an object, automatically the result/weight will display in the the texbox control in Visual Basic Application
I use to receive data via a timer for continuous looping sequence output to a textbox. Things do goes bad, as it flicking all the way. I using a indicator from AD series which read data from load cell of a truck weight bridge. It there's any way to stop this flicking without effecting the continuous loop?
can any one help me ???
vb6 or vb.net any platform no problem please help me i want just solution
 
When you say "flicking", do you actually mean "flickering"? If there's a problem with the UI refreshing then it's probably because you're making too many changes too rapidly. You'll need to provide more precise information on exactly what you're doing. The Timer Interval and Tick event handler would be a good start.
 
Private Sub Timer1_Timer()
If MSComm1.PortOpen = False Then

MSComm1.Settings = "9600,N,8,1"
MSComm1.InputLen = 0
MSComm1.PortOpen = True

End If
MSComm1.InputMode = comInputModeText
strabc = MSComm1.Input
text1.text= strabc

End Sub


this is my code and timer interval is 100
when i change the timer interval to 1000 it will show the full text but take delay not real time
 
Is the Form flickering or is the value from the scaled that is jumping up and down like crazy?

case is the form, you could try to make it a bit slower than 100 but not as slow as 1000 to find a mid-point.
there might be some other way to keep it 100, but I don't know.

If is the number, you can use some simple math to smooth the reading. Something like:
VB.NET:
    Dim Filter As Integer = 5
    FinalVal = FinalVal - (  (FinalVal - Reading)/ Filter  )
changing the filter value you vary how smooth the final on-screen will be, but if you want it more real time, you should keep it between 2-10
 
Back
Top