Reading the pin voltage fm RS232 port into excel by using VBA

O

oscar

Is there any way in VBA to read or write a bit to RS232 port?
Just like INP / OUT did in QBASIC.

Thanks for anyone could give me a helping hand

Oscar
 
B

Bernie Deitrick

Oscar,

VB6 comes with an MSComm control that allows data collection / read /
write over serial ports.

You'll probably get better help on using it in the VB newsgroups.

HTH,
Bernie
MS Excel MVP
 
T

Thomas Lutz

You cannot read the voltage however you can find out the "state" of
pins on a serial port. The pins on the serial port are discrete logic
levels either On or Off. You would either need to use a serial
communications ActiveX control like the MSComm control to test the
states of the serial port hardware handshaking lines or write some
fairly complex VBA code or use a tool like the "PortStat" program
available from TAL Technologies in the Free Software section of their
web site at:

http://www.taltech.com/freesoftware/fs_sw.htm

Look for the PortStat program near the bottom of the above web page.
Portstat opens a COM port and when the state of a hardware handshaking
line changes, it can either display that state in cells in your
spreadsheet of it can force Excel to run a VBA subroutine.

More information on RS232 and TCP/IP communications can be found at
www.taltech.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top