Well that is pretty simple, your formula is almost the code you would need just remove the spaces between the words and assign values to the current and previous weights.
You definitely should be able to write the code yourself in under 10 minutes
Hardly to find an open source for weighing scale communication class or module. I think this kind of software is commercial sensitivity. Sure you can't find the whole cake on VBForums. You may find something on PSC.
i have this code but i have to put this value into my textbox and determine its previous weight , current weight and the difference of this two...
Code:
Option Strict Off
Option Explicit On
Module InpOut32_Declarations
Public Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAddress As Integer) As Integer
Public Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)
End Module
Public Class Form1
Dim intRunning As Integer
Dim intWeightReadingCount As Integer
Dim decWeightReadingLast As Decimal
Dim datetime1 As Date, datetime2 As Date
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'REM Timer1.Enabled = True
SerialPort1.Open()
Dim i As Integer
For i = 0 To 10000
datetime1 = DateTime.Now
TickTimer2()
Next
End Sub
Private Sub TickTimer2()
Dim decWeightReading As Decimal, strScaleCommand As String
Dim strSerialData As String
Dim strSerialDataNew As String
Dim strFirstData As String
Dim cnt As Integer
Dim diffDate As TimeSpan
decWeightReading = CDec("0.000")
strScaleCommand = "IP" + vbCrLf
strFirstData = ""
SerialPort1.WriteLine(strScaleCommand)
strSerialData = SerialPort1.ReadLine
strSerialDataNew = ""
cnt = 0
Do Until cnt = 10
SerialPort1.WriteLine(strScaleCommand)
strSerialDataNew = SerialPort1.ReadLine
If strSerialDataNew = strSerialData Then
cnt = cnt + 1
Else
strSerialData = strSerialDataNew
strSerialDataNew = ""
cnt = 0
End If
Loop
datetime2 = DateTime.Now
diffDate = datetime2.Subtract(datetime1)
'MessageBox.Show(diffDate.Milliseconds.ToString + " Weight" + strSerialData)
'MessageBox.Show(DateDiff(DateInterval.Minute, datetime1, datetime2))
Console.WriteLine(diffDate.Milliseconds.ToString + " Weight " + strSerialData)
End Sub
End Class
Yeah...yesterday OP said he was using VS 2005...so definitely more than likely he still is....better answers probably available in the .Net forum (although, DM and dilett, I know you can probably answer).