Shop OBEX P1 Docs P2 Docs Learn Events
BS2 to PocketPC solved — Parallax Forums

BS2 to PocketPC solved

ArchiverArchiver Posts: 46,084
edited 2001-02-27 10:15 in General Discussion
BS2 to PocketPC solved

I have been experimenting with connecting my BS2 to my Compaq Aero
2130 running WindowsCE 2.11. My first mistake was assuming I could
just connect the two female 9-pin connectors from the BS2 and the
PocketPC with a 9-pin MM gender changer, NOT! After a more careful
inspection I discovered the two connection were mirrored, Yikes!

Next, while the Comm ActiveX control for WindowsCE and the MSComm
control for Windows 98 are similar, the WindowsCE Comm control
requires some special handling.

The following code example shows how to receive data from a serial
connection using the Comm control on the PocketPC, one byte at a
time. Note Setting the value for the RThreshold property or the
SThreshold property to 0 prevents the OnComm event from initiating.

Private Sub Comm1_OnComm()

Dim TmpStr As String
Comm1.InputLen = 1
If Comm1.CommEvent = comEvReceive Then
While Comm1.InBufferCount > 0
TmpStr = TmpStr & Comm1.Input
Wend
Msgbox TmpStr,," The input buffer received:"
End If
End Sub

Private Sub Form_Load()

' 2600 baud, no parity, 8 data bits, 1 stop bit
Comm1.Settings = "9600,N,8,1"
Comm1.RThreshold = 1
Comm1.Sthreshold = 1

' Open the port
Comm1.PortOpen = True
End Sub
Sign In or Register to comment.