Prolific Comm To USB driver not working

Trying to install a Prolific Comm to USB driver for the cable. Use it if for switches etc.

I get the attached image error when trying to install in compatibility mode right at the end.

It's the x64 Win7 driver

Anybody have a workaround?.

Thanks,


Here;s the release notes from for the driver:

PL-2303 Driver Setup Installer, Prolific Edition
Setup Installer Revision Note History
=================================================

System Requirement:
  . Supports the following Windows OSes:
- Windows 98SE
- Windows ME
- Windows 2000 SP4
- Windows XP SP2 and above (32 & 64 bit)
- Windows Server 2003 (32 & 64 bit)
- Windows Server 2008 / 2008 R2 (32 & 64 bit)
- Windows Vista (32 & 64 bit)
- Windows 7 (32 & 64 bit)
     NOTE: For Windows 7, please use RC build 7100 or above.
  . USB host controller
  . Device using PL-2303H/HX/X version chip
 

Supported device ID and product strings:
  . VID_067B&PID_2303 for "Prolific USB-to-Serial Comm Port"


Driver Versions:
-------------------
- Windows 98/ME Driver: v2.0.0.19
- Windows 2000/XP/Server2003 (32 & 64-bit) WDM WHQL Driver: v2.0.13.130
- Windows Vista/7/Server2008 (32 & 64-bit) WDF WHQL Driver: v3.3.11.152


Release Notes:
---------------
PL2303 Driver Installer v1.2.10
  Changes from Installer v1.1.0:
Driver Changes - 
- Windows Vista/7/Server2008 (32 & 64-bit) WDF WHQL Driver: v3.3.11.152
- Fixed BSOD issue when unplug device while data transfer

Installer Changes - 
- Add "Modify/Repair/Remove" Menu when doing uninstall/update.

   Installer & Build date: 1.2.10 (2010-4-08)

   Language Support: 
- English (default)
- Chinese (Traditional) 
- Chinese (Simplified)
- Japanese


========================================
Prolific Technology Inc.
http://www.prolific.com.tw



  • Edited by hazmat2012 Wednesday, August 22, 2012 5:38 AM
August 22nd, 2012 5:36am

I got my end of life PL-2303 HXA USB serial converter to work on Windows8 64bit by doing the following. 

Visit the prolific site and get the following driver:

PL2303_Prolific_Vista_332102   (Yes, this is a Vista installer which will install on Win7 but not Win8) Go figure!

Install PL2303_Prolific_Vista_332102 on a Windows7 machine.  Once installed go to the C:\Windows\System32\Drivers folder and copy the file called ser2pl64.sys it should be 90KB if you use the 155KB file it will not work.  Do not use the 155KB file.  Copy the 90KB file to a USB drive

On the windows8 computer install the windows 8 driver PL2303_Prolific_Driverstaller_v_1_7_0  it's on http://www.prolific.com.tw/US/CustomerLogin.aspx use guest guest for user and password.

Run that installer then copy the 90KB ser2pl64.sys file into the Windows8 C:\Windows\System32\Drivers  you will overwrite any other that is there.

Reboot or disable and enable the USB to serial in the device manager of Windows8 and it should work. 


  • Edited by RichM02145 Monday, November 12, 2012 9:25 PM model #
  • Proposed as answer by philMacU Friday, April 11, 2014 11:58 AM
Free Windows Admin Tool Kit Click here and download it now
November 12th, 2012 9:24pm

Hi,

Here is driver taken from win 7. Should work for both Win 8 X86/X64.

Don't forget to remove all not working drivers using device manager and check delete driver.

http://sendspace.com/file/5m5afw


November 27th, 2012 1:14am

Hi,

I had a problem using prolific PL2303 for win 7 driver installer.

My device com was correctly installed (checked from device manager); but I couldn't transfer data using usb/serial connection on Win 7 64bit systems.

Here is what I found:

Driver date:    19/11/2009
Driver version: 2.0.13.130

Driver details:
File location                                  File version         Status
C:\Windows\system32\DRIVERS\ser2pl64.sys       2.0.13.130           OK         
C:\Windows\system32\DRIVERS\serenum.sys        6.1.7600.16385       OK


--------------------------------------------------------------------------

Driver date:    26/07/2012
Driver version: 3.4.36.247

Driver details:

File location                                  File version         Status
C:\Windows\system32\DRIVERS\ser2pl64.sys       3.4.36.247           NOT OK
C:\Windows\system32\DRIVERS\serenum.sys        6.1.7600.16385       OK

windows update is updating ser2pl64.sys from 2.0.13.130 to 3.4.36.247 (especially after the prolific installer has been installed; or when you hit the driver update button from the driver properties).

Manually overwriting the driver file ser2pl64.sys version 2.0.13.130 does fix the problem.

You can reach that file version here on our FTP.

Unbelievable that prolific can't do a proper installer or having drivers which work with latest windows updates...


  • Edited by CodeFire Thursday, November 29, 2012 3:33 PM
Free Windows Admin Tool Kit Click here and download it now
November 29th, 2012 3:33pm

Thank you. There is no other way, I've tried everything. You have to stick with Windows 7 for that chipset or move to Windows 8 with FTDI Chipset.

PS -

The above is true, but read lower and you'll see I did actually find a working solution.

Hiphoptech



  • Edited by Hiphoptech Thursday, January 09, 2014 10:24 PM
January 7th, 2013 5:37pm

