OPC+SMS
This program is developed by
Alexander Pradidenko,
Odessa
,
Ukraine
.
Contacts:
slowray@gmail.com, bringit2prad@hotmail.com.
Program allows to get tag values
from any OPC DA server ver.2 and to
send SMS alert in case of spillover of
pre-defined limits.
Mobile phone is connected to PC
via special cable. Not all phones are good to be used by program as well as not
all cables. Some program functions depend on phone’s capabilities.
Cable has to be connected to COM port or has to be present in system
as COM port if connected to USB:
Connection via USB-to-Serial is
preferable because battery is charged using USB power.
I test cable Siemens DCA 510 (supported phones A60,
A62, A65, AX72, AX75, C55, C65, CFX65, CT65, CX65, CXT65, C60, C62, CF62, CX70,
CXT70, CX75, CF75, C72, C75…).
Nokia cable DKU-5 (phones models 6020, 6110, 6220, 6100, 6230, 6020)
also are good.
Preparations.
This program requires MS Framework 3.5 installed on computer.
It can be freely downloaded from internet.
In order to connect to OPC server
program requires OPCDAAuto.dll in
C:\WINDOWS\system32. I’m not sure do I can to supply it to user freely so I not
include it to package. But you can found it in internet, put to
C:\WINDOWS\system32 directory and register it in system (button Start- Run…-
regsvr32 opcdaauto.dll – OK). Or maybe you already have it in your system since
you have OPC server.
Install needed driver for your
cable. Connect cable to PC and to mobile phone.
Working.
Run a program. Appears window like
this:
Press “Find Phone and Connect” button.
Program will execute phone search and connect to it. In case of some
difficulties you can connect manually. Specify port number, baud rate and press “Test”.
If all is OK you will get notification “Successfully
connected to phone”. Now you can press “OK”and main window will opens. If you have no
phone you can play with program by pressing “Continue with no phone” button.
Main window
As I suppose most of things here
no need to explain. So only few explanations.
Settings
Go to “Settings” tab. Here you have to specify computer name and OPC
server name (for example OPCServer.WinCC for connect
to WinCC; OPC.SimaticHMI.PTPro for connect to ProTool etc.).
“CompName”
is local or remote computer name.
You can get list of all available
OPC servers on local computer by clicking to appropriate button.
Other settings have no effect.
Don’t forgot to press “Save”.
In order to connect to remote OPC
server it’s needed to adjust DCOM settings. Please refer for this to internet.
Tags and alarms
For editing tag names,
conditions, messages click to “Stop scan and Edit” button. This button changes
to “Save
changes and start scanning”. Now you can edit the grid content.
Don’t use first row. Number
of rows is limited by 250.
Add new notification in last line
marked by asterisk “*”.
There is following cells:
-“Enable”. Check/uncheck cell to enable/disable event.
-“AlarmTag”. Type here tag names.
-“CurrentValue”. Here will appear tag’s
values after connection to OPC server.
-“Condition”. Type here conditions of notifications. There is allowed “<”, “<=”,
“>”, “>=”, “!=” (not equal), “==” (equal) for
numeric tags and “==true”, “==false” for Boolean tags. Some examples are
presented on picture.
-“Message”. Type here a message that you want to be send to when condition becomes true.
- “Recipient1”…”Recipient5”. Type here phone numbers of SMS recipients.
-“INFO”. Here you can see error if some occurs.
It is also possible to put
process values into SMS. To do this type #Variable_name#
in SMS text and this will be replaced by current value of Variable_name.
For example type “Pressure in
tank is too high. Now pressure = #Pressure_tank_1# bar.” in message field.
Recipient will get a message “Pressure in tank is too high. Now pressure = 35.4
bar.” where 35.4 is current value of Pressure_tank_1 tag.
When you fill all lines in the
grid as needs, press “Save changes and start scan” (known bug: sometimes changes are not accepted).
If you want to delete a row,
click on its left part. It becomes blue. Press “Delete” key on keyboard. Row must disappear.
Now you can connect to OPC by
pressing to “Connect
to OPC Server” button. Now you can observe tag’s current values if
there no errors in computer name, server name etc.
After any change of tag names you
do need to not only save changes but also press to “Connect to OPC Server” button.
Known bug: disconnection from OPC
not functionate properly.
“Value
on demand”.
It is possible to get tags
current values on demand via SMS. Client has to compose SMS containing tags
names and send it to phone connected to computer. Phone connected to computer
receive this SMS and then check do sender’s phone number is presented in Address Book or not (add allowed clients in Address Book tab). Only recipients presented in Address
Book will receive feedback answer. For example user composes
SMS like “Temperature_1 Temperature_2 Pressure_Tank1” and send it to
OPC+SMS phone. Program receives this SMS and check do sender’s phone number is
presented in Address Book or not. If yes, program send back SMS to initiator
containing text “Temperature_1=58,4 Temperature_2=28,9
Pressure_Tank1=35,4” with added date and time of SMS creation.
Computer
control via SMS.
There are some possibilities to
control computer via SMS.
Send SMS with “Computer Restart” text to restart computer, “Computer Shutdown” to shut down computer, “OPC+SMS Shutdown” for close OPC+SMS application. Of
course sender has to be presented in Address Book.
Now you can minimize program to
tray and wait for SMS.
Copyright © Alexander Pradidenko
|