Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

vb com port settings

Posted on 2006-11-08
9
Medium Priority
?
178 Views
Last Modified: 2010-04-30
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?
0
Comment
Question by:jackjohnson44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 1000 total points
ID: 17900520
Are you using MSComm control?

There is a settings property

    ' Use COM1.
     MSComm1.CommPort = 1
     ' 9600 baud, no parity, 8 data, and 1 stop bit.
     MSComm1.Settings = "9600,N,8,1"
0
 

Author Comment

by:jackjohnson44
ID: 17900695
I am using those settings.

Check the control panel setting to see what I am talking about.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 17900820
What sort of flow control are you using? How are you servicing the VB buffers? Are you getting problems on both send and receive?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:jackjohnson44
ID: 17900945
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?
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 17901091
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
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 17913698
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
0
 

Author Comment

by:jackjohnson44
ID: 17914422
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.
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 17914483
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
0
 

Author Comment

by:jackjohnson44
ID: 17914529
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.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question