Device drivers

X

Thread Starter

Xu Weijie

Hi,
I want to know how to write a device driver that reads the PLC's values and auto sends a email in cases of emergencies


Thanks and Regards,
Xu Weijie
 
S
I'm not sure how to write the driver that can do this, but there are off the shelf products that can do what you are looking for and more. Iconics offers a software package that can email you, page you, call your cell, etc. You can
get information on their product at "http://www.iconics.com":http://www.iconics.com
hope this helps
 
I don't know how you would start writing a driver for it but I once got a piece of software where I could read values from data tables in a PLC5 into VB, try searching along those lines and modify the code such that when your values are too high or too low you receive an email.

If that fails InTouch offer a package called SCADA Alarm, where alarms can be sent via SMS (text message) to a mobile phone, they may also do via email.

Hope this helps.
John!
[email protected]
 
G

Greg Goodman

A typical approach is to divide this into separate programs that perform discrete functions. If a program can be found that already performs one or the other of the functions, then you only have to write half as
much. Also typical is making the programs configuration-driven, so that they can be deployed in different (but similar) circumstances without the need to change the code.

In this case, I would suggest the following division of functionality:

1. protocol driver (reads the PLC's values)
2. auto-mailer (sends email in case of emergency)

The programs talk to one another using whatever inter-process communications mechanism is supported on your platform that you can
easily handle. (On Unix/Linux, you might use sockets, or fifos, or shared memory. On Windows, you might choose DDE.)

The protocol driver implements the communications with the PLC, and must be configured (or hard-coded) with:

a. the I/O channel parameters necessary to establish communications

(ex: for serial comm: which serial port, baud, parity, data/stop bits)

b. the device addressing necessary to and memory addresses to be collected

(ex: PLC node address, register numbers or point names)

c. how often to poll for data

The auto-mailer (alarm event handler) needs to communicate with the driver in such a way that it gets informed of the alarm conditions it cares about, or gets informed of any event that may be an alarm condition, and determines whether or not each event does, in fact, warrant an emergency response (email).

The auto-mailer gets configured (or hard-coded) with:

a. some notion of what constitutes an alarm condition for the various
monitored values, and

b. what to do in the event of an alarm

(i.e. what message to send, what email address to send it to)

If you're working in a Windows world, you may find the problem half-solved or mostly-solved for you. A communications program that implements your PLC's protocol and serves point values to DDE clients is probably readily available (if not actually free). A program that registers interest in DDE items, tracks value changes, and emails when a value exceeds a limit (or satisfies some other alarm condition) can easily be written in VB.

The Unix/Linux world offers similar approaches that generally cost less and are more flexible, but require a greater degree of programming skill
to put together.

And, as has been noted in prior responses, most commercial SCADA packages with decent alarm handling can do all of this easily, if not necessarily cheaply.

If you need specific advice in finding/building a particular protocol and/or sending email programatically, follow-up to the list and indicate what PLC protocol and operating system you're using.


Hope that helps,

Greg Goodman
Chiron Consulting
 
Greg Goodman:
> A program that registers interest in DDE items, tracks value changes, and
> emails when a value exceeds a limit (or satisfies some other alarm
> condition) can easily be written in VB.

> The Unix/Linux world offers similar approaches that generally cost less
> and are more flexible, but require a greater degree of programming skill
> to put together.

Not really - not that much difference between programming in VB and programming in Python or similar.

(Perl is traditional but impenetrable. Avoid.)

> If you need specific advice in finding/building a particular protocol
> and/or sending email programatically, follow-up to the list and indicate
> what PLC protocol and operating system you're using.

Seconded.

Jiri
--
Jiri Baum <[email protected]> http://www.csse.monash.edu.au/~jirib
MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools
 
S

Sandeep Shroff

You will require following things to develop a driver.
1) The specification of the protocol for which you want to develop a driver.
2) The Physical layer know how of the device to which you would like to interface through PC.
3) Identify the Operating system for which you want to do so ( PC end).
4) Identify the language in which you are comfortable doing coding. (Please note the language you use should support hardware interfacing as well as TCP/IP stack. as this is your requirement)

Depending upon all this factor you can choose between C, VC++, VB or JAVA.

Sandeep Shroff
 
Top