No need to copy files to the drivers directory, etc. at all! I got my PL-2303 USB-to-Serial-Converter running on a 32-bit machine with Windows 8 as follows. My Windows 8 installation is in German, so I have to translate. 

  • Go to the device manager and plug in your USB-to-Serial cable. The device icon should pop up in "COM & LPT" with a yellow mark that indicates that the device is not correctly installed.
  • Double click to open its properties.
  • Go to the "Driver" tab and hit the button to update your driver. 
  • I see two options "Automatically look for new drivers" and "Look for drivers on your computer". Choose to look on your computer. 
  • Now you may specify a path to look for drivers. Leave it blank and choose to select a driver from a list of drivers on your computer. 
  • On my computer it shows four different "Prolific USB-to-Serial Comm Port" drivers. Choose version 3.2.0.0. 

The driver version 3.2.0.0 [31.07.2007] works fine on my Windows 8 32-bit installation, while the newer versions of the driver (3.3.5.122 and 3.4.36.247) do not. Hopefully, this helps someone out there. 

  • Proposed as answer by Rey6221 Wednesday, June 19, 2013 9:34 AM
Free Windows Admin Tool Kit Click here and download it now
January 16th, 2013 2:37pm

We put together an installer package that works around this problem by:

- Removing any configured serial ports using a Prolific Driver

- Removing the current Prolific Driver

- Reinstalling the latest Prolific Driver

- Overwriting either ser2pl.sys (32 bit) or ser2pl64.sys (64 bit) with a version of the same file from an older prolific driver

- Resetting the registry entry for serial device enumeration such that the next inserted device becomes COM3.

You can download it here: http://www.brightledsigns.com/downloads/plclean.exe

We've tested it on Windows 7, 64 bit, but it should work for anything XP and above.   Would appreciate any feedback on whether it worked for you (please include OS and whether 32 or 64 bit).

  • Proposed as answer by BrightSigns Wednesday, March 06, 2013 5:37 PM
March 6th, 2013 5:37pm

Vegan Fanatic pointed you here for Prolific.

CharliePel provided the user name and password to access support   guest\guest 

There, Prolific specifically addresses the issue and provides Windows 8 drivers, provided that you don't have a bootleg version of the product or the end of life version.

Prolific also recommends newer compatible products that will just plug and load.

Finally, as with all usb products, install the drivers first and then connect the device if Windows does not identify and install drivers after just plugging it in.

C'mon! Please read all that Prolific provides. End of story.

  • Proposed as answer by Nano Warp Sunday, March 24, 2013 11:39 AM
Free Windows Admin Tool Kit Click here and download it now
March 24th, 2013 11:36am

I've tried plclean.exe on Windows 8 Pro 64 bit with the PL-2303 HXA and unfortunately it did not work. I might also mention that it was a USB 3.0 port.


Jeddam, End of Life version, it will not work. Please visit Prolific for a solution.

Yes I know. I have the PL-2303 HXD chip too but I am having problems with it. I have posted a question at stackoverflow regarding PL-2303 HXD and USB 3.0 and I have sent a support question to Prolific. I don't know what else to do. That is why I am trying to get the HXA working on Windows 8. The machine I have with Windows 8 only have USB 3.0 ports. (Dell Vostro 3560)

  • Edited by Jeddam Monday, March 25, 2013 6:44 AM
March 25th, 2013 6:40am

Hi,

Here is driver taken from win 7. Should work for both Win 8 X86/X64.

Don't forget to remove all not working drivers using device manager and check delete driver.

http://sendspace.com/file/5m5afw



thank you.. it works..

  • Edited by primaridha Saturday, May 04, 2013 1:12 PM
Free Windows Admin Tool Kit Click here and download it now
May 4th, 2013 1:11pm

Hi,

Here is driver taken from win 7. Should work for both Win 8 X86/X64.

Don't forget to remove all not working drivers using device manager and check delete driver.

http://sendspace.com/file/5m5afw



it Works for me too in win8_x64, thank man you rule !!

Yes, also for me.

I think that the most difficult for most of the people is how to avoid windows 8(.1) to take the newer driver again. It's very difficult to get rid of it.

I did it like this:

Open up Device Manager and right click the faulty Prolific USB-to-Serial Comm Port driver, with the warning in yellow. Then "Update Driver software ...", "Browse my computer for driver software", "Let me pick from a list of device drivers on my computer", "Have Disk ...", browse to the folder Prolific_Win8_x64_x86 with the older 3.3.2.102 drivers and double click on the ser2pl.inf file.

This worked for me.

 



  • Edited by wsurfmarc Saturday, November 23, 2013 8:05 PM
  • Proposed as answer by RGuise Wednesday, February 26, 2014 4:24 PM
November 23rd, 2013 8:03pm

I used this method and it's working for My Lenovo Windows 8 64bit OS!

Thank you!!

Needed this for work!

-Hiphoptech.

Free Windows Admin Tool Kit Click here and download it now
January 9th, 2014 9:57pm

Use these steps with the post I marked as "Proposed Answer" with the Sendspace link. These two combined worked well for me. You just have to update everytime you re-insert the USB to Serial adapter. Just keep the directory with the Profilic_Win8_x64_x86.zip unzipped on your local drive and use the steps above every time you need to use it. A little hassle but it's working so I'll stick to that method. Thank you for the details as this is also part of the answer. Couldn't get Windows to find the Vista installer and this didn't work for me on Windows x64.

Hiphoptech

January 9th, 2014 10:23pm

Hi,

Here is driver taken from win 7. Should work for both Win 8 X86/X64.

Don't forget to remove all not working drivers using device manager and check delete driver.

http://sendspace.com/file/5m5afw



it Works for me too in win8_x64, thank man you rule !!

Yes, also for me.

I think that the most difficult for most of the people is how to avoid windows 8(.1) to take the newer driver again. It's very difficult to get rid of it.

I did it like this:

