101501-565 Rev C
Page 7 of 58
4.1 RS-232
The RS-232 interface makes use of a standard ‘command/response’
communications protocol. See section 6.0 for the syntax of the serial
interface protocol.
All software that addresses the RS-232 interface must adhere to the
following parameters:
A Baud rate of 115.2K bps
No
Parity
8 Data Bits
1 Stop Bit
No
handshaking
4.1.1 Enabling Communications Objects in Visual Basic for RS-232
Communications in Microsoft Visual Basic 6.0 are directed to a control
that abstracts the port. In the case of serial we need Microsoft Comm
Control 6.0. To enable this in your VB 6 project, go to:
Project -> Components
Then in the list make sure that Microsoft Comm Control 6.0 has a
check next to it. The Comm Control Object should then appear in your
toolbox. It will have an icon of a telephone and will be named:
MSComm. This can be dragged and dropped into your application.
You will then need to set the object’s properties.
4.1.2 Configuring
Communications in Visual Basic for RS-232
In order to configure the MSComm Object, first you must initialize it
in the Object properties:
Settings
115200,n,8,1
Handshaking
0
–
comNone
The application can be set to either default to a specific COM Port
or the End User can be allowed to choose one for the particular PC.
For the “Default” scenario, include the following commands in the
Form_Load() routine:
MSComm1.CommPort
=
portNumber
MSComm1.PortOpen = True
For the “Choice” scenario, place the above two commands in a
selectable menu item.