Jump to content

SMS SCAN reads always the same SMS over and over again


Recommended Posts

The goal is to request the PLC status by SMS. I would like to send SMS request  e.g. 'status' and want to receive  e.g. 'OK'. I defined the incoming message in the SMS CONFIG FB,  enabled the Scan option and set the Receive bit operand. When the 'status' received, the SMS SCAN FB sets the Receive bit and then the PLC sends back the 'OK' and resets the Receive bit. BUT the 'status' SMS remains in the modem, and the SMS SCAN FB reads it in every next cycle and sets the Receive bit again and again.  I couldn't find any possibility to delete received SMSs from the modem.

Could you help me, pls?

Link to comment
Share on other sites

  • MVP 2023

In Com Initialaze screen you can see Clear SIM check box.

It looks like disconnect and connect to modem via active this check box - initiate SMS delete option.

You can  do com init, wait for SMS - send OK and disconnect for some time. After reconnect SMS message may be cleared.

Link to comment
Share on other sites

1 hour ago, kratmel said:

In Com Initialaze screen you can see Clear SIM check box.

It looks like disconnect and connect to modem via active this check box - initiate SMS delete option.

You can  do com init, wait for SMS - send OK and disconnect for some time. After reconnect SMS message may be cleared.

Thank you for the answer...I found this way...it is the only one working solution, but it is just a workaroud IMHO.  The modem initialization takes about 10-15 secs and deletes all received SMS, not just the 'read' ones.

Link to comment
Share on other sites

1 hour ago, Gabriel Franco said:

1. Make sure the module where is located your code is being always called.

2. Try using SCAN FB using SB80 instead MB3900:

image.png.98d8259ca31e18a059443982461ce20d.png

3. Check modem busy befoire sending, also reset SMS send status bit and SMS send fail bitmap before sending:

image.png.b3d42858a604408873341952c9d3629d.png

 

 

Thank you for the answer.

1) the module is called in every program cycle

2) I think, that the SCAN FB should be used with the user defined MB Modem Busy(in my case MB3900), because it is directly bound to the SMS CONFIG FB and reflects the modem status(busy, idle), in other words, it says if I can use the modem or must wait for it's idle state. The SB80 only says, if the modem was initialized but nothing about it's usability. 

3) I will try it and let you know the result

Link to comment
Share on other sites

  • MVP 2023
2 hours ago, mydlochu said:

deletes all received SMS, not just the 'read' ones.

I do not know how you send test SMS to PLC.

In one of my project i use incremented number after "status" message.

Something like password001 - PLC send back password002..... I send this password002 to PLC - answer: password003 ect.

In this way only different message is stored into modem And i only copy message from PLC for check status -no need to type new one. 

Yes all message  is cleared after comm restart. But i always know last number and can send bigger one

Link to comment
Share on other sites

I finally found the solution.

The SMS SCAN FB doesn't set the Modem Busy flag, that is user defined MB operand(in my case MB3900). I was counting on this flag.

The solution is to wait a little while after the SCAN sets the incoming SMS Receive bit. Now I run the timer and wait for 4 secs and then send the response SMS.

In the PLC's 'Information mode' screen(touch and hold the screen for 5 secs), then press Serial/Monitor...here you can seen the AT command that the PLC sends to the modem.

 

My PLC is Vision V700

Thank you all for help!

SMS_Ladder03.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.