Open up Device Manager and right click the faulty Prolific USB-to-Serial Comm Port driver, with the warning in yellow. Then "Update Driver software ...", "Browse my computer for driver software", "Let me pick from a list of device drivers on my computer", "Have Disk ...", browse to the folder Prolific_Win8_x64_x86 with the older 3.3.2.102 drivers and double click on the ser2pl.inf file.

This worked for me.

 



Yes! The best answer so far. It also worked for me. Many thanks!
Free Windows Admin Tool Kit Click here and download it now
February 26th, 2014 4:25pm

PL2303XA/HXA (CBR USB-COM(RS-232C)) ser2pl64. sys 3.3.2.105 27.10.2008, 3.3.2.102  Bug in driver:if set DTR=1 and RTS=0  then  DTR (wire) will be   =0 , RTS=0 (low level)  not matter ( , м м DTR=1)  (level, using loopback test  3-2 ,1-4-6,7-8, ComEx from HiAsm 4 Alt build).

DTR=1 (level,+5V) will be only if DTR=1  and RTS=1 (in program), else =0.

How to fix this bug in Win7 x64 Home Base ? In Knoppix 7  ->need to patch pl2303.c (RTS,DTR control algorithm).



  • Edited by Andrej K_ Wednesday, April 09, 2014 11:56 PM
April 9th, 2014 11:51pm

Test program for Hiasm 4

