A batch program to listen to RS232 port ?

June 14, 2010 at 15:33:21
Specs: DOS (cmd) under windows, embedded GEODE
I want a batch program what listens to COM1
and if it detects "signal1" it starts "A.exe" and
if it detects "signal2" it starts "B.exe".

How can I do that ?
the com port settings doesnt really matter, i
dont want to get the exact signals (like text or
something). i just have two signals and I want
to start different programs according to which
signal is detected on COM1. Basically:

:start
...listening part...
if "%signal%"=="1" A.exe
if "%signal%"=="2" B.exe
goto start

..or something like that. So how can i make
this batch file to listen to COM1, until it
detects a signal ?


See More: A batch program to listen to RS232 port ?

Report •

#1
June 15, 2010 at 03:24:40
Stated this is NOT a DOS question since there is no DOS under Windows XP that is a NT kernel system, what you want to achieve is not possible using a plain batch script.

COM listening is an interrupt driven process that requires a programming language to be performed.

Now the good news: I can give you a tiny code to do what you need. It worked fine under XP for many people though it is a legacy DOS application. I have to customize it according your needs, so if interesrted contact me by a private message including your e-mail address.


Report •

#2
June 15, 2010 at 04:33:57
Thanks, but I already figured it out. It works nice.

Report •

#3
June 25, 2010 at 22:37:56
adam10603,

Can you explain what you did? I would be interested in seeing your solution.

Thanks!

640K is plenty.


Report •
Related Solutions


Ask Question