Updating Phone Numbers on Mikrodev Device through SCADA

From Mikrodev Documentation
Jump to navigation Jump to search

By using Mikrodev devices, you can send and receive SMS messages(with non-pp* firmwares). The content of the messages and phone numbers are stored in string registers of PLC device. And these strings are configured in PLC project on "string tables".

Sometimes you may want to view and update the phone number for SMS messages through your SCADA system. The following example illustrates how you can achieve this.

Storing the Phone Number[edit | edit source]

Since industrial protocols like Modbus only supports numeric data types, you need to store a numeric version of your phone number. And since a single "Long register" is not enough for storing a phone number, this can be done by using "2 Long Registers". You can divide the phone number into 2 parts and write and read these numbers through these registers. But of course; you will also need to convert these "2 Long Registers" containing the phone number parts into a single "String Register". And copy that register into the "phone number input" of SMS block.

mikrodiagram_appnote1_1.png


In the "StringManipulation Block" you need to select "ToString" function and write it into a string register, i.e "index 2".


mikrodiagram_appnote1_5.png

Formatting the Phone Number[edit | edit source]

In our example; we are using 10th and 11th String indexes as the format input of the phone number parts:

mikrodiagram_appnote1_4.png

You should take care of these formats and actual phone number parts. They should be in accordance with each other. That means;

If your phone number is like: +905556008899, your configuration will be something like that:

Content of 10th string index: "+90%04s"

Here"%04s" means prepend leading zeros up to 4 digits to your number.

Content of 11th string index: "%06s"

Here"%06s" means prepend leading zeros up to 6 digits to your number.

So if your first long register contains "5556" and second long register contains "8899" these numbers will merged into "+905556008899" by using these formatting rules.

mikrodiagram_appnote1_2.png

In the "StringManipulation" block below, you should select "Append" operation and copy the result into a string register i.e "index 1"

mikrodiagram_appnote1_6.png

Running the Logic[edit | edit source]

After configuring your "phone number string" mechanism, you just need to connect that string into the SMS block and write "1" into the "trigger" register.

mikrodiagram_appnote1_3.png

View and Update on SCADA[edit | edit source]

On the SCADA side; you can display "2 Long Registers" in two different components and an apply button for triggering the "trigger" register int the PLC project. The only drawback here is that the user should use the same number of characters as indicated in the format strings in PLC project.

Download the sample PLC project from here

*non-pp firmware: There are 2 types of firmware , default one and the one with point to point networking stack for 3G connection. With point to point firmware you will have higher download/upload speed but no sms or call functionality.