Link to home
Start Free TrialLog in
Avatar of jackjohnson44
jackjohnson44

asked on

vb com port settings

I am writing a vb application that uses com ports.
For some reason I get some errors when I run it.
Not vb errors, but I was getting the wrong responses from the device
I was talking to.

When I go to my control panel->System->device manager->Com Port->Port Settings->Advanced
Then I slide the 2 sliders all the way to the left the program works.

Is there any way to make this setting programmatically?
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

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
Avatar of jackjohnson44
jackjohnson44

ASKER

I am using those settings.

Check the control panel setting to see what I am talking about.
What sort of flow control are you using? How are you servicing the VB buffers? Are you getting problems on both send and receive?
The problem only happens after running it a few hundred times.

I am not getting errors, I ask it a question and it gives me strange responses.

Either way, the setting seems to work.

Any idea how to change this setting programmatically?
Sorry, No. I guess that you might be able to use use a driver API, but I'm not into it.

This may help you to get an overview.

http://www.wd-3.com/archive/SerialAttachedDevices.htm
The data may not come back in one shot. You need to read all data to determine whether the data is received

Show us your MSComm1_OnComm() routine
I am specifically asking how to programmatically set the slider that I mention above.

Please do not give alternatives, it is too late to change code.
I think the problem lies on your MSComm1_OnComm() routine. When you increase to highest performance means you will get all data back in one shot. Which implies you do not handle received data correctly
That is not the problem, the problem seems to be that my computer is not sending the commands exactly when I want, I think it might save them up sometimes.  If I send one command, I might have to wait to send the next.  I think they are both being sent really close together and my wait is being ignored. The machine I talk to gets confised.  Reguardless of the problem, the way I got around it was playing with this setting.  It has already been tested and agreed upon.  Instead of putting it in the release notes, I want to set it myself.  This is the only thing I am interested in.  Thanks for your help, but I am only looking to change this setting.