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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSComm Control - Interfacing with External Advice

Status
Not open for further replies.

Uniquex

Programmer
Dec 16, 2002
15
SG
Hi people,

This is the first time I am attempting to communicate through the com port. Thus I will need some advice on it.

Scenario :
I need to communicate with an external cashcard reader device through the serial port.
The program used by the external cashcard reader to interface with my com port would be written by another programmer using assembly language.
On my part, I need to send and receive strings to/from the serial port.
I will be using the MsComm Control to do it.

I have already read up quite a bit on my part and I already know i have to convert my strings to byte array before sending it.( thanks to help from fellow VB programmers :)

Questions/Problems now:

- do I need to know anything about the external reader device to write the program?
e.g. baud rate, parity..etc if Yes, what exactly do I need to know?

- I am pretty confused about the properties and Settings to use about the MsComm Control.
e.g. hand shaking, RThreshold, DTR/RTS¡­etc
I have read up on them but I am not sure on whether/how should I use them in my situation.

- There is the part about the receiving my bytes through a buffer and about it overflowing. How should I do it?

- Any general advice regarding the needs/preference for communicating effectively with the reader

I am not trying to be lazy here and not test the above myself, problem is I do not have access to the external cashcard reader device and I really am inexperienced in this.
I am suppose to write the program out before I pass it to the programmer who will take care of the external device part.

Plus I cannot seem to find any examples on the internet that communicates with a device similar to what I need, mostly are modems which seem very different from what I need.

Please understand.

Any form of help would be very much appreciated.
Thank you all in advance !

Uniquex
 
One question at at time.

1. Yes, you absolutely need to know the following details
about the reader:

o Baud Rate
o # of data bits, # of stop bits, # of parity bits
(It's almost always 8 data, 1 stop bit, no parity.)
o Handshaking protocol

Until you know these, you can't communicate with the
reader.

2. On almost all WINDOWS computers, their is a free
serial communications program called HYPERTERMINAL.
(It's usually found under :
START|PROGRAMS|ACCESSORIES|COMMUNICATIONS.)

Using a serial cable (PC-to-modem, not a null modem)
to connect your PC to the reader, verify if you can
receive messages from the reader.

Once you're successful, write back!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top