Add(MainForm,2953706,21,105)
 {
  Width=976
  Height=593
  Point(onClose)
  link(onClose,2455737:doWork2,[(71,132)(71,398)])
 }
 Add(EnumCOM,15691736,98,245)
 {
  OutType=0
  link(onEnumPorts,3955287:doAdd,[])
 }
 Add(COMEX,10679999,203,427)
 {
  DataBits=1
  Point(onRING)
  Point(onDCD)
  Point(onCTS)
  Point(onDSR)
  Point(onSetComState)
  Point(doRXClear)
  Point(doDTR)
  Point(doRTS)
  Point(doSetComState)
  link(onSyncWrite,1930118:doText,[(271,433)(271,349)])
  link(onRead,10979187:doValue,[(345,440)(345,412)])
  link(onSyncRead,3724314:doValue,[(345,447)(345,454)])
  link(Port,6647147:Value,[])
  link(BaudRate,16326190:Value,[(216,321)(370,321)])
  link(onRING,6561896:doText,[(275,454)(275,468)])
  link(onDCD,11709161:doText,[(281,461)(281,517)])
  link(onCTS,12023232:doText,[(268,468)(268,559)])
  link(onDSR,8285548:doText,[(258,475)(258,601)])
  link(onSetComState,7542368:doText,[(249,482)(249,650)])
 }
 Add(ComboBox,1302486,308,203)
 {
  Left=200
  Top=30
  Width=170
  Height=24
  Strings=#2:50|2:75|3:110|3:150|3:300|3:600|4:1200|4:1800|4:2000|4:2400|4:3600|4:4800|4:7200|4:9600|5:14440|5:19200|5:28800|5:38400|5:57600|6:115200|6:128000|6:256000|
  Text="Baud Rate"
  DataType=1
  Point(onSelect)
  Point(onChangeText)
  link(onClick,16326190:doValue,[(352,216)(352,230)])
 }
 Add(Memory,16326190,364,224)
 {
  link(onData,3506215:doText,[(407,230)(407,229)])
 }
 Add(ComboBox,3955287,154,245)
 {
  Left=5
  Top=30
  Width=170
  Height=24
  Strings=#0:|4:COM1|4:COM2|4:COM3|4:COM4|4:COM5|4:COM6|4:COM7|4:COM8|4:COM9|5:COM10|5:COM11|5:COM12|5:COM13|5:COM14|5:COM15|5:COM16|5:COM17|5:COM18|5:COM19|5:COM20|
  Text="Port Number"
  Point(onSelect)
  Point(onChangeText)
  link(onClick,6647147:doValue,[(194,258)(194,265)])
 }
 Add(Memory,6647147,203,259)
 {
  Default=Integer(9600)
  link(onData,213112:doText,[])
 }
 Add(Button,14559517,7,245)
 {
  Left=15
  Top=85
  Width=80
  Caption="Enum"
  link(onClick,5608508:doWork2,[])
 }
 Add(Button,452509,112,322)
 {
  Left=15
  Top=110
  Width=80
  Caption="Open"
  link(onClick,10679999:doOpen,[(187,328)(187,433)])
 }
 Add(Button,11772522,112,364)
 {
  Left=15
  Top=135
  Width=80
  Caption="Close"
  link(onClick,2455737:doWork1,[(177,370)])
 }
 Add(CheckBox,12491755,84,497)
 {
  Left=235
  Top=65
  Width=75
  Caption="DTR 1"
  link(onCheck,10679999:doDTR,[(177,503)(177,461)])
 }
 Add(Button,6992723,84,455)
 {
  Left=105
  Top=85
  Width=80
  Caption="RX Clear"
  link(onClick,10679999:doRXClear,[(174,461)(174,454)])
 }
 Add(CheckBox,184272,84,539)
 {
  Left=235
  Top=115
  Width=80
  Caption="RTS 1"
  link(onCheck,10679999:doRTS,[(160,545)(160,468)])
 }
 Add(Label,1930118,294,343)
 {
  Left=635
  Top=155
 }
 Add(Label,6561896,308,462)
 {
  Left=395
  Top=145
 }
 Add(Label,4207733,371,462)
 {
  Left=320
  Top=145
  Width=52
  Height=20
  Caption="OnRing "
 }
 Add(Label,11709161,308,511)
 {
  Left=395
  Top=65
 }
 Add(Label,11544116,371,511)
 {
  Left=325
  Top=65
  Width=52
  Height=20
  Caption="On DCD"
 }
 Add(Label,12023232,308,553)
 {
  Left=395
  Top=115
 }
 Add(Label,382687,371,553)
 {
  Left=325
  Top=115
  Width=52
  Height=20
  Caption="On CTS"
 }
 Add(Label,8285548,308,595)
 {
  Left=395
  Top=85
 }
 Add(Label,6988529,371,595)
 {
  Left=325
  Top=85
  Width=52
  Height=20
  Caption="On DSR"
 }
 Add(Label,7542368,308,644)
 {
  Left=635
  Top=125
 }
 Add(Label,14659245,371,644)
 {
  Left=515
  Top=125
  Width=102
  Height=20
  Caption="On Set Com State"
 }
 Add(RichEdit,5827556,714,448)
 {
  Left=395
  Top=180
  Width=365
  Height=320
  ScrollBars=3
  InsertCRLF=1
  Point(FileName)
  link(FileName,1383569:Value,[(741,415)(797,415)])
 }
 Add(Label,213112,259,259)
 {
  Left=145
 }
 Add(HubEx,5608508,63,245)
 {
  link(onEvent,15691736:doEnumPorts,[])
 }
 Add(Button,14188485,84,581)
 {
  Left=375
  Top=30
  Width=100
  Height=25
  Caption="Set com state"
  link(onClick,10679999:doSetComState,[(195,587)(195,475)])
 }
 Add(Label,3506215,418,223)
 {
  Left=320
  Top=5
 }
 Add(RichEdit,8299331,533,300)
 {
  Left=15
  Top=180
  Width=365
  Height=320
  ScrollBars=3
  InsertCRLF=1
  Point(onChar)
  Point(FileName)
  Point(doCursor)
  Point(Handle)
  link(onChar,15117365:doWork1,[(575,313)])
  link(FileName,10911216:Value,[(560,291)(783,291)])
 }
 Add(Label,6235371,203,147)
 {
  Left=100
  Top=160
  Width=121
  Height=20
  Caption="Data for transmitting"
 }
 Add(Label,16289719,447,156)
 {
  Left=505
  Top=155
  Width=96
  Height=20
  Caption="Received data "
 }
 Add(HubEx,2455737,173,392)
 {
  Angle=1
  link(onEvent,10679999:doClose,[(177,440)])
 }
 Add(Memory,3724314,567,448)
 {
  link(onData,15554017:doCompare,[(611,454)(611,594)(450,594)(450,734)])
 }
 Add(Memory,10979187,525,406)
 {
  link(onData,7009701:doCompare,[(563,412)(563,521)(441,521)(441,629)])
 }
 Add(RadioButton,1452631,462,539)
 {
  Left=720
  Top=20
  Selected=0
  Caption="Async"
 }
 Add(RadioButton,681468,463,673)
 {
  Left=720
  Top=50
  Caption="Sync"
 }
 Add(If_else,7009701,462,623)
 {
  Op2=Integer(1)
  link(onTrue,6366776:doData,[])
  link(Op1,1452631:Selected,[])
 }
 Add(DoData,6366776,525,623)
 {
  link(onEventData,13463060:doWork3,[(635,629)])
  link(Data,10979187:Value,[])
 }
 Add(DoData,12028296,567,728)
 {
  link(onEventData,13463060:doWork2,[(615,734)(615,601)])
  link(Data,3724314:Value,[])
 }
 Add(If_else,15554017,462,728)
 {
  Op2=Integer(1)
  link(onTrue,12028296:doData,[])
  link(Op1,681468:Selected,[(468,716)(469,716)])
 }
 Add(HubEx,13463060,631,595)
 {
  Angle=3
  link(onEvent,5827556:doAdd,[(635,454)])
 }
 Add(ODialog,13068799,707,245)
 {
  link(onExecute,5671635:doEvent1,[])
 }
 Add(Button,4665630,651,245)
 {
  Left=15
  Top=505
  Caption="Load"
  link(onClick,13068799:doExecute,[])
 }
 Add(Label,7547326,28,532)
 {
  Left=815
  Top=275
 }
 Add(Memory,10911216,777,245)
 {
  link(onData,10116895:doEvent1,[])
 }
 Add(Label,7000143,868,245)
 {
  Left=20
  Top=535
 }
 Add(Hub,10116895,826,245)
 {
  OutCount=3
  link(onEvent1,7000143:doText,[])
  link(onEvent2,8299331:doLoad,[(847,258)(847,284)(507,284)(507,327)])
 }
 Add(Button,1920478,427,350)
 {
  Left=90
  Top=505
  Width=85
  Caption="Transmit"
  link(onClick,8050318:doWork2,[])
 }
 Add(ArrayEnum,12635300,602,378)
 {
  link(onItem,15117365:doWork3,[(646,384)(646,349)])
  link(Array,8299331:Array,[(608,362)(553,362)])
 }
 Add(HubEx,15117365,571,343)
 {
  Angle=1
  link(onEvent,10679999:doWrite,[(575,386)(191,386)(191,447)])
 }
 Add(HubEx,8050318,544,350)
 {
  Angle=1
  link(onEvent,12635300:doEnum,[(548,384)])
 }
 Add(SDialog,8306008,742,350)
 {
  FileName="logtx.txt"
  link(onExecute,1383569:doValue,[])
 }
 Add(Button,4087852,686,350)
 {
  Left=400
  Top=505
  Caption="Save"
  link(onClick,8306008:doExecute,[])
 }
 Add(Memory,1383569,791,350)
 {
  link(onData,5827556:doSave,[(835,356)(835,419)(702,419)(702,482)])
 }
 Add(Button,14492944,651,196)
 {
  Left=195
  Top=505
  Width=65
  Caption="Save"
  link(onClick,15437328:doExecute,[])
 }
 Add(SDialog,15437328,707,196)
 {
  FileName="logrx.txt"
  link(onExecute,14041053:doEvent1,[])
 }
 Add(Hub,5671635,749,245)
 {
  InCount=2
  OutCount=3
  link(onEvent1,10911216:doValue,[])
 }
 Add(Hub,14041053,756,196)
 {
  InCount=2
  OutCount=3
  link(onEvent1,5671635:doEvent2,[(782,202)(782,230)(737,230)(737,258)])
  link(onEvent2,8299331:doSave,[(782,209)(782,271)(521,271)(521,334)])
 }




  • Edited by Andrej K_ Thursday, April 10, 2014 12:29 AM
