Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RS232 Communication

Status
Not open for further replies.

Umbane

IS-IT--Management
Jul 20, 2000
44
0
0
ZA
Even though my question is VBA related, a VB front end will do. I have posted several times trying to find the right way to read data coming in on the RS232 port(eg. Com1) but have received little success. Can anyone help me with this problem.
I have an electronic scale that has an RS232 port on it. I have made up a serial cable according to the manufacturers spec's, and would like to see the data the scale is sending to the port. There are several ways in which to configure the scale in terms of when it will actually send the data. Currently I have set it so that it sends data when the scale stabilizes, 19200 baud rate, 7 Data bits, no parity and 1 Stop bit. From what I understand one should even be able to see the data coming in from within Hyperterminal, I have not been able to have success with this, so I tried using mscomm32 but have limited knowledge as to how to use this active-x component. Could someone please assist me in getting the active-x to communicate with the scale. Any help will be greatly appreciated.
PS The help file for the active-x has me totally confused, any help in the form of explanations would be greatly appreciated.

Regards

Umbane

m5gaut@mweb.co.za [sig][/sig]
 
Umbane,

Could you post the code that you are trying to monitor the the com port with? [sig]<p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>Making mistakes, so you don't have to. &lt;grin&gt;[/sig]
 
Umbane,

I have done many VB applications that communciate via the serial port (RS-232/Modbus, RS-485 ASCII).

The first thing you want to verify is - are you connecting with the correct cable and the correct settings. Check you Baud, Parity, Stop, etc.

Second you want to make sure you have the correct cable is the &quot;Scale&quot; you are trying to connect too a DTE or DCE device. That will determine if you need a Null Modem cable.

Next if the manufacture informs you that you should get information in hyper-terminal and you can not get any information you in most cases will not be able to write a VB application. Once you get Hyper-Terminal to receive information you can then write a VB application to manipulate the data.

Finally, If you get Hyper-Terminal to work, you should be able to throw together a quick VB application. Get the book &quot;Visual Basic Programmer's Guide to Serial Communications&quot; by Richard Grier. This book should lead you in the correct direction. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top