...
OPC (http://en.wikipedia.org/wiki/OLE_for_process_control) is a an industry standard to allow a unified access to a varied number of devices, be it controller of any kind, sensors, whatever. Many specialized hardware components have their own OPC Server (e.g. WinCC, ABB, ...), but there are quite a few implementors which provide generic "OPC servers" which provide access to devices via a wealth of protocols. Prominent examples are Matrikon (http://www.matrikonopc.de/opc-server/) or Software Toolbox's TOP Server (http://www.toolboxopc.com/index.html).
...
- Windows computer to install the OPC Server (note that Home Editions of Windows might not work due to restrictions on the Windows operating system)
- on the development computer a functional JDK (6 or 7)
- on the development computer a running Eclipse 3.x 5+ or 4.x
Setting up TOP Server
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
Mai 15, 2013 4:31:30 PM rpc.DefaultConnection processOutgoing INFO: Sending REQUEST Mai 15, 2013 4:31:30 PM rpc.DefaultConnection processIncoming INFO: Recieved RESPONSE <<< Value: [[org.jinterop.dcom.core.JIUnsignedInteger@6f14021e]], Timestamp: Mi Mai 15 16:31:30 MESZ 2013, Quality: 192, ErrorCode: 00000000 / value = 0 Mai 15, 2013 4:31:30 PM rpc.DefaultConnection processOutgoing INFO: Sending REQUEST Mai 15, 2013 4:31:30 PM rpc.DefaultConnection processIncoming INFO: Recieved RESPONSE <<< Value: [[org.jinterop.dcom.core.JIUnsignedInteger@15de3027]], Timestamp: Mi Mai 15 16:31:30 MESZ 2013, Quality: 192, ErrorCode: 00000000 / value = 0 >>> writing value 1 Mai 15, 2013 4:31:31 PM rpc.DefaultConnection processOutgoing INFO: Sending REQUEST Mai 15, 2013 4:31:31 PM rpc.DefaultConnection processIncoming INFO: Recieved RESPONSE Mai 15, 2013 4:31:31 PM rpc.DefaultConnection processOutgoing INFO: Sending REQUEST Mai 15, 2013 4:31:31 PM rpc.DefaultConnection processIncoming INFO: Recieved RESPONSE <<< Value: [[org.jinterop.dcom.core.JIUnsignedInteger@69d5ee81]], Timestamp: Mi Mai 15 16:31:30 MESZ 2013, Quality: 192, ErrorCode: 00000000 / value = 0 Mai 15, 2013 4:31:31 PM rpc.DefaultConnection processOutgoing INFO: Sending REQUEST Mai 15, 2013 4:31:31 PM rpc.DefaultConnection processIncoming INFO: Recieved RESPONSE <<< Value: [[org.jinterop.dcom.core.JIUnsignedInteger@2a4c6a7d]], Timestamp: Mi Mai 15 16:31:31 MESZ 2013, Quality: 192, ErrorCode: 00000000 / value = 1 Mai 15, 2013 4:31:32 PM rpc.DefaultConnection processOutgoing INFO: Sending REQUEST Mai 15, 2013 4:31:32 PM rpc.DefaultConnection processIncoming INFO: Recieved RESPONSE <<< Value: [[org.jinterop.dcom.core.JIUnsignedInteger@17f99aa6]], Timestamp: Mi Mai 15 16:31:31 MESZ 2013, Quality: 192, ErrorCode: 00000000 / value = 1 |
Thats it, pretty much.
Other tutorials
...
Unfortunately, this is in many cases not enough. In this example there is no error handling, and this is quite needed. Within the "OPC Driver" of the openSCADA project, all this stuff is handled for you. So please feel free to peruse the code to get a feel how it works: https://github.com/ctron/org.openscada.atlantis/tree/1.0/org.openscada.da.server.opc/src/org/openscada/da/server/opc
Other tutorials
If you have a tutorial and want to be linked here, please drop us a line.