Free Windows Admin Tool Kit Click here and download it now
April 10th, 2014 12:01am

VID_067B&PID_2303 for "Prolific USB-to-Serial Comm Port"
April 10th, 2014 12:27am

Reference how to patch or remake for Win 7 x32,x64,Win8  in WDK 8 (without Visual studio)?  
http://code.woboq.org/linux/linux/drivers/usb/serial/pl2303.c.html
  • Edited by Andrej K_ Thursday, April 10, 2014 12:35 AM
Free Windows Admin Tool Kit Click here and download it now
April 10th, 2014 12:34am

unit hiCOMEX;

interface

uses Windows, Kol, Share, Debug;

const
  _nm: string = 'NOEMS';
  dtrrts: string = 'offon ';

type
  _COMSTAT1 = record
    Flags: DWORD;
    cbInQue: DWORD;
    cbOutQue: DWORD;
  end;
  TComStat1 = _COMSTAT1;

type

  THICOMEX = class(TDebug)
   private
    hFile: THandle;
    thrd, thwr: PThread;
    OvrWr, OvrRd: TOverlapped;
    ReadStr: string;
    MaskRd: DWORD;
    SendedWr: Integer;
    procedure CloseCom;
    function SetCom(BaudRate: Integer; Parity, DataBits, StopBits: Char; DTR, RTS: string): boolean;
    function InitCom(BaudRate, PortNo: Integer; Parity, DataBits, StopBits: Char; DTR, RTS: string): boolean;
    function ExecuteRd(Sender: PThread): Integer;
    function ExecuteWr(Sender: PThread): Integer;
    procedure SyncExecRd;
    procedure SyncExecWr;
    procedure SyncExecSt;    
   public
    _prop_Port:byte;
    _prop_BaudRate:integer;
    _prop_Parity:integer;
    _prop_DataBits:integer;
    _prop_StopBits:integer;    
    _prop_DTR: byte;
    _prop_RTS: byte;    

    _event_onSyncWrite:THI_Event;
    _event_onRead:THI_Event;
    _event_onSyncRead:THI_Event;    
    _event_onDSR:THI_Event;
    _event_onCTS:THI_Event;
    _event_onDCD:THI_Event;    
    _event_onRING:THI_Event;
    _event_onSetComState:THI_Event;    
    _data_BaudRate:THI_Event;
    _data_Port:THI_Event;

    constructor Create;
    destructor Destroy; override;
    procedure _work_doOpen(var _Data:TData; Index:word);
    procedure _work_doClose(var _Data:TData; Index:word);
    procedure _work_doRXClear(var _Data:TData; Index:word);
    procedure _work_doWrite(var _Data:TData; Index:word);
    procedure _work_doDTR(var _Data:TData; Index:word);
    procedure _work_doRTS(var _Data:TData; Index:word);
    procedure _work_doSetComState(var _Data:TData; Index:word);
    procedure _work_doDataBits(var _Data:TData; Index:word);    
    procedure _work_doParity(var _Data:TData; Index:word);    
    procedure _work_doStopBits(var _Data:TData; Index:word);
  end;

implementation

