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. https://github.com/Serialcomms/Serial-Ports-in-VBA-new-for-2022 Let ...
serialcomms
Oct 11, 2023Copper Contributor
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.
https://github.com/Serialcomms/Serial-Ports-in-VBA-new-for-2022/blob/main/SERIAL_PORT_VBA.bas
Regards,
SerialComms
LeoKing
Oct 12, 2023Copper Contributor
Thanks for your reply. I figured it out - it's as simple as sending a carriage return at the end of the command string!