LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read GSM modem

Hi. I need some help here..I have a program that use to read all the inbox message in the GSM simcard. GSM modem is connected to the pc serial com port. I used AT command AT+CMGL="REC UNREAD" to read the unread messages in the inbox. Between VISA write and VISA read, I put some delay which is 450ms. So far this is the suitable delay to get a complete data from the serial. Before this is used less that 450ms, and the number of incomplete data that I read from the serial port is high. But even though I used 450ms, sometimes I still cannot read a complete data. When i try read the serial port using the hyperterminal, I never get incomplete data. All the data are completed data. I wondering, is there any delay used in the hyperterminal? Why when I access the serial port using VISA write/read and hyperterminal I will get a different result?How can I make my program read the complete data as a hyperterminal? Is it about the delay? Please assist me..I may need an advice from you...thanks
0 Kudos
Message 1 of 9
(3,906 Views)
0 Kudos
Message 2 of 9
(3,905 Views)

You use a time delay. When that time has expired, you read the data even if not all data have been received from modem.

Hyperterminal uses no delay. When a character comes , it is been displayed.

 

Solution : Do not use time delay, use termination character, line feed.

Message 3 of 9
(3,885 Views)
sorry..can you give me an example to use the termination character, line feed?..I do not know how to use it in my program. I am worried that if I didn't use time delay, I might cannot process the data.
0 Kudos
Message 4 of 9
(3,861 Views)
0 Kudos
Message 5 of 9
(3,860 Views)
If i don't forget something, this will work.
Message 6 of 9
(3,852 Views)
thanks..I wil try this example in my program
0 Kudos
Message 7 of 9
(3,828 Views)

hi Pnt,

 

I have try your example. I let my programming running for a whole day in order to read the messages received. But sometimes there will be an error occured. Sorry I forgot to save the error messages so that u can identify what's the problem.  

0 Kudos
Message 8 of 9
(3,789 Views)

My example was a demo.

I suppose you have modifie it.

Can you post your code, or a screenshoot ?

0 Kudos
Message 9 of 9
(3,781 Views)