| | |
How to automatically update temperature on the form load?
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2007
Posts: 5
Reputation:
Solved Threads: 0
Hai,
I'm read temperature data using MSComm..
The temperature was successfully display on vb6..but how can I update/automatically refresh the temperature on web according to current temperature?
could you kindly please help me over here? thks!
Below is my coding:
I'm read temperature data using MSComm..
The temperature was successfully display on vb6..but how can I update/automatically refresh the temperature on web according to current temperature?
could you kindly please help me over here? thks!
Below is my coding:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Form_Load() MSComm1.PortOpen = True MSComm1.Output = "temp" + Chr$(13) 'waits for 5 char to be recieved Do dummy = DoEvents() Loop Until MSComm1.InBufferCount >= 20 'print value in text box Text1.Text = MSComm1.Input End Sub
What's the code on the refresh button? Currenlty i think you were getting the temp. on the form load also.
You can do this by using a timer control on the form and make the interval "1000" which will be equal to 1 sec. Make the Timer Control Enabled by default, and write the code to refresh temp. in the timer control.
You can do this by using a timer control on the form and make the interval "1000" which will be equal to 1 sec. Make the Timer Control Enabled by default, and write the code to refresh temp. in the timer control.
•
•
Join Date: Oct 2007
Posts: 5
Reputation:
Solved Threads: 0
could you give an examples by using a timer control on the form? i hope i just can refresh the temperature only and not the whole page...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Public Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim MSComm1 As MSComm MSComm1 = New MSComm MSComm1.CommPort = 5 ' select Com1 MSComm1.DTREnable = True MSComm1.EOFEnable = False MSComm1.InBufferSize = 1024 MSComm1.InputMode = InputModeConstants.comInputModeText MSComm1.NullDiscard = False MSComm1.OutBufferSize = 512 MSComm1.Settings = "38400,n,8,1" ' setting parameter in communicate with com port MSComm1.InputLen = 6 'define size of Input buffer (comming with Modem) If MSComm1.PortOpen = False Then MSComm1.PortOpen = True Else MSComm1.PortOpen = False End If 'MSComm1.PortOpen = False 'send RD0 command + CR MSComm1.Output = "temp" + Chr(13) 'waits for 5 char to be recieved 'into serial buffer (data + CR) Do DoEvents() Loop Until MSComm1.InBufferCount >= 20 'print value in text box Label2.Text = MSComm1.Input
![]() |
Similar Threads
- html/php form for .htaccess validation (PHP)
- vb to vb.net (VB.NET)
- How to load multiple images on the form? (C#)
- form load (Visual Basic 4 / 5 / 6)
- How to pre-select checkboxes in form? (PHP)
- how to load an image to a form (Visual Basic 4 / 5 / 6)
- Dialog Box alongwith Form (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: move frame
- Next Thread: open existing excel file in vba
Views: 3298 | Replies: 9
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





