Aug 17 2022 01:19 AM
Hello all,
I've uploaded a new set of VBA functions for anyone still interested in using Serial COM Ports with Excel.
Let us know if they work for you thanks.
J.
Feb 01 2023 04:15 AM
Feb 01 2023 09:08 PM
May 24 2023 06:24 AM
No options : THANK YOU VERY MUCH !!!!!!!! I spent hours for making Open/Input/Get ... working with nothing else than a void answer. Now it works extremely well. No doubts : it's a high contribution to the professional Excel VB developers community. Warm congrats again
Jun 15 2023 04:53 AM
@serialcomms Hello,
One additional question: I need to identify a device connected to a given port. How to get some device info (like its name, type or anything significant) ?
Thanks in advance for your feedback.
Jun 15 2023 03:01 PM
Maybe you should try this:
'--------------------------------------------------------------------------------------------------
'Loops through all the USB controllers and devices (sticks, hubs, etc.) and retrieves information.
'The code uses a WMI script in order to access the Win32_USBControllerDevice class.
'Written By: Christos Samaras
'Date: 13/01/2014
'E-mail: email address removed for privacy reasons
'Site: https://www.myengineeringworld.net
'https://myengineeringworld.net/2014/01/retrieve-usb-device-information-vba-wmi.html
'--------------------------------------------------------------------------------------------------
Oct 10 2023 03:24 PM - edited Oct 11 2023 02:19 PM
First of all, thanks for the VBA code! I'm one of those infrequent VAB user and use it occasionally. I do have a problem using the code to write/read from an instrument connected to a PC via serial port. The problem is that the analytical instrument does not start sampling when I send "SS" using TRANSMIT_COM_PORT with VBA in Access to the COM port, whereas it does if I use Putty or a Windows form application previously written with VB.net. I don't know why. It seems to me the transmission mechanism is different. Any advice will be much appreciated!
Oct 11 2023 11:15 AM
Hello and thanks for your interest in SerialComms VBA.
You may have a timing problem between VBA and your instrument.
Modern PC is simply far too fast for relatively slow serial ports and attached devices.
Try adding a delay between starting the COM port and sending the Start Sampling command.
Add a second delay between sending the command and waiting for a response.
There's an example function at the end of the listing below which shows how to do that.
Regards,
SerialComms
Oct 12 2023 10:45 AM
Jan 06 2024 09:46 AM
Jan 06 2024 10:22 AM
Jan 07 2024 11:36 AM
Hello,
At least one Arduino model (Uno R3) will intentionally reboot when a serial connection is made to it. This may explain the need for a delay after opening the port as you have discovered.
The following Github repository contains a modified version which allows an Arduino serial connection to be made without rebooting it.
Serialcomms/Serial-Ports-in-VBA-Arduino-2023: Arduino R3 serial version (github.com)
There is also a separate function to reboot the Arduino if you need it, and a sample Arduino sketch to send analogue channel values to the serial port.
Note also that the Uno is relatively slow compared to a modern PC which further increases the need for timing delays.
Regards,
Serialcomms.
Jan 08 2024 01:09 AM
@serialcomms Thankyou for the help it was useful. I should have realised by Arduino was rebooting on connection. It explains some other things I did not understand happening. First use of Arduino. I will certainly look at the Arduino version.
Thanks Andrew M
Mar 05 2024 04:29 AM
@serialcomms hello, I am using excel 2106 and I used your module which is much appreciated! My problem is I can connect to the port with the correct baud rate and all but when I send a command then request to receive what should be displayed I just get a mirror of what I sent.
example sent: (EX)
received : (EX)
This should return a software and firmware ascii text. I tried using \r\c or one of each at the end of the sent string and I just revive that added text back.
please help and thanks!
Mar 07 2024 12:54 AM
Jun 10 2024 10:55 AM
Sep 05 2024 10:02 PM