12-15-2013 11:04 PM
hi. i done a program for gsm modem to receive and delete messages. But when i run continuously the entire message can't be display until i press the button "highlight execution". Anybody know what's the problem? Thank You.
12-15-2013 11:31 PM
You don't need to reinitialized the serial port every iteration of the while loop.
You don't need to set the End Mode for Writes before every VISA Write. You probably don't ever need to set it at all.
Move those things outside the while loop.
Beyond that, I don't know why you'd need use highlight execution, unless your equipment can't respond that quickly with commands, or the 50 msec wait between writes and reads isn't fast enough for the to instrument to create a response thus yielding zero bytes at port then nothing to read in the VISA Read.
Fix the earlier things I said. Then try to have a longer wait between the Write and the Read.
Does your device send a termination character? You disabled it with your Serial Initialization. But the format of your Write commands putting one on the end usually means the device will responde with one. If the device does send a termination character, then enable it. Get rid of Bytes at Port and read a sufficiently large number of bytes on the VISA Read.
Why do you do the first VISA write in the loop if you never do anything with the data that you get back from its VISA Read?
12-15-2013 11:54 PM
hi, i changed the program but it's still unable to work.
12-16-2013 01:33 AM
may i also know how can i delete all the messages stored. As there's not AT command that i can delete all so i tried to concatenate the strings together but it only delete the first message which is AT+CMGD=1.
12-17-2013 06:56 PM
anybody please help? Thank you very much
12-17-2013 07:11 PM
That's more of a question for the modem manufacturer rather than a LabVIEW question.
12-17-2013 07:24 PM
but when i concatenate the strings together, it should be running both commands right?
12-17-2013 07:52 PM
Not necessarily.
1. Depending on the device, if you pound it too rapidly with commands, it might miss the second command, or even miss both.
2. Your concatenation isn't quite the same. You are ending a command with a carriage return. Then you are sending the next command and sending it with a "platform dependent end-of-line constant" which could be a carriage return, a line feed, or a carriage return and a line feed together.
Try sending the commands separately with some amount of delay between them. And be sure you are using the correct termination character for the command.
"Read the Manual"
12-25-2013 09:00 PM
Hi, can u show me some examples how to send the commands separately with time delay. Thanks
12-25-2013 10:59 PM - edited 12-25-2013 11:10 PM
hi i tried this but still not able to delete the second message. Only the first message is being deleted. how can i add a time delay to this?