Link to home
Start Free TrialLog in
Avatar of mcgilvra
mcgilvra

asked on

VB6 MSCOMM Control Problem in Win7 machine

Hi,
I wrote a serial communications program, named serialComm, in VB6 using the MSCOMM control.  serialComm is intended to talk to an external device, call it PLC.  The RS232 port is made with a USB/RS232 converter.

My machine is running Windows 7.  serialComm works fine on my machine, both from within VB6, and when I run the installed one outside of VB6.  But when I sent it to my customer and they installed it on their Win7 machine it does not work.  Their machine does not have VB6 installed.

The customer is using the very same USB/RS232 converter and they can communicate with the PLC via Hyperterminal.  When they run serialComm, the proper port opens and all looks good but there is simply no response from the PLC.  

We checked the RS232 transmit line (pin 3 of the 9-pin D is Tx from the PC) and when the command is sent we get a single 70 micro-second wide pulse.  It should be several bit transitions because we are sending about 9 characters.  We also checked the receive line to be sure and there was nothing on it, just flat lined.

Not sure if it matters but both machines have .NET  v4.0.30319 on them.

Any insight into this problem would be greatly appreciated.  Thank you.
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Did you use an installation tool, such as the package and deployment wizard?
That should ensure that any support files are installed and registered correctly..
Avatar of mcgilvra
mcgilvra

ASKER

Yes, we used the P&D wizard.
Windows 7 32bit or 64bit?
64 bit on both machines.
When using the Package and Deployment Wizard included with VB6, the installer calls the 64bit version of the REGSVR (by default) to register your 32bit OCX.  (It does not know about the 32bit version in the windows\syswow64 folder because it predates VB6)

Try this.

cd \windows\syswow64
regsvr32 c:\yourOCXpath\yourOCXfilename.ocx  

http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/1f00d6cc-00a9-4ca0-9698-535e2487af31/

In the future, I would suggest you try INNO Setup for your future distro's.. It's FREE and supports the VB6 - Windows 7

http://www.jrsoftware.org/isinfo.php
Ok, we tried it and it said it registered successfully but it does not help.  We still can't get any communications.
Which USB/RS232 converter are you using?
Both machines using identical USB/RS232 device.  Device works fine on both machines when using Hyperterminal and other apps.
Driver: Prolific PL2303, problem machine is V1.7, my (good) machine is v1.2
mcgilvra,

I have been using Keyspan Serial Adapters on Win7 64bit machines to connect to digital LED displays on our shop floor for over a year now with no problems..  (sample code/settings provided)  Do you get any error messages? Anything in the Event Logs of target machine?  Do you have to use certain settings with your device (baud rate , parity etc.) Can you write a small debug/test program to see if and where the VB code fails?

User generated image
ASKER CERTIFIED SOLUTION
Avatar of mcgilvra
mcgilvra

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm glad you found the problem and I agree, Prolific is hurting themselves.  Many companies that have tried to 'control' their markets have gone out of business, put there by the companies that let people use their products as they needed and wanted.
No expert pointed to the solution of using the alternate FTDI-chipset.  I found that on my own.