cancelar
Mostrando resultados para 
Pesquisar então 
Você quer dizer: 

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
Mensagem 1 de 9
4.015Exibições
0 Kudos
Mensagem 2 de 9
4.014Exibições

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.

Mensagem 3 de 9
3.994Exibições
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
Mensagem 4 de 9
3.970Exibições
0 Kudos
Mensagem 5 de 9
3.969Exibições
If i don't forget something, this will work.
Mensagem 6 de 9
3.961Exibições
thanks..I wil try this example in my program
0 Kudos
Mensagem 7 de 9
3.937Exibições

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
Mensagem 8 de 9
3.898Exibições

My example was a demo.

I suppose you have modifie it.

Can you post your code, or a screenshoot ?

0 Kudos
Mensagem 9 de 9
3.890Exibições