0

I'm trying to get the input of a 3g modem when it receives sms.

This is the code I'm using to trap any incoming sms.

Private Sub MSComm1_OnComm()
   Select Case MSComm1.CommEvent
      Case comEvReceive
         Do While MSComm1.InBufferCount > 0
            strInput = strInput & MSComm1.Input
         Loop

         Sheets("Sheet1").Range("A1").Text = strInput
   End Select
End Sub

Regardless the code, the event does not fire as if nothing is received.

What do I miss here?

Thank u.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
user3286479
  • 415
  • 3
  • 15
  • 26
  • Is your `InBufferCount` <= 0? Are you sure `MSComm1.InBufferCount` is populating correctly? – TempleGuard527 Aug 13 '18 at 18:18
  • As I said.. the event does not trigger regardless the code.. assume that the code is 100% correct, the problem is that the MSComm does not feel that something is received by the modem. – user3286479 Aug 13 '18 at 18:24
  • I found that in another thread.. In order for the OnComm event to fire, you need to set RThreshold and SThreshold to 1. So how to implement that? – user3286479 Aug 13 '18 at 20:28
  • page 338? https://www.8051projects.net/files/public/1189441710_383_FT2138_vbcom.pdf – Marcucciboy2 Aug 13 '18 at 20:43
  • thank u. I know how to write this. I only can't understand where to put it in the code. – user3286479 Aug 13 '18 at 20:46

0 Answers0