Serial input not working well with HP IPAQ 212

irb4

New Member
Guys

I used a sample code of Basic4PPC, serialTerminal.bpb, to display serial input:

B4X:
Sub Globals
   port = 4
   bitRate = 3
   Dim bitRates(0)
   bitRates() = Array(300,1200,4800,9600,115200)
End Sub

Sub App_Start
   Form1.Show
   For i = 1 To 8
      AddEvent("mnuPort" & i, Click, "mnuPorts_Click")
   Next
   For i = 0 To 4
      AddEvent ("mnuBit" & i, Click, "mnuBits_Click")
   Next
   serial.New1
End Sub

Sub Serial_OnCom 'Fires whenever the EnableOnComm is true and there is communication
   TextBox1.Text = TextBox1.Text & serial.InputString
End Sub

Sub mnuPorts_Click 'Handles mnuPort 1 - 8 click event
   Control("mnuPort" & port).Checked = false
   Sender.Checked = true
   port = StrAt(Sender.Text,3)
End Sub

Sub mnuBits_Click 'Handles mnuBit0-4 click event
   Control("mnuBit" & bitRate).Checked = false
   Sender.Checked = true
   bitRate = StrAt(Sender.Name,6)
End Sub


Sub mnuOpen_Click
   If serial.PortOpen = true Then 'close port
      serial.PortOpen = false
      Sender.Text = "Open Port"
   Else
      serial.CommPort = port
      serial.BitRate = bitRates(bitRate)
      serial.PortOpen = true
      Sender.Text = "Close Port"
   End If
End Sub

Sub btnReceive_Click
   If serial.PortOpen = true Then TextBox1.Text = TextBox1.Text & serial.InputString
End Sub

Sub btnSend_Click
   If serial.PortOpen = true Then serial.Output(textBox1.Text)
End Sub

Sub chkOnCom_Click
   serial.EnableOnComm = chkOnCom.Checked
End Sub

Sub Form1_Close
   If serial.PortOpen = true Then serial.PortOpen = false
End Sub

Load the code up to my HP IPAQ 212 with Windows Mobile 6. Use a Ratoc CF serial card "http://www.ratocsystems.com/english/products/CF60U.html"

I am expecting this string:

B4X:
2008 09 11 18 36 48   -15.5    59.2    99.1  25.5  25.5  25.5  27  27  26 100   77.6   0.8   0.4  2.1  0.0  0.0  25.64  0.000  0.000  14.2   1.0    4.0  27  28  27
But instead I get strings that are shortened intermitently like this:
"http://www.geocities.com/bubul_26/serial.jpg"


B4X:
2008 09 11 21 14 48    51  25.5 28  26 1 0.0  1.9      0.2   1.027

2008 09 11 21 15 03   -708  25.5    26 100.0  2.3      0.0   1.0  

2008 09 11 21 15 13  -1085.5  25.   80.8  0.3  0.00    0.  4.0  26  27  27

2008 09 11 21 15 18   -171  25.5 27  26 1 0.0  1.00    0.  4.0  26  28  26

2008 09 11 18 36 48   -15.5    59.2    99.1  25.5  25.5  25.5  27  27  26 100   77.6   0.8   0.4  2.1  0.0  0.0  25.64  0.000    

0.000  14.2   1.0    4.0  27  28  25
.
.
.

The code works fine with HP IPAQ HX2490 (Windows Mobile 5) and Ratoc serial CF card. But how come this went kaput with IPAQ 212 (WM 6)? :sign0148:

Did I forgot to load some library or something? Or likely is it the Ratoc CF serial card problem?

Thanks guys!
 

Erel

Administrator
Staff member
Licensed User
Please check the .Net version on your device by choosing File - Help - About.
 

irb4

New Member
I browse to File Explorer > My Device | Windows and click the executable cgacutil.

The version is:

Microsoft .NET Compact Framework [2.0.7045.0] :sign0087:
 

irb4

New Member
I forgot to mention that this hyperterminal program "http://www.cam.com/vxhpc.html" can receive all the data strings properly in IPAQ 212. :confused:
 

Erel

Administrator
Staff member
Licensed User
Are you using Serial2.dll or SerialDevice.dll?
You should use Serial2.dll.
 

Erel

Administrator
Staff member
Licensed User
Are you using the OnCom event to receive the data?
Disable this event, and try to receive the data by pressing on the appropriate button.
 
Top