Microsoft KB Archive/209077

= PRB: CommCtl: No "OK" Received When Using Some Modems =

Article ID: 209077

Article Last Modified on 10/20/2003

-

APPLIES TO


 * Microsoft eMbedded Visual Basic 3.0
 * Microsoft Windows CE Toolkit for Visual Basic 6.0

-



This article was previously published under Q209077



SYMPTOMS
Some modems may not respond with an OK in the Input string of the Communications control when an AT command has been sent.



CAUSE
Modems may not respond if the Data Terminal Ready (DTR) signal is low. You may need to raise the DTR signal before opening the Communications port.

Note that the Communication control only checks the DTREnable property when the port is being opened. If the DTREnable property is set to True after opening the port, the DTR signal does not change until the port is closed and reopened.



RESOLUTION
To get the modem to respond with an OK, set the DTREnable property of the Communication control to True prior to opening the communications port.

NOTE: This will not necessarily work for all modems.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Create a new Windows CE project in either Visual Basic or eMbedded Visual Basic. Form1 is created by default. From the Project menu, choose Components. In the Components dialog box, click the Controls tab, then select the Microsoft CE Comm Control. Place a command button (named Command1), a text box (named Text1) and a Comm control (named Comm1) on Form1.  Paste the following code into Form1: Option Explicit Dim InBuff

Private Sub Comm1_OnComm If Comm1.CommEvent = comEvReceive Then InBuff = InBuff & Comm1.Input Text1.Text = InBuff End If  End Sub

Private Sub Command1_Click Comm1.RTSEnable = True Comm1.Settings = "9600,n,8,1" Comm1.RThreshold = 1 Comm1.SThreshold = 1 Comm1.CommPort = 2 Comm1.PortOpen = True Comm1.Output = "AT" & vbCrLf End Sub

Private Sub Form_Unload(Cancel As Integer) Comm1.PortOpen = False End Sub  Run the project on the device.</li></ol>

RESULTS: The OK does not come back from the modem.

<div class="references_section">