Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MSCOMM, OnComm doesn't happen in response to a command?

0 views
Skip to first unread message

rcu...@my-deja.com

unread,
Apr 30, 2000, 3:00:00 AM4/30/00
to
I have a device (optical mark reader) that sends data spontaneously
when you scan a card. It also returns data to some commands.

I wrote a bunch of code in OnComm to handle both types of events. But
it seems OnComm only happens when the data is generated remotely. When
I issue a command, the return value is available in MSComm1.Input. But
the OnComm event never happens. The settings are identical in both the
case where OnComm is generated, and where it isn't.

(RThreshold=1 is the main relevant setting I think. I don't use
handshaking, because none is recommended


Sent via Deja.com http://www.deja.com/
Before you buy.

Richard Grier

unread,
May 1, 2000, 3:00:00 AM5/1/00
to
Hi,

Is your remote device echoing your command? If so, then OnComm receive
events will be generated. However, if you not actually connect to the
remote device (the serial connection is "floating") for some reason, such as
incorrect cabling, then you may see data that you have attempted to send as
receive data. However, these are artifacts, not actual data. You should
not see transmitted data when you use the Input property unless the remote
echoes it.

I'd have to see your actual code (and, in some cases only hands-on work with
the hardware leads to the solution) to see if there is something there.

Do you have a copy of my book (see below). It has lots of working code
examples that might be of help, along with information on cabling and
debugging. Your setting of RThreshold = 1 is correct.

--
Richard Grier
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO 80228
303-986-2179 (voice)
303-986-3143 (fax)
Leave voice mail or fax that I can receive as email at 303-593-9315
Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
Edition ISBN 1-890422-25-8 (355 pages).
For information look on my homepage at http://www.hardandsoftware.net.
Use the Books link to order. For faster service contact the publisher at
http://www.mabry.com.

0 new messages