COM Communication Problems [Resolved]
Hello everyone,
I will start by saying that I have no background programming with VB 6.0. To make a long story short, I have been trying to upgrade a VB program (written by someone no longer employed here) from 16-bit to 32-bit. Finally, with the help of a very nice guy named Keith, I have the program running on an XP machine!!!!
Anyway, the program is designed to communicate with a balance (or scale) through the serial port. I have the baud rate, parity, stop & data bits set up properly within the windows device manager. But the program will not communicate with the balance. When the user wants to capture data from the balance they press a "weigh" button within the VB program and the balance responds with the current weight displayed on the balance.
I am able to communicate with the balance via a hyperterminal connection with the settings listed below.
Baud = 2400
Parity = Even
Stop Bits = 1
Data Bits = 7
Flow Control = None
Emulation = Auto Detect
Backscroll buffer lines = 500
Send line ends with line feed (checked)
Echo typed characters locally (checked)
Force incoming data to 7 bits ASCII (checked)
Wrap lines that exceed terminal width (checked)
All I know about the balance interface is that in order to receive information from the balance you must send the character 'S' and the balance will return a string that must be parsed.
I will post some code in a .txt file below. If you need any other code, please let me know! Any help would be appreciated.
Re: COM Communication Problems
Re: COM Communication Problems
I read the article, I don't understand much of it, but research doesn't bother me). The only problem the link to the complete document is broken :sick: But thanks for the link!
Re: COM Communication Problems
Someone sent me that link a long time ago. I never used it, but it looks promising. I was able to read the page just fine. Which part is broken?
Re: COM Communication Problems
At the top is says
Download the author's complete paper, "LabView Peeking and Poking Using Windows NT,"
The link for the complete paper is broken (It's a zipped word document).
Do you know why the conversion from 16-bit to 32-bit would cause the interface to stop working?
Re: COM Communication Problems
Presumably, you can go out and download the shareware TVic component. I was thinking this may help you communicate with serial ports.
Re: COM Communication Problems
I was able to solve "part" of the balance problem. I had to modify the parameters of the MSComm control (using the telephone icon within the object window). Apparently the VB settings are independant of the global windows settings. I can see that the balance is responding with the appropriate information (the display flashes when the information is sent) but the weight is not being displayed in the VB program. The program just waits???
I don't know if the program is having problems interpreting the information sent, or is just not displaying it in the correct place.
I am posting the entire program code below. Any help would be appreciated.
Thank You.
Re: COM Communication Problems
There is no code. Also, does the scale output text, or is it in some other format. It should be the same as it was before, so if you could post both sets of code, or at least the part of the old program that displayed info, we may be able to help you.
Re: COM Communication Problems
I was able to get the program working!!! Thank you to everyone for their help. I would not have been able to get it working if it wasn't for everyone's help! I contaced the manufacture of the balance and they told me that one of my buffer settings were incorrect. I changed this within the VB MSComm properties window and Viola....I works!!
Thanks Again!