Read data over RS232 with vb6.0

J

Thread Starter

just_nank

Hi every body,

I have a problem reading data from serial port (rs232) using vb 6.0.

Could you give me the source code for this? Please help me!
 
You can use MSComm ActiveX control of Microsoft to establish the serial link.

You can directly send a string and read responce by using MSComm.Input or MSComm.output methods.

You can use InBufferCount property ans other properties to control your comunication

Vinod.
 
Check out examples on Microsoft's website. Use their Knowledge Base and type in MSCOMM (this is the control used for serial communications in VB6). This is a good one if you want to use the OnComm event (i.e. if you know the number of bytes coming in):

http://support.microsoft.com/default.aspx?scid=kb;en-us;194922

If you just want to poll the serial port, use the timer control and read (e.g. txtInput.text = MSCOMM1.Input) the port at a specific rate.
 
Do you plan to setup the recorder from the PC, or just read and store data?

Reading the data is simple, and we (Lormar Logic Company - http://www.lormarlogic.com) can give you vb6.0 code snippets for this.

The recorder is highly versatile, though. You can use a PC to setup the recorder (e.g. transducer type, range, alarms, etc.), as well as to perform on-screen plotting and data manipulation. If this is what you want, we can help there too, but this will be hundreds of lines of code (and we would probably have to charge for this). Send an email to customerservice (at) LormarLogic (dot) com if we can be of assistance.
 
Top