LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

gsm modem not displaying data

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.

0 Kudos
Message 1 of 12
(3,710 Views)

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?

0 Kudos
Message 2 of 12
(3,702 Views)

hi, i changed the program but it's still unable to work.

0 Kudos
Message 3 of 12
(3,692 Views)

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.

0 Kudos
Message 4 of 12
(3,674 Views)

anybody please help? Thank you very much

0 Kudos
Message 5 of 12
(3,633 Views)

That's more of a question for the modem manufacturer rather than a LabVIEW question.

0 Kudos
Message 6 of 12
(3,627 Views)

but when i concatenate the strings together, it should be running both commands right?

0 Kudos
Message 7 of 12
(3,620 Views)

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"

0 Kudos
Message 8 of 12
(3,612 Views)

Hi, can u show me some examples how to send the commands separately with time delay. Thanks

0 Kudos
Message 9 of 12
(3,474 Views)

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?

0 Kudos
Message 10 of 12
(3,461 Views)