[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

VB6 - RS485 Communcations

Posted on 2000-05-09
4
Medium Priority
?
1,354 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 100 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

650 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