Displaying data with VB


Thread Starter


I am trying to build a major senior project. The basic gist of the project is to receive information from several sensor devices (actually photo sensors) and display it in the form of table or graphics--all of this with Visual Basic. We have written code to receive data from the com port, but when execute the program, we are getting a run time error. The error is somewhere in the display code... does anyone have any ideas how to receive serial data and display it on a simple form?
This project sounds familiar. Someone else had similar requirements a few months back.

The first thing you do is write a version of the program that reads test data from a file and display that. That will isolate the com stuff from the display stuff.

Next you read sensor data and display it in a simple text box. In fact, if you can, first try receiving the data in Hyperterminal to verify the comm. works.

At that point you should be able to glue the two pieces together. It would help to indicate what the run time error you were receiving actually was, and the line of code that generated it.

Dim mBuffer as String
Private Sub MsComm_OnComm()
mBuffer = mBuffer & MSComm.Input
form1.label1.caption = mBuffer
end sub

Public Function GetInputData()
Loop until MSComm.InputbufferCount > 0
GetInputData = MSComm.Input
End Function

'Call The Function with the Command
Label1.Caption = GetInputData
end sub
<p>there are different ways to receive and deplay data from the Comm port. also the data format that the controller sends to the computer. maybe you have to convert it to what you want...

<p>What is the error number that you get...

<p>I hope this helps...