Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Read/write a Serial Port

Is it possible to use VBA read and write to a serial port
for use in/from Excel?
Where can I look at sample code to learn how it is done?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default Read/write a Serial Port

Hi Wal,
Not directly but you can use API functions:
API Function: Description:

CreateFile() opens a specific communications port.

SetCommState() sets the state of the serial port in question (baud rate,
parity, stop bits etc.)

GetCommState() retrieves the state of the serial port in question (baud
rate, parity, stop bits etc.)

ReadFile() reads data from a port. Can be specified to return
immediately or wait for incoming data.

WriteFile() writes data to the serial port.



MP



"Wal" a écrit dans le message de
...
Is it possible to use VBA read and write to a serial port
for use in/from Excel?
Where can I look at sample code to learn how it is done?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Read/write a Serial Port

Thanks MP, but I don't understand what you mean.

Could you please explain a bit more simply or tell me
where I could read up on how to do this. I can't find any
help in VBA about the functions you suggest.

If it can't be done directly in VAB do I need to write and
run code outside Excel's VBA?

I have read serial port data on an Apple II computer many
years ago so I know a tiny bit, but I don't where to start
with VBA for use in or with Excel.



-----Original Message-----
Hi Wal,
Not directly but you can use API functions:
API Function: Description:

CreateFile() opens a specific communications

port.

SetCommState() sets the state of the serial port in

question (baud rate,
parity, stop bits etc.)

GetCommState() retrieves the state of the serial port

in question (baud
rate, parity, stop bits etc.)

ReadFile() reads data from a port. Can be

specified to return
immediately or wait for incoming data.

WriteFile() writes data to the serial port.



MP



"Wal" a écrit dans

le message de
...
Is it possible to use VBA read and write to a serial

port
for use in/from Excel?
Where can I look at sample code to learn how it is done?



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default Read/write a Serial Port

Hi Wal,
You can use specific component MSCOMM32.OCX:
1. Open Excel
2. Open Visual Basic Editor
3. RightClick somewhere on Project tree (usually on the left) - Insert -
UserForm
4. From the menu - Tools - References - Microsoft Com Control 6.0
(MSCOMM32.OCX) - or click browse and point the file.
5. RightClick somewhere on Project tree (usually on the left) - Insert -
Module
6. write sub or func that declare variable from type MSCommLib.MSComm.

Regards,
MP

"Wal" a écrit dans le message de
...
Thanks MP, but I don't understand what you mean.

Could you please explain a bit more simply or tell me
where I could read up on how to do this. I can't find any
help in VBA about the functions you suggest.

If it can't be done directly in VAB do I need to write and
run code outside Excel's VBA?

I have read serial port data on an Apple II computer many
years ago so I know a tiny bit, but I don't where to start
with VBA for use in or with Excel.



-----Original Message-----
Hi Wal,
Not directly but you can use API functions:
API Function: Description:

CreateFile() opens a specific communications

port.

SetCommState() sets the state of the serial port in

question (baud rate,
parity, stop bits etc.)

GetCommState() retrieves the state of the serial port

in question (baud
rate, parity, stop bits etc.)

ReadFile() reads data from a port. Can be

specified to return
immediately or wait for incoming data.

WriteFile() writes data to the serial port.



MP



"Wal" a écrit dans

le message de
...
Is it possible to use VBA read and write to a serial

port
for use in/from Excel?
Where can I look at sample code to learn how it is done?



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Read/write a Serial Port

Excel does not come with the MSComm ActiveX control- it is provided
with Visual Studio 6. If you have it on your system but do not have
Visual Studio 6 installed, it also will not work because you do not
have a license to use it.

The easiest way to get serial data into an Excel spreadsheet would be
to use a 3rd party tool like WinWedge from TALtech.
WinWedge is an executable program that runs in the background and
feeds serial data directly to other programs either by stuffing the
keyboard buffer or by passing the data to other programs using Dynamic
Data Exchange (DDE). It also supports sending data out a serial port
as well.
For more information about WinWedge please visit:
http://www.taltech.com/products/winwedge.html


On Wed, 6 Oct 2004 18:54:24 -0700, "Wal"
wrote:

Is it possible to use VBA read and write to a serial port
for use in/from Excel?
Where can I look at sample code to learn how it is done?




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Read/write a Serial Port

Another option is to use the ActiveX control CheapComm. You can
download the installer at:

http://ourworld.compuserve.com/homep...r/software.htm

I've put it on Excel 2000 and it seems to work OK so far, but I'm
still struggling with deciphering the code from the GPS download sheet
that is also available at the above site to make it work for my
application.

If any of the groups gurus have any insights or sample code, any
feedback would be appreciated.

On Mon, 25 Oct 2004 15:29:44 GMT, Thomas Lutz wrote:

Excel does not come with the MSComm ActiveX control- it is provided
with Visual Studio 6. If you have it on your system but do not have
Visual Studio 6 installed, it also will not work because you do not
have a license to use it.

The easiest way to get serial data into an Excel spreadsheet would be
to use a 3rd party tool like WinWedge from TALtech.
WinWedge is an executable program that runs in the background and
feeds serial data directly to other programs either by stuffing the
keyboard buffer or by passing the data to other programs using Dynamic
Data Exchange (DDE). It also supports sending data out a serial port
as well.
For more information about WinWedge please visit:
http://www.taltech.com/products/winwedge.html


On Wed, 6 Oct 2004 18:54:24 -0700, "Wal"
wrote:

Is it possible to use VBA read and write to a serial port
for use in/from Excel?
Where can I look at sample code to learn how it is done?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial port interface TAV Excel Programming 2 October 25th 04 04:14 PM
serial port data acquisition jgseas Excel Programming 2 March 3rd 04 04:33 PM
Mac Serial Port Communication Jeff Robson Excel Programming 0 November 30th 03 03:51 PM
Excel and the Serial Port Hotbird Excel Programming 1 November 27th 03 11:10 PM
serial port mscomm32.ocx in excel Brian Excel Programming 0 July 25th 03 11:22 PM


All times are GMT +1. The time now is 07:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"