Forum Discussion
serialcomms
Aug 17, 2022Copper Contributor
Serial COM Ports in Excel VBA
Hello all, I've uploaded a new set of VBA functions for anyone still interested in using Serial COM Ports with Excel. GitHub - Serialcomms/Serial-Ports-in-VBA-new-for-2022: Using Serial COM ...
Andrew_M395
Jan 06, 2024Copper Contributor
I have solved this: I needed to add a delay between the open port and transmit in my own subroutine. This despite the fact that the transmit reported sending the data sucessfully. I then went back to the example and invcreased the delay before If Port_Started(Port_Number) Then to 2000 and it worked.
Thanks again for the code.
Regards Andrew M
Thanks again for the code.
Regards Andrew M
serialcomms
Jan 07, 2024Copper Contributor
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.
- Andrew_M395Jan 08, 2024Copper Contributor
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