Skip to content

brunomsantiago/py_opcda_datalogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple OPC DA Datalogger (alfa)

Simply desktop application to collect and record sensor values from an OPC DA server.

1) How to use

Demonstraion

  • Run gui.py
  • Choose and connect to an OPC DA server
  • Choose which tags you want to record
  • Click o Start Logging

2) Installation

2.1) Python depedencies

  • Python 2.7. - I prefer using Python 3, however the OpenOPC library requires Python 2. I installed using conda
  • Pywin32 - I installed using conda
  • OpenOPC - Theoretically it is avaiable o PyPi, but the installation using 'pip install OpenOPC' didn't worked for me. I had to cloning the repository and install it using 'pip install .'
  • Pyside and Qt4 - I installed using conda.

Note: For personal use I usually choose pyqt5, however for this little project I wanted to more permissive license.

2.2) OPC DLL-module

The OpenOPC library need a registred OPC DLL-module to work (the original from OPC Foundation or any of the OPC vendors). The easiest way is to download the Graybox OPC DA Auto Wrapper is a DLL-module and follow the vende instructions:

  • download Graybox OPC DA Auto Wrapper;
  • unzip the archive;
  • copy gbda_aut.dll to Windows\System32 folder;
  • register this module - enter regsvr32 gbda_aut.dll in the command line.

Notes:

  • OPC DA is very tied to Microsoft DCOM technology. So unfortunally this software is Windows only.
  • It requires administrative permissions to register the DLL-module.
  • Graybox allow free distribution of its dll, so it is also avaiable in this repository.

2.3) OPC server

To use this Datalogger it is necessary to have a running OPC Server, either a real one from a SCADA System or a Simulation Server. The develpment was done using Matrikon Simulation Server.

3) Motivation

I've written this software in my free time for personal use, specially to get better understand of OPC Classic.

However it might be useful for other people, so I decided tho share.

I don't intend to maintain in the long term nor give support.

I know OPC Classic and COM/DCOM are ancient and odd technology. I prefer OPC UA much more. However I still need to use and test OPC classic sometimes.

4) License

I intend my own code to have the MIT License, however I haven't checked license compatibility with any of dependecies yet.

5) Next steps

5.1) Soon

The software is working, however it very limited on options (I disabled them on the graphical interface).

It is also missing docstrings and unit tests.

I intend to work on these soon and maybe refactor some portions of the code and improve the graphical interface style.

5.2) Maybe one day

I also would like to improve two things about this software, but don't know how to do.

  • Make it portable with Nuikta
  • Use timestamps with milliseconds precision (other OPC DA clients have this feature).
  • Use the dll without registering thus not needing administrative permission.

Contibutions are very welcome.

About

Simple OPC DA Datalogger

Resources

License

Stars

Watchers

Forks

Languages