All Forums
 Microsoft Windows CE
 eVB Application Development
 Serial Port Communication
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

gma

1 Posts

Posted - 16 May 2003 :  07:55:09  Show Profile  Email Poster
i'm using the GM board and trying to make a little application with evb. the probleme is that i cant get anything on the port, sometimes a character but not what i 'm supposed to get.
Can i use this code ??
Dim nIndex As Integer
Dim nType As Integer
Dim nBarCodeSize As Integer
Dim sText As String
On Error Resume Next

nIndex = cmbPort.ListIndex
If nIndex > -1 Then
nIndex = cmbPort.ItemData(nIndex)
End If
commCtrl.CommPort = nIndex
sText = cmbSpeed.Text
commCtrl.Settings = sText & ", N, 8, 1"
commCtrl.Handshaking = 2
commCtrl.PortOpen = True
If commCtrl.PortOpen = False Then
MsgBox "Unable to open COM " & nIndex
Exit Sub
End If

'sText = Chr(27) & Chr(40) & Chr(3) & Chr(10) & Chr(17) & Chr(2) & "@ABCDE" & Chr(10) & Chr(27) & "m" & Chr(10)
'commCtrl.Output = sText

sText = EscapeCommand(PRINTER_ESCAPE_RESET)
If chkSmallfont.Value <> 0 Then
nBarCodeSize = 2
sText = sText & Chr(IFCOM_FONT_SMALL) & txtSmallfont.Text & Chr(IFCOM_LINE_FEED)
commCtrl.Output = sText
sText = ""
End If
If chkNormalFont.Value <> 0 Then
nBarCodeSize = 3
sText = sText & Chr(IFCOM_FONT_NORMAL) & txtNormalFont.Text & Chr(IFCOM_LINE_FEED)
commCtrl.Output = sText
sText = ""
End If

Another problem is that i get garbage at boot time on com ports.
As i'm trying to use a printer on it, it's a big problem.
Can i use mscomm or not ?

ctacke

877 Posts

Posted - 28 May 2003 :  17:46:42  Show Profile  Email Poster
The eVB Comm control works just fine through eVB. I put together a quick sample showing how to send and receive serial data and posted it at Topic 962. Try testing it with Hyperterminal on your PC.
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.03 seconds. Snitz Forums 2000