Hi all,
Thisll be a long question.
I use DS18S20 temp sensors connected to a microcontroller-based circuit DIY kit (a picture of it is here http://quozl.netrek.org/ts/ ) which in turn connects via the serial port to an old windows 98 computer.
On the screen I can read as I brew, the current temp of my HLT, Mash, Herms output, and sparge water. :beerbang:
The problem is that the program is in DOS and the numbers are so small they can be difficult to read from a distance.
What Id like to do is to find a way of using my pathetic abilities in VB programming to take the data from the serial port and display it on a form in nice BIG numbers.
I can build a pretty form, but really have no idea how to capture the data from the serial port as it comes in, and send it to the form! Not sure but I think the data comes to the computer in something called ASCII(?) :blink:
There are some links Ive followed, such as this one at www.klein.com/thermd but its all gibberish to me.
A daemon? Isnt that a nasty spirit that does horrible things to your computer?
This site: http://www.kitsrus.com/soft.html#k145 has info too (The program TLSWinZip is one I currently use) but once again Im way out of my depth.
My VB programming skills are restricted to simple Access databasing and timing programs etc. Never done anything involving getting data from an external source.
Anyhow, looking at VB script websites I found this, it might be useful but I dont know where to stick itI thought it might be good as I could get text boxes on the form to display updates from a textfile?
Title: VBScript Sample - Read information from a serial device (for example: a weight indicator) and write it to a textfile (C:\Output.txt)
Const acERR_SUCCESS = 0
Const strOutputFile = "C:\Output.txt"
Const OpenFileForReading = 1
Const OpenFileForWriting = 2
Const OpenFileForAppending = 8
' --------------------------------------------------------------
Sub ReadStr( o )
str = "notempty"
Do While str <> ""
str = o.ReadString
WScript.Echo "<- " & str
Loop
End Sub
' --------------------------------------------------------------
Set acObj = CreateObject( "ActiveXperts.Comport" )
Wscript.Echo "ActiveComport Serial Port Toolkit " & acObj.Version & " demo."
Wscript.Echo "Expiration date: " & acObj.ExpirationDate & vbCrLf
acObj.Baudrate = 19200
acObj.PortID = 1
acObj.Open
WScript.Echo "acObj.Open, result: " & acObj.LastError
If acObj.LastError = acERR_SUCCESS Then
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists( strOutputFile ) Then
fso.CreateTextFile( strOutputFile )
end If
Set fsoFile = fso.GetFile( strOutputFile )
Set fsoStream = fsoFile.OpenAsTextStream( OpenFileForAppending )
str = "notempty"
WScript.Echo "Press CTRL-C to terminate the program."
Do While 1 = 1
str = acObj.ReadString
If str <> "" Then
WScript.Echo "<- " & str
fsoStream.WriteLine( str )
End If
Loop
fsoStream.Close
End If
Can anyone out there offer some help or advice?
If I can get this thing to work, then like I did with the mash/hop additions brewtimer program from ages ago, I would like to offer it to all brewers for free and also the source code. In fact I could set up a thread for any brewer with no computing or electronics ability whatsoever, that shows where to get the kit in Aus, pics on how to solder it together if you cant follow wiring diags (like me!) and finally a program with BIG numbers that are easy to see.
Help! Anyone?
Cheers.
Andrew
AKA: he who always bites off more than he can chew, and chews like mad
Thisll be a long question.
I use DS18S20 temp sensors connected to a microcontroller-based circuit DIY kit (a picture of it is here http://quozl.netrek.org/ts/ ) which in turn connects via the serial port to an old windows 98 computer.
On the screen I can read as I brew, the current temp of my HLT, Mash, Herms output, and sparge water. :beerbang:
The problem is that the program is in DOS and the numbers are so small they can be difficult to read from a distance.
What Id like to do is to find a way of using my pathetic abilities in VB programming to take the data from the serial port and display it on a form in nice BIG numbers.
I can build a pretty form, but really have no idea how to capture the data from the serial port as it comes in, and send it to the form! Not sure but I think the data comes to the computer in something called ASCII(?) :blink:
There are some links Ive followed, such as this one at www.klein.com/thermd but its all gibberish to me.
A daemon? Isnt that a nasty spirit that does horrible things to your computer?
This site: http://www.kitsrus.com/soft.html#k145 has info too (The program TLSWinZip is one I currently use) but once again Im way out of my depth.
My VB programming skills are restricted to simple Access databasing and timing programs etc. Never done anything involving getting data from an external source.
Anyhow, looking at VB script websites I found this, it might be useful but I dont know where to stick itI thought it might be good as I could get text boxes on the form to display updates from a textfile?
Title: VBScript Sample - Read information from a serial device (for example: a weight indicator) and write it to a textfile (C:\Output.txt)
Const acERR_SUCCESS = 0
Const strOutputFile = "C:\Output.txt"
Const OpenFileForReading = 1
Const OpenFileForWriting = 2
Const OpenFileForAppending = 8
' --------------------------------------------------------------
Sub ReadStr( o )
str = "notempty"
Do While str <> ""
str = o.ReadString
WScript.Echo "<- " & str
Loop
End Sub
' --------------------------------------------------------------
Set acObj = CreateObject( "ActiveXperts.Comport" )
Wscript.Echo "ActiveComport Serial Port Toolkit " & acObj.Version & " demo."
Wscript.Echo "Expiration date: " & acObj.ExpirationDate & vbCrLf
acObj.Baudrate = 19200
acObj.PortID = 1
acObj.Open
WScript.Echo "acObj.Open, result: " & acObj.LastError
If acObj.LastError = acERR_SUCCESS Then
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists( strOutputFile ) Then
fso.CreateTextFile( strOutputFile )
end If
Set fsoFile = fso.GetFile( strOutputFile )
Set fsoStream = fsoFile.OpenAsTextStream( OpenFileForAppending )
str = "notempty"
WScript.Echo "Press CTRL-C to terminate the program."
Do While 1 = 1
str = acObj.ReadString
If str <> "" Then
WScript.Echo "<- " & str
fsoStream.WriteLine( str )
End If
Loop
fsoStream.Close
End If
Can anyone out there offer some help or advice?
If I can get this thing to work, then like I did with the mash/hop additions brewtimer program from ages ago, I would like to offer it to all brewers for free and also the source code. In fact I could set up a thread for any brewer with no computing or electronics ability whatsoever, that shows where to get the kit in Aus, pics on how to solder it together if you cant follow wiring diags (like me!) and finally a program with BIG numbers that are easy to see.
Help! Anyone?
Cheers.
Andrew
AKA: he who always bites off more than he can chew, and chews like mad