Solved

VB6 - RS485 Communcations

Posted on 2000-05-09
4
1,268 Views
Last Modified: 2010-07-27
Upgrading a VB6 project from 16 bit to 32 bit.  This program will be used on NT machines(32-bit) as well as Windows 95/98.

Old program used the RS232 serial communications where no hardware handshaking took place, ie. RTS line not toggled.

The 32 bit needs to use the RS485 serial communications protocol where RTS line must be toggled, ie. hardware output buffer (UART) needs to be monitored in order to know when to toggle the RTS line.

Is there a way to check and see when the UART buffer has been emptied?  It is my understanding that the OutputBufferCount property only moniters the software's output buffer, not hardware.
0
Comment
Question by:bmoser
[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
  • 2
4 Comments
 
LVL 32

Expert Comment

by:Erick37
ID: 2792977
From Help:

"Setting the SThreshold property to 1 causes the MSComm control to generate the OnComm event when the transmit buffer is completely empty."

Private Sub MSComm_OnComm ()
   Select Case MSComm1.CommEvent
   ...
   Case comEvSend
      'Fired when buffer is empty (SThreshold = 1)
   'Other useful events:
   Case comEvCD 'Change in the CD line.
   Case comEvCTS 'Change in the CTS line.
   Case comEvDSR 'Change in the DSR line.
     
   End Select
End Sub
0
 

Author Comment

by:bmoser
ID: 2792980
Edited text of question.
0
 
LVL 9

Expert Comment

by:GivenRandy
ID: 2793150
If you use the MSComm control, it will handle handshaking.  For more detail see "Serial Port Complete":

http://www.amazon.com/exec/obidos/ASIN/0965081923/randygivennancyg/002-9129594-2973007

We have done RS-485 / 422 and RS-232 written in VB.  For quick-fixes of some legacy code, we have used existing RS-232 code with RS-485 adapters (no software changes!):

http://www.bb-elec.com/product.asp?dept%5Fid=3&sku=485DRJ 
0
 
LVL 9

Accepted Solution

by:
GivenRandy earned 50 total points
ID: 2949538
If you use the MSComm control, it will handle handshaking.  For more detail see "Serial Port Complete":

http://www.amazon.com/exec/obidos/ASIN/0965081923/randygivennancyg/002-9129594-2973007 

We have done RS-485 / 422 and RS-232 written in VB.  For quick-fixes of some legacy code, we have used existing RS-232 code with RS-485 adapters (no software changes!):

http://www.bb-elec.com/product.asp?dept%5Fid=3&sku=485DRJ 
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Prevent user closing word document opened with VB6 6 88
TT Auto Dashboard 13 104
Macro problems with Excel file 6 52
Get the Y value of a line at X in a chart in VBA 28 73
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

734 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