constructor THICOMEX.Create;
begin
  inherited; 
  hFile := INVALID_HANDLE_VALUE;
  FillChar(OvrWr, SizeOf(TOverlapped), #0);
  OvrWr.hEvent := CreateEvent(nil, True, True, #0);
  FillChar(OvrRd, SizeOf(TOverlapped), #0);
  OvrRd.hEvent := CreateEvent(nil, false, false, #0);
end;

destructor THICOMEX.Destroy;
begin
//         FPC
{$ifndef F_P}
  CloseCom;
  CloseHandle(OvrWr.hEvent);
  CloseHandle(OvrRd.hEvent);
{$endif}  
  inherited Destroy; 
end;

function THICOMEX.SetCom(BaudRate: Integer; Parity, DataBits, StopBits: Char; DTR, RTS: string): Boolean;
var 
  PortParam: string;
  dcb: TDCB;
  cto: _COMMTIMEOUTS;
begin 
  result := false;
  if hFile = INVALID_HANDLE_VALUE then exit;

  //  
  GetCommState(hFile, dcb); //   
  PortParam := 'baud='    + Int2Str(BaudRate) +
               ' data='   + DataBits +
               ' parity=' + Parity +
               ' stop='   + StopBits +
               ' dtr='    + DTR +
               ' rts='    + RTS +
               ' xon=off odsr=off octs=off idsr=off';

  FillChar(cto, sizeof(cto), #0);   //   TimeOut-,       

  if BuildCommDCB(PChar(PortParam), DCB) then
    result := SetCommState(hFile, DCB) and SetCommTimeouts(hFile, cto);
end;

function THICOMEX.InitCom(BaudRate, PortNo: Integer; Parity, DataBits, StopBits: Char; DTR, RTS: string): Boolean;
var 
  FileName: string; 
  PortParam: string;
  dcb: TDCB;
  cto: _COMMTIMEOUTS;
  FModems: DWORD;  
begin 
  result := false;
  CloseCom;
  FileName := '\\.\Com' + Int2Str(PortNo); //  
  hFile := CreateFile(PChar(FileName),
           GENERIC_READ or GENERIC_WRITE,
           0,
           nil,
           OPEN_EXISTING,
           FILE_FLAG_OVERLAPPED,
           0);
  if hFile = INVALID_HANDLE_VALUE then exit;

  //  
  GetCommState(hFile, dcb); //   
  PortParam := 'baud='    + Int2Str(BaudRate) +
               ' data='   + DataBits +
               ' parity=' + Parity +
               ' stop='   + StopBits +
               ' dtr='    + DTR +
               ' rts='    + RTS +
               ' xon=off odsr=off octs=off idsr=off';

  FillChar(cto, sizeof(cto), #0);   //   TimeOut-,       

  if BuildCommDCB(PChar(PortParam), DCB) then
    result := SetCommState(hFile, DCB) and SetCommTimeouts(hFile, cto);
  if not result then
    CloseCom
  else
  begin
    thrd := {$ifdef F_P}NewThreadforFPC{$else}NewThread{$endif};
    thrd.ThreadPriority := THREAD_PRIORITY_HIGHEST;
    thrd.OnExecute := ExecuteRd;
    thwr := {$ifdef F_P}NewThreadforFPC{$else}NewThread{$endif};
    thwr.ThreadPriority := THREAD_PRIORITY_HIGHEST;
    thwr.OnExecute := ExecuteWr;
    PurgeComm(hFile, PURGE_TXCLEAR or PURGE_RXCLEAR);
    SetCommMask(hFile, EV_RXCHAR or EV_DSR or EV_CTS or EV_RLSD or EV_RING);
    if GetCommModemStatus(hFile, FModems) then
    begin
      _hi_onEvent(_event_onDSR, integer((FModems and MS_DSR_ON) = MS_DSR_ON));
      _hi_onEvent(_event_onCTS, integer((FModems and MS_CTS_ON) = MS_CTS_ON));
      _hi_onEvent(_event_onDCD, integer((FModems and MS_RLSD_ON) = MS_RLSD_ON));            
      _hi_onEvent(_event_onRING, integer((FModems and MS_RING_ON) = MS_RING_ON));
    end;      
    thrd.Resume;
  end;  
end;

procedure THICOMEX.CloseCom;
begin
  if Assigned(thrd) then
  begin
    thrd.Terminate;
    thrd.WaitFor;
    free_and_nil(thrd);    
  end;
  if Assigned(thwr) then
  begin
    thwr.Terminate;
    thwr.WaitFor;
    free_and_nil(thwr);    
  end;
  if hFile = INVALID_HANDLE_VALUE then exit;
  PurgeComm(hFile, PURGE_TXCLEAR or PURGE_RXCLEAR);
  CloseHandle(hFile);
  hFile := INVALID_HANDLE_VALUE;
end;

procedure THICOMEX._work_doOpen;
begin
   CloseCom;
   InitCom(ReadInteger(_Data,_data_BaudRate,_prop_BaudRate),
           ReadInteger(_Data,_data_Port,_prop_Port + 1),
           _nm[_prop_Parity + 1],
           Int2Str(_prop_DataBits + 7)[1],
           Int2Str(_prop_StopBits + 1)[1],
           Copy(dtrrts, _prop_DTR * 3 + 1, 3),
           Copy(dtrrts, _prop_RTS * 3 + 1, 3));
end;

procedure THICOMEX._work_doClose;
begin
  CloseCom;
end;

procedure THICOMEX._work_doRXClear;
begin
  if hFile <> INVALID_HANDLE_VALUE then
     PurgeComm(hFile, PURGE_RXCLEAR);
end;

procedure THICOMEX._work_doWrite;
var
  BufferWr: string;
  Sended: DWORD;  
begin
  if hFile = INVALID_HANDLE_VALUE then exit;
//  if (not thwr.Suspended) then exit;
  BufferWr := ToString(_Data);
  WriteFile(hFile, BufferWr[1], Length(BufferWr), Sended, @OvrWr);
  thwr.Resume;
end;

function THICOMEX.ExecuteRd;
var
  Signaled, BytesTrans, Err: DWORD;
  BufferRd: string;   
  FStat: TComStat1;
begin
  while not Sender.Terminated do
  begin
    WaitCommEvent(hFile, MaskRd, @OvrRd);
    Signaled := WaitForSingleObject(OvrRd.hEvent, INFINITE);
    if (Signaled = WAIT_OBJECT_0) then
    begin 
      if GetOverlappedResult(hFile, OvrRd, BytesTrans, True) then
      begin
        if ((MaskRd and EV_RXCHAR) <> 0) then
        begin
          if ClearCommError(hFile, Err, @FStat) then
          begin
            if (FStat.cbInQue <> 0) then
            begin
              SetLength(BufferRd, FStat.cbInQue);
              ReadFile(hFile, BufferRd[1], FStat.cbInQue, BytesTrans, @OvrRd);
              if GetOverlappedResult(hFile, OvrRd, BytesTrans, True) then
              begin
                ReadStr := BufferRd + #0;
                SetLength(ReadStr, BytesTrans);
                _hi_onEvent(_event_onRead, ReadStr);
                if Assigned(_event_onSyncRead.Event) then Sender.Synchronize(SyncExecRd); 
              end;
            end;
          end;  
        end
        else
          if Assigned(_event_onDSR.Event) or
             Assigned(_event_onCTS.Event) or
             Assigned(_event_onDCD.Event) or
             Assigned(_event_onRING.Event) then
            Sender.Synchronize(SyncExecSt);
      end;
    end;        
  end;
  PurgeComm(hFile, PURGE_RXCLEAR);
  Result := 0; 
end;

procedure THICOMEX.SyncExecRd;
begin
  _hi_onEvent(_event_onSyncRead, ReadStr);
end;

procedure THICOMEX.SyncExecSt;
var
  FModems: DWORD;
begin
  if GetCommModemStatus(hFile, FModems) then
    if ((MaskRd and EV_DSR) <> 0) then
      _hi_onEvent(_event_onDSR, integer((FModems and MS_DSR_ON) = MS_DSR_ON));
    if ((MaskRd and EV_CTS) <> 0) then
      _hi_onEvent(_event_onCTS, integer((FModems and MS_CTS_ON) = MS_CTS_ON));
    if ((MaskRd and EV_RLSD) <> 0) then
      _hi_onEvent(_event_onDCD, integer((FModems and MS_RLSD_ON) = MS_RLSD_ON));            
    if ((MaskRd and EV_RING) <> 0) then
      _hi_onEvent(_event_onRING, integer((FModems and MS_RING_ON) = MS_RING_ON));
end;

function THICOMEX.ExecuteWr(Sender: PThread): Integer;
var
  Sended, Signaled: DWORD;
begin
  while not Sender.Terminated do
  begin
    SendedWr := 0;
    Signaled := WaitForSingleObject(OvrWr.hEvent, 500);
    if (Signaled = WAIT_OBJECT_0) then
      if GetOverlappedResult(hFile, OvrWr, Sended, True) then
        SendedWr := integer(Sended);
    if Assigned(_event_onSyncWrite.Event) then Sender.Synchronize(SyncExecWr);     
    Sender.Suspend;
  end;
  PurgeComm(hFile, PURGE_TXCLEAR);
  Result := 0;
end;

procedure THICOMEX.SyncExecWr;
begin
  _hi_onEvent(_event_onSyncWrite, SendedWr);
end;

procedure THICOMEX._work_doDTR;
begin
  if hFile = INVALID_HANDLE_VALUE then exit;
  if ReadBool(_Data) then
    EscapeCommFunction(hFile, SETDTR)
  else
    EscapeCommFunction(hFile, CLRDTR);
end;

procedure THICOMEX._work_doRTS;
begin
  if hFile = INVALID_HANDLE_VALUE then exit;
  if ReadBool(_Data) then
    EscapeCommFunction(hFile, SETRTS)
  else
    EscapeCommFunction(hFile, CLRRTS);
end;

procedure THICOMEX._work_doSetComState;
begin
  if not SetCom(ReadInteger(_Data,_data_BaudRate,_prop_BaudRate),
                _nm[_prop_Parity + 1],
                Int2Str(_prop_DataBits + 7)[1],
                Int2Str(_prop_StopBits + 1)[1],
                Copy(dtrrts, _prop_DTR * 3 + 1, 3),
                Copy(dtrrts, _prop_RTS * 3 + 1, 3)) then
    _hi_onEvent(_event_onSetComState, 0)
  else
    _hi_onEvent(_event_onSetComState, 1);
end;

procedure THICOMEX._work_doDataBits;    
begin
  _prop_DataBits := ToInteger(_Data);
end;

procedure THICOMEX._work_doParity;    
begin
  _prop_Parity := ToInteger(_Data);
end;

procedure THICOMEX._work_doStopBits;
begin
  _prop_StopBits := ToInteger(_Data);
end;

end.

COMEX.ini

[About]
Version=1.10
Author=nesco
Mail=hiasm@mail.ru

[Type]
Class=Element
Info= COM 
Tab=Misc

[Property]
Port=м |4|0|Com1,Com2,Com3,Com4,Com5,Com6,Com7,Com8,Com9
BaudRate=BaudRate= |14|13|50,75,110,150,300,600,1200,1800,2000,2400,3600,4800,7200,9600,14400,19200,28800,38400,57600,115200,128000,256000
@DataBits=  |4|0|7,8
@Parity=м   |4|0|None,Odd,Even,Marker,Space
@StopBits=  |4|0|1,2
DTR=  DTR  м|4|0|off,on
RTS=  RTS  м|4|0|off,on

[Methods]
doOpen= |1|
doClose= |1|
doWrite=   |1|
*doRXClear=  RX |1|
*doDTR=/    DTR|1|
*doRTS=/    RTS|1|
*doSetComState= м    .      м|1|
onSyncWrite=      м м -  ,  - 0|2|
onRead=      м м   |2|
onSyncRead=      м м   |2|
*onDSR=   м    DSR,         м|2|
*onCTS=   м    CTS,         м|2|
*onDCD=   м    DCD,         м|2|
*onRING=   м    RI,         м|2|
*onSetComState=    м  (1 -  , 0 - )|2|
Port=м  ( 1  N)|4|1
BaudRate= |4|1








April 10th, 2014 7:20pm

ser2pl64. sys 3.3.2.102, 3.3.2.105 50-100
  • Edited by Andrej K_ Thursday, April 10, 2014 7:23 PM
Free Windows Admin Tool Kit Click here and download it now
April 10th, 2014 7:22pm

Worked, brilliant, thanks, you are a genius!!!!

phil

April 11th, 2014 11:58am

      
#ifndef __UNICODE__
#define __UNICODE__
#endif
#ifndef UNICODE
#define UNICODE
#endif
#ifndef _UNICODE
#define _UNICODE
#endif

#include <windows.h>
#include <stdio.h>


TCHAR * serial_port = L"COM1";


void SetDTR_HIGHprocedure(HANDLE hfile)
         { EscapeCommFunction(hfile,SETDTR);
         } 

void BlinkLED(HANDLE hfile)
{ while (TRUE){
    EscapeCommFunction(hfile,SETRTS);
    sleep(500);
    EscapeCommFunction(hfile,CLRRTS);
    sleep(500);
  }}

int main(int argc,char** argv)
{
  HANDLE hfile = CreateFile(serial_port ,GENERIC_READ |GENERIC_WRITE ,
               0,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
              
    if (hfile==INVALID_HANDLE_VALUE)
    {
  //    MessageBox(NULL,TEXT("Serial Port Does not Exist!"),TEXT("LED ON"),NULL);
      exit(0);
     }    
     SetDTR_HIGHprocedure(hfile);
     printf("SET DTR=1\n");
     printf("Blinking RTS\n");
     BlinkLED(hfile);      
     CloseHandle(hfile);
}

RTS blinking with a DTR , EscapeCommFunction(hfile,SETDTR)  error ;

after transfer 50 kb of data in SiMoCo transfer error rexpected (PL2303XA/HXA)

Free Windows Admin Tool Kit Click here and download it now
April 13th, 2014 11:52am

#include <windows.h>

LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam,
LPARAM lParam);

HDC dc;
HWND button1, button2, button3,button4;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpszCmdLine, int nCmdShow) {
WNDCLASS wc;
HWND hWnd;
MSG msg;
wc.style = CS_HREDRAW|CS_VREDRAW|CS_BYTEALIGNCLIENT;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = NULL;
wc.hCursor = LoadCursor(NULL,IDC_ARROW);
wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
/*(HBRUSH)(COLOR_WINDOW+1);*/
wc.lpszMenuName = NULL;
wc.lpszClassName = "ButtonExample";
RegisterClass(&wc);

hWnd = CreateWindow(wc.lpszClassName,"Switch 1.0",
WS_OVERLAPPEDWINDOW,100,100,600,90,
NULL,NULL,hInstance,NULL);

button1 =
CreateWindow("BUTTON","SET RTS",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
10,10,120,40,hWnd,NULL,hInstance,NULL);
button2 = CreateWindow("BUTTON","SET DTR",WS_CHILD |WS_VISIBLE|
BS_PUSHBUTTON,
140,10,120,40,hWnd,NULL,hInstance,NULL);
button3 = CreateWindow("BUTTON","ON",WS_CHILD |WS_VISIBLE|
BS_PUSHBUTTON,
270,10,120,40,hWnd,NULL,hInstance,NULL);
button4 = CreateWindow("BUTTON","OFF",WS_CHILD |WS_VISIBLE|
BS_PUSHBUTTON,
420,10,120,40,hWnd,NULL,hInstance,NULL);

ShowWindow(hWnd,nCmdShow);
UpdateWindow(hWnd);
while (GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam,
LPARAM lParam)
{
HANDLE hPort;
hPort =  CreateFile (TEXT("COM1"), GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, 0, NULL);

switch(uMsg)
{
case WM_COMMAND:
{
if ((HWND)lParam==button1) {
EscapeCommFunction (hPort, CLRDTR);
EscapeCommFunction (hPort, SETRTS);
MessageBox(hwnd,"CLR DTR,SET RTS"," ",MB_OK); };
if ((HWND)lParam==button2) {
EscapeCommFunction (hPort, CLRRTS);
EscapeCommFunction (hPort, SETDTR);
MessageBox(hwnd,"CLR RTS,SET DTR"," ",MB_OK); }
if ((HWND)lParam==button3) {
EscapeCommFunction (hPort, SETRTS);
EscapeCommFunction (hPort, SETDTR);
MessageBox(hwnd,"RTS,DTR ON","",MB_OK); }

if ((HWND)lParam==button4) {
EscapeCommFunction (hPort, CLRRTS);
EscapeCommFunction (hPort, CLRDTR);
MessageBox(hwnd,"CTS,DTR off","",MB_OK); }
return 0;
}

case WM_DESTROY:
{
PostQuitMessage(0);
break;
}
default:
{
return DefWindowProc(hwnd,uMsg,wParam,lParam);
}
}
CloseHandle (hPort);

return 0;
}

 

April 28th, 2014 4:23pm

м PL2303XA/HXA  ()      м м мм ( XON/XOFF, 20  ).

Free Windows Admin Tool Kit Click here and download it now
May 2nd, 2014 2:57pm

I think this is the simplest way that should make it work. I've tried this both in my Windows 7 and currently in my Windows 8.1.

1. download the driver version 3.3.11.152 in http://www.magicdriver.com/driver158759-ver_3.3.2.102.html ( although this is an old driver version, this works in most versions of Windows OS even the latest Windows 8.1 in my case )

2. Go to device manager, under Ports ( COM & LPT ) right click Prolific USB-to-Serial (COMx) then select Update driver software.

3. Browse for driver software on computer

4. Let me pick from a list of devices on my computer

5. Select Have Disk

6. On the bottom, Select Browse and then select location where you saved the driver for 3.3.11.152, you should be able to find ser2pl.

7. Open, then OK, then Next, then VOILA! it should be working now.

8. Scan hardware changes to verify.

Hopefully that solves it! Cheers!

August 28th, 2014 4:09pm

The solution Prolific an windows 8.1 pro 100% funcionally

https://drive.google.com/folderview?id=0B8zwqx9hJUKfUlN4ekZRcXYwNFk&usp=sharing

By Gustavo Motta

Free Windows Admin Tool Kit Click here and download it now
August 31st, 2014 5:00pm

I used this with a specialized prolific health care USB to Serial adapter - and was able to get this working with windows 8.1 (pro - 64bit).  Thanks for the file - just what I needed, and needed to know ;)
December 18th, 2014 6:53am

Thank you !

I have a DELL Tablet Venue Pro 64GB with windows 8.1 x32 installed on it

It's working for me but after a ** Restart ** .

Free Windows Admin Tool Kit Click here and download it now
April 20th, 2015 11:08am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics