Solved

Need a way to count coin drops (pulses) being recieved through serial port com 2

Posted on 2000-05-11
5
332 Views
Last Modified: 2013-11-25
Trying to get or write visual basic code that willrecognise and count coin drops (pulses) being recieved through serial port com 2.
Open to suggestions and or any solution...
0
Comment
Question by:dansvb
5 Comments
 
LVL 2

Expert Comment

by:BobbyOwens
ID: 2801451
Have you tried adding "Microsoft Comm Control" to your project. You should be able to monitor the Comm port. Just choose the comm port settings then put code in the oncomm event. Heres and example:

The following example shows how to handle communications errors and events. You can insert code after each related Case statement, to handle a particular error or event.

Private Sub MSComm_OnComm ()
   Select Case MSComm1.CommEvent
   ' Handle each event or error by placing
   ' code below each case statement

   ' Errors
      Case comEventBreak   ' A Break was received.
      Case comEventFrame   ' Framing Error
      Case comEventOverrun   ' Data Lost.
      Case comEventRxOver   ' Receive buffer overflow.
      Case comEventRxParity   ' Parity Error.
      Case comEventTxFull   ' Transmit buffer full.
      Case comEventDCB   ' Unexpected error retrieving DCB]

   ' Events
      Case comEvCD   ' Change in the CD line.
      Case comEvCTS   ' Change in the CTS line.
      Case comEvDSR   ' Change in the DSR line.
      Case comEvRing   ' Change in the Ring Indicator.
      Case comEvReceive   ' Received RThreshold # of
                        ' chars.
      Case comEvSend   ' There are SThreshold number of
                     ' characters in the transmit
                     ' buffer.
      Case comEvEof   ' An EOF charater was found in
                     ' the input stream
   End Select
End Sub

0
 
LVL 9

Expert Comment

by:GivenRandy
ID: 2801456
Can you provide more information.  As BobbyOwens shows, it is easy to add MSComm (done it hundreds of times).  We would need to see some sort of protocol and settings.  For example, what kind of data do you receive (e.g., "N" for nickel, etc.) or is it just signals?  What are the settings (e.g., 9600 bps, etc.).
0
 
LVL 9

Expert Comment

by:GivenRandy
ID: 2801510
Can you provide more information.  As BobbyOwens shows, it is easy to add MSComm (done it hundreds of times).  We would need to see some sort of protocol and settings.  For example, what kind of data do you receive (e.g., "N" for nickel, etc.) or is it just signals?  What are the settings (e.g., 9600 bps, etc.).
0
 

Author Comment

by:dansvb
ID: 2806892
Will get you more info Monday...  Thanks for fast response...
0
 
LVL 1

Accepted Solution

by:
csameer1 earned 100 total points
ID: 2843593
Remember that the rs232 port lines are at +/- 12V .You can connect the DSR or CTS lines to your input.

You just have to check the line status as follows

if MsComm1.CTSHolding = true then....

if MsComm1.DTRHolding = true then....

I have use this method to signal a UPS low battery indicator.I am not sure how fast you can count.If you need more speed use Parallel Port.

Let me know if uyou need more info
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now