Question Reading COM port on interrupt in Windows XP ? Is it possible?

Status
Not open for further replies.
May 8, 2023
1
0
10
Hello,

I am new to this board and to hardware programming in general. I wasn't sure where to post this because it is both a Windows XP question and a programming question.

I am sending data from one laptop to another using modems that are connected to their respective serial ports. When the receiving laptop sees data on the serial port, I would like that event to force the execution of another program on the receiving laptop to write the data to a file

I have read that Windows does not allow user-level programs to access interrupts. If this is true, what's the best way to accomplish what I'm trying to do? We are using Windows XP and C with the ancient Watcom C/C++ compiler.

Thanks to all who read this.
 

Ralston18

Titan
Moderator
Look into Powershell and the commands for RS232 (Serial Ports).

FYI:

https://copyprogramming.com/howto/powershell-commands-for-serial-port-data-code-example

https://www.appsloveworld.com/power...l-port-data-continuously-in-powershell-script

You can find other similar links and tutorials.

First focus on "reading" ports then writing data to ports.

With the receiving laptop using IF-THEN-ELSE logic to launch the applicable program based on the incoming serial port data.

Small test cmdlets to begin with and then scripts.
 

kanewolf

Titan
Moderator
Look into Powershell and the commands for RS232 (Serial Ports).

FYI:

https://copyprogramming.com/howto/powershell-commands-for-serial-port-data-code-example

https://www.appsloveworld.com/power...l-port-data-continuously-in-powershell-script

You can find other similar links and tutorials.

First focus on "reading" ports then writing data to ports.

With the receiving laptop using IF-THEN-ELSE logic to launch the applicable program based on the incoming serial port data.

Small test cmdlets to begin with and then scripts.
Since the question is about XP, I don't know if powershell is supported.
 

Ralston18

Titan
Moderator
Point well taken.

As I first understood it, XP SP3 supported Powershell.

"PowerShell 1.0 was released in 2006 for Windows XP SP2, Windows Server 2003 and Windows Vista. It is an optional component of Windows Server 2008.

PowerShell 2.0 is integrated with Windows 7 and Windows Server 2008 R2 and is released for Windows XP with Service Pack 3, Windows Server 2003 with Service Pack 2, and Windows Vista with Service Pack 1."


Source:

https://en.wikipedia.org/wiki/PowerShell

= = = =

In the meantime I found the following links:

https://devblogs.microsoft.com/scripting/installing-powershell-on-windows-xp-and-copying-files/

https://answers.microsoft.com/en-us...or-winxp/11f4c289-f51f-49d9-b526-aec2ee14f73f

Powershell 3.0 being a "no".

https://social.technet.microsoft.co...can-powershell-v3-be-installed-on-windows-xp-

Do not know how well, if at all, older versions of PS will support serial port communications.

TBD....
 

JeffreyP55

Distinguished
Mar 3, 2015
566
139
19,070
Hello,

I am new to this board and to hardware programming in general. I wasn't sure where to post this because it is both a Windows XP question and a programming question.

I am sending data from one laptop to another using modems that are connected to their respective serial ports. When the receiving laptop sees data on the serial port, I would like that event to force the execution of another program on the receiving laptop to write the data to a file

I have read that Windows does not allow user-level programs to access interrupts. If this is true, what's the best way to accomplish what I'm trying to do? We are using Windows XP and C with the ancient Watcom C/C++ compiler.

Thanks to all who read this.

Windows PowerShell Versions​


Versionintegrated withreleased for
1.0Windows XP SP2
Server 2003 SP1
Windows Vista
2.0Windows 7
Windows Server 2008 R2[59]
Windows XP SP3
Windows Server 2003 SP2
Windows Vista SP1
3.0Windows 8
Windows Server 2012
Windows 7 SP1
Windows Server 2008 SP1
Windows Server 2008 R2 SP1
4.0Windows 8.1
Windows Server 2012 R2
Windows 7 SP1
Windows Server 2008 R2 SP1
Windows Server 2012
5.1
 

kanewolf

Titan
Moderator
I have written Powershell code. As I remember, powershell 2.0 was bad. It wasn't until 3.0 and beyond (4.0 was pretty good to work with), that many features were available. Providing example code, that is supported by 2.0 may be hard to find.
 
See if you can find an older version of Visual Studio Express (2010 I believe was the last XP supported version)

That should at least get you a toolchain that exposes the serial port, and you can make it a GUI app if needed. And while it's been a while since I've played around with Visual Studio based coding for Windows apps, I do recall that you can set up the serial port interface in the app to react to data.
 
Status
Not open for further replies.