ONSMS - ENVIAR MENSAJE

Hola muy buenas,
Me gustaría hacer una pruebas de envío de mensajes mediante la función ONSMS, pero no entiendo nada de Basic IDE.
Mi pregunta es, en que línea debo especificar el número telefónico?
Muchas gracias, por su colaboración.
Espero su pronta respuesta :wink:

Summary

ONSMS “Goto HSms”
HSms:
a% = Getsys Prg,“SmsRead”
If (a%<>0) Then
f$ = Getsys Prg,“smsfrom”
a$ = Getsys Prg,“smsmsg”
SETSYS PRG,“RESUMENEXT”,1
ALMACK a$,""
e% = Getsys Prg,“LSTERR”
IF e% = -1 Then
LOGEVENT "Acknowledge of alarm " + a$ + " by GSM number: " + f$, 120
Else
IF e% = 4 Then
LOGEVENT “Alarm acknowledge failed because specified Tag is unknown (SMS Content:” + a$ + " , SMS Nr: " + f$ + “)”, 120
Else
LOGEVENT "Alarm acknowledge failed. (SMS Content: " + a$ + " , SMS Nr: " + f$ + “)”, 120
Endif
Endif
SETSYS PRG,“LSTERR”,-1
SETSYS PRG,“RESUMENEXT”,0
Goto HSms
Endif
End

Hello,

I think that you’re confusing the SendSMS function with the OnSMS function. SendSMS can be used to send messages, and OnSMS is something that is called when the device receives a message.

Below is an example that goes over sending out emails (and text messages if you use an email to sms relay). This is done using the sendmail function, but you could modify it so that it uses the se

Sending Emails with a Flexy.docx (433.3 KB)

If you want to use the sendsms function, you can use the doc below for the syntax required. see page 9

Tim, i send messages without Basic IDE of right way.
I need to know if it is possible with the eWON to make sequences in the sending of alarms, that is, send the alarm to the first contact and if this does not confirm reception, send the next one and so on until someone confirms.
I don´t know Basic IDE, if someone explain with a example

You could do something like this with the TSET timers and an ONSMS function. You could make it so that if the tag goes into the alarm state that it starts a function in BASIC. Once that function starts you could do something like OnSMS where if the Flexy receives a text message then it will acknowledge the alarm, and if it doesn’t then you could have the timer trigger the Flexy to send out another email.

For something like this we could offer developing the code as a paid service, or if you want to develop it yourself and ask us questions we could do that as well.

This service is more expensive or no?

In this language what is the Switch case? I can’t identificate in documentation.
This language have a switch case?

I’m not sure what the rates are, but if you’d like for us to write the code for you, then you can reach out to us-services@hms.se with a short description on what you’d like the code to do and get a quote from somebody in sales.

As for the switch condition, I don’t think we have something like that in BASIC but I would probably end up doing something equivalent with if statements

I did exactly what you are looking for.
Alarm que was done in the PLC.
PLC sets a bit in the PLC with the alarm.
Lets say Alarm1.
Then sets Alarm1_1
Alarm1_1 EWON sends a SMS to Ph No 1
If the Ph No 1 user does not acknowledge the alarm within set time.
Resets Alarm1_1 and Sets Alarm 1_2
Alarm1_2 EWON sends a SMS to Ph No 2
If the Ph No 2 user does not acknowledge the alarm within set time.
Resets Alarm1_2 and Sets Alarm 1_3
Alarm1_3 EWON sends a SMS to Ph No 3
And the pattern continues.
Are you using a PLC for this?
I have the code written in Schneider Unity.
Can help you further if you are interested.

I have a question, how do I do so that when the message arrives on my mobile, the Ewon finds out that it has been read

I don’t believe the eWON has any way to find out that your phone received a message, but if you have your phone return a message to the eWON you could do an OnSMS function

A question, the message that I wrote on the mobile and sent to Ewon can be, for example “Hello” or “OK” ??? Because the OnSMS function does not catch me and I have the function that I shared at the beginning of the post on

What kind of SIM card are you using and does that SIM card have the ability to send/receive text messages or is it just a data SIM card?

I don’t know, but the Jazztel have charged me for sending messages to Ewon, because I’ve been doing tests. There are also several Ewons from various facilities that I want to do the same to.

I can assure you 100% that it has the ability to send text messages, and if it has 100% ability to send, shouldn’t it be the same to receive?

I would think that should be the case. If you can send from the SIM card, you should be able to receive. Is the carrier Jazztel?

Is this a 3G or 4G connection

Most Ewons have 4g cards, although some still have 3g ones

Which of these cards are the devices using? Standard NA, Verizon, or EU? If it’s in the EU we might need to involve some colleagues in that region to see if they can replicate the issue.

You should be able to go to the debug here though and turn this on, and then be able to see some data show up in the real-time logs when you send a text message to the device

Can you tell me what brand PLC you use to monitor alarms.
I have the PLC program and the Script for EWON to do exactly what you need to do.
As I explained earlier,
When Alarm 1 occurs in the PLC.
It sets M11.
When M11 is on EWON send a SMS to Mobile Phone 1
SMS says Alarm1_1 and SMS 111 to Acknowledge.
If EWON receives 111 within set time,
EWON sends a SMS back to Mobile Phone 1 saying Alarm1_1 Acknowledged.
At the same time sends Value 111 to PLC in Alarm Ack Register MW1 to reset M11.
If the Alarm was not acknowledged by the Mobile Phone 1 within set time,
PLC resets M11 and set M12
When M12 is on EWON send a SMS to Mobile Phone 2
And this pattern continues to Phone 3-5
Hope you understand this concept.

I need activate error debug no?

To see data coming in from the phone, you’ll need to enable debug mode

In this image, i send in my mobile “Gracias” and he put “Gracias”, but have and a error, in the line of Almack, this code is one example of this page. What does bad do?

Ewon SMS Reception