PDA

View Full Version : Excel VBA Com Port communication



freedom123
11-14-2024, 09:47 AM
My home auto system has now died.The server it runs on is 16 years old and has now become unstable. It dies every few hours.

The software, called Touchsoft, only runs on Windows XP and the original deveplopers do not exist anymore/died.

What I have is:
All the wireless switches that are hard-wired to all the devices in the house and operates on the 868 MHz band.

A USB dongle attached to the dysfuntional server on Com port 3 that interprets the data signal from Touchsoft and activates the wireless switches.

A "touch screen" monitor that can plug into any Windows PC. The buttons in Touchsoft are shown on the touchscreen and are activated by touch.

What I have done so far is:
Wrote an Excel VBA front-end with buttons for every device and which shows the state of every button ie ON or OFF.
The Button press ON or OFF can poduce the necessary string/data if I know what format it must be.

What I cannot do yet is:
How to send the string/data to the selected Com port eg Com3.
What the format of the string/data must be in.

arnelgp
11-14-2024, 09:18 PM
1. tech today is fast faced.
who knows there may be vendor out there that cater to your need
at a cheaper price, instead of trying (trial and error) on something
that you not done before.

2. you may also try XP on VM.

akanji_city
11-26-2024, 07:49 PM
To enable COM port communication in Excel VBA, you can use the MSComm control by referencing Microsoft Comm Control in VBA or access it via System.IO.Ports APIs. Analyze the original server's communication to determine the required data format. Use MSComm.PortOpen to open the COM port, send the string using MSComm, output and test with basic commands to control your wireless switches.

LucasNathann
12-29-2024, 11:58 PM
To enable COM port communication in Excel VBA, you can use the MSComm control by referencing Microsoft Comm Control in VBA or access it via System.IO.Ports APIs. Analyze the original server's communication to determine the required data format. Use MSComm.PortOpen to open the COM port, send the string using MSComm, output and test with basic commands to control your wireless switches.
yes that is really a smart solution i will apply this method!

Aussiebear
12-30-2024, 05:00 AM
Sadly LucasNathann, thought it wise to past spam to this forum. Goodbye Lucas.

entertainant
01-12-2025, 09:34 PM
If you have logs or any saved configurations from Touchsoft, analyze them to understand the data format.