Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

UDPOpen in listening data fail and block after some seconds


Je2f Mar 24, 2017 09:31 AM

Hi,

I have a UDP problem, i hope someone can help me.

I have a CR310 connected to a sierra wireless modem RV50 by ethernet and i would like to use the UDP link to send and receive SMS. I have use this small program to test the UDP connection with the modem RV50:

Public con_status_modem As Long,con_sms_recv As Long,con_sms_send as Long
Public TrameModem as string * 150,sLigneSMS as string * 200

Public sendmessage As Boolean

'Main Program
BeginProg
  sendmessage = false
 
    Scan (1,Sec,0,0)
      Dim NBytesReturned,NBytesReturnedModem
      
      'Ouverture des ports reseau
    con_sms_recv = UDPOpen("",54321,1024,0)' Connexion pour la reception de SMS
    con_sms_send = UDPOpen("192.168.13.31",54322,1024,0) ' Connexion pour l'envoi de SMS
    con_status_modem = UDPOpen("",54323,256,0)' Connexion pour la recuperation des donnees du modem
 
    SerialInRecord (con_sms_recv,sLigneSMS,&H3C3C,0,&H3E3E,NBytesReturned,01)
    SerialInRecord (con_status_modem,TrameModem,&H0133,0,&HF201,NBytesReturnedModem,01)
    
    If sendmessage Then
      SerialOut (con_sms_send,"<<336XXXXXXXX,ASCII,12,54657374206d657373616765>>","",0,0)
      sendmessage = false
    EndIf

    NextScan
EndProg

After few seconds, the con_sms_recv return 0 and no more UDP listening connection come back.

This will not append to the con_status_modem because i receive continue data (every 15sec) on this socket.

Did you have an idea on this problem?

Log in or register to post/reply in the forum.