Hi,
Sow i can not store the sms full received pdu array as var word and then compar it with IF...THEN... ?
Im very new at all this can you please give me a example sow i can see how to do?
Thanks
Hi,
Sow i can not store the sms full received pdu array as var word and then compar it with IF...THEN... ?
Im very new at all this can you please give me a example sow i can see how to do?
Thanks
Last edited by camolas; - 7th July 2008 at 19:17.
You ca store in an array of bytes whatever you want, but cannot do this if myarray="1234567890" then do that.
You have to do a nested if-then comparison like that:
if myarray[1]="1" then
if myarray[2]="2" then
if myarray[3]="3" then
....
if myarray[0]="0" then
goto success
endif
....
endif
endif
endif
no_success:
success:
Of course this can be done with a for-next loop more elegant, but for the sake of simplicity I left it like that.
Ioannis
Hi,
Thanks for caring one more timesow i need:
...............
myarray var byte
...........
...........
Loop:
HSEROUT ["AT+CMGR=1",13,10]
Pause 1000
Hserin 6000,loop,[STR myarray]
if myarray[1]="1" then
if myarray[2]="2" then
if myarray[3]="3" then
....
if myarray[0]="0" then
goto success
endif
....
endif
endif
endif
no_success:
success:
Is ok the code?
Thanks
No. You need array not byte variable. Read the Manual. I am not going to teach you the abc's of PBP! That is what YOU have to do! Sorry...
I wrote on a previous post that you have to read back what the module is responding. By waiting 1 sec. I am sure, don't know about you, that you are quaranteed to lose data. Wait for the OK and read immediately.
The above was an example! You have to complete the puzzle...
No, I don't think is 100% OK, as I don't know PDU as I stated before and the example I gave has nothing to do with PDU that needs to be decoded first.
Last, you are welcome, but please, read, read, read the PBP manual as to how the compiler is used. Blink a LED and then try this hardcore stuff...
Ioannis
Hi,
I think the array is now ok
..........
..........
myarray var byte[48] 'My array is made i think
..........
..........
Loop:
HSEROUT ["AT+CMGR=1",13,10]
HSERIN 5000, Loop,[WAIT("OK")]
if myarray[0]="0" then
if myarray[1]="1" then
..................... ' from 0 to 47
.....................
if myarray[46]="46" then
if myarray[47]="47" then
goto success
endif
endif
................... ' from 0 to 47
...................
endif
endif
no_success:
Goto Loop
success:
High PortD.2
End
Please give me your input thanks.
Last edited by camolas; - 8th July 2008 at 00:49.
OK. That is an improovment!
I don't like the loop with Hserin. If you have to do other things and the data arrived are not good, it will stuck in the loop. You must have a way out and do some other checks if you need to execute tasks in the mean time.
Ioannis
Bookmarks