Introduction of VB6 Data Logger Program:-
This is the second of data logger project using PIC18f452. In the previous post we have discussed the hardware of data acquisition system and now in this post we will learn how we can develop a simple data logger to log the process inputs using visual basic VB6.pic datalogger 18f
Following components are used in this project:-
1. Text box
2. Command buttons
3. Com control for serial communication.
Steps to develop a simple program in VB6 for serial communication:-
1. Open a new project and using standard exe in vb6.
2. select text box and drag and drop it on form, re-size it and change with following properties of text box in properties section. (a) enable the multi-line , (b) in text property delete the text1.
3. drag and drop two commands button and change their caption in property section by "Connect" and "Disconnect"
4. Go toll bar, click on project, open component addition menu, find Ms-comm Control 6, and add this to left component section.
5. Drag and drop the MsComm on the form any where.
6. Copy and paste the following code in the code section of the project, compile and enjoy.
Photograph of the Data logger:-
Code (program) in VB6:-
Private Sub Command1_Click()
If (MSComm1.PortOpen = False) Then
MSComm1.PortOpen = True
End If
Command1.Enabled = False
Command2.Enabled = True
End Sub
Private Sub Command2_Click()
If (MSComm1.PortOpen = True) Then
MSComm1.PortOpen = False
End If
Command1.Enabled = True
Command2.Enabled = False
End Sub
Private Sub Form_Load()
With MSComm1
.CommPort = 5
.RThreshold = 1
.RTSEnable = True
.Settings = "9600,N,8,1"
.InputLen = 127
.SThreshold = 1
End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
If (MSComm1.PortOpen = True) Then
MSComm1.PortOpen = False
End If
End Sub
Private Sub MSComm1_OnComm()
Dim Buffer As String
Select Case MSComm1.CommEvent
Case comEvReceive
'Text1.Text = " "
Buffer = MSComm1.Input
Text1.Text = Text1.Text & Buffer
End Select
End Sub




2 comments:
I'm a final year engineering student
and I'm designing a thermal mass flow meter using two lm35 temperature sensors.
the sensors are mounted with a constant heat source in between ,a fan will be used to supply the flow and the change in temperature will be converted by the pic and displayed on an lcd.
I'm having a problem with writing the code , I'm using the pic basic pro compiler could you please help me.
Sent from my BlackBerry® wireless device
@ siya22 Temperature data logger blackberry :-
Ok
If you want help from me in writting the code for microcontroller using PICBasicPro PBP.
YOu have to send me foolowing things:-
1. Which microcontroller you want to use in this project of temperature controller or thermal mass flow meter. Give me other information related to cicuit diagram.
So, it will be good if you send me the whole circuit diagram of your project in proteus ISIS, so that i can better understand and work on it.
2. The code segment you have written sofar, send it to me, soathat i can check ow much work you have already done and what you need ?
3. The program logics and algorithms are also required,
if you have any proposal of your project or synopsis of project, then it would be also helpful.
You can send me all these information in a zip file via e-mail.
My E_mail ID is rghkk@hotmail.com
and
my chatting yahoo ID is rghkk1@yahoo.com
regards
Post a Comment
Hi: This is PICINF.blogspot.com comments section. Here you are requested to write your question or problems in detail. Write the question in such a way that, it have all necessary information, sothat i can understand and reply.If you want to send pictures and codes then e-mail me (rghkk@hotmail.com).Thanks.