There's more than one way to do things | |
PerlMonks |
Connecting to Serial Ports greater than COM9 on win32by slloyd (Hermit) |
on Jul 14, 2009 at 18:55 UTC ( [id://780033]=perlquestion: print w/replies, xml ) | Need Help?? |
slloyd has asked for the wisdom of the Perl Monks concerning the following question:
I am using Win32::SerialPort to connect to my USB Serial Port device. When the device is assigned COM9, it connects just fine. If the device is assigned COM10 it fails to connect. Any pointers to connecting to ports greater than 9? I have verified that I have valid devices connected to both 9 and 10 and both show up as valid ports in HKEY_LOCAL_MACHINE, "Hardware\\DeviceMap\\SerialComm"
Update: I found this link on M$ site that explains the problem but I am not sure if the SerialPort module needs to be fixed to support it or if there is a work-around. WorkAround: The work-around is to pass in the port name as "\\.\COMXX" where XX is the number. This works for me anyway.
Results: C:\Automation>test.pl COM9 Connecting to COM9 .... Connected! Press <ENTER> to disconnect C:\Automation>test.pl COM10 Connecting to COM10 .... The system cannot find the file specified. can't open device: COM10 at C:\Automation\test.pl line 7 Unable to connect to COM10 C:\Automation>test.pl \\.\COM10 Connecting to \\.\COM10 .... Connected! Press <ENTER> to disconnect
s/te/ve/
Back to
Seekers of Perl Wisdom
|
|