OpenOPC
=======
OpenOPC for Python 3.7+ is a descendent of http://openopc.sourceforge.net
with modifications for Python 3 and distutils.
About OpenOPC
-------------------
OpenOPC for Python is a free, open source OPC (OLE for Process Control)
toolkit designed for use with the popular Python programming language.
Software Developers
-------------------
If you elected to install the OpenOPC Development library during the
installation process, then you'll need to also download and install
the following packages in order to develop your own Python programs
which use the OpenOPC library:
1. Python 3.7+
https://www.python.org/download/
2. Python for Windows Extensions (pywin32)
https://github.com/mhammond/pywin32
3. Pyro5
https://github.com/irmen/Pyro5
Of course, Python is necessary on all platforms. However the other
packages may be optional depending on your configuration:
1. Win32 platform, using the OpenOPC Gateway Service
Pywin32: optional
Pyro5: required
2. Win32 platform, talking to OPC Servers directly using COM/DCOM
Pywin32: required
Pyro5: optional
3. Non-Windows platform (use of Gateway Service is mandatory)
Pywin32: not applicable
Pyro5: required
In order to get the most from the OpenOPC package, Windows developers
are encouraged to install both Pywin32 and Pyro. Using Pyro to talk to
the Gateway Service provides a quick and easy method for bypassing the
DCOM security nightmares which are all too common when using OPC.
Documentation
-------------
A PDF manual for OpenOPC is included in this installation inside the
"doc" folder. Users are encouraged to also look at the OpenOPC web
site for additional usage examples that may not be contained in the
manual.
EXAMPLE - Minimal working program::
import OpenOPC
opc = OpenOPC.client()
opc.connect('Matrikon.OPC.Simulation')
print(opc['Square Waves.Real8'])
opc.close()
OpenOPC Command-line Client
---------------------------
OpenOPC includes the only publically available command-line OPC client.
Unlike graphical clients, it can be easily used in scripts or batch files.
And because of its piping capability (i.e. chaining commands together),
it is far more powerful than other OPC clients
1. Get a listing of the available OPC servers on your computer by
going to the command prompt and entering::
opc -q
2. Set your prefered OPC server as the default by setting the system
wide enviornment variable OPC_SERVER. (On Windows you can do this
by going to Control Panel > System > Advanced > Environment Variables)::
OPC_SERVER=Matrikon.OPC.Simulation
3. Display OPC server information via the Win32 COM connection::
opc -i
4. Test to see if the OpenOPC Gateway Service is functioning by
entering::
opc -m open -i
5. Test some of the other commands available using the OPC Command
Line Client. To get started, try entering the opc command without
any arguments in order to see the help page::
opc
To read an item from your OPC server, just include the item name as
one of your arguments. For example, if you're using Matrikon's
Simulation server you could do::
opc Random.Int4
To read items from a specific OPC server you have installed,
include the -s switch followed by the OPC server name. For
example::
opc -s Matrikon.OPC.Simulation Random.Int4
To list available items::
C:\> opc -f Random.*Int*
Random.Int1
Random.Int2
Random.Int4
Random.UInt1
Random.UInt2
Random.UInt4
To read values of items every 60 seconds, logging the results to a file
until stopped by Ctrl-C...::
C:\> opc Random.Int4 Random.Real8 -L 60 >data.log
Command usage summary::
C:\> opc
OpenOPC Command Line Client 1.1.6
Copyright (c) 2007-2008 Barry Barnreiter (barry_b@users.sourceforge.net)
Usage: opc [OPTIONS] [ACTION] [ITEM|PATH...]
Actions:
-r, --read Read ITEM values (default action)
-w, --write Write values to ITEMs (use ITEM=VALUE)
-p, --properties View properties of ITEMs
-l, --list List items at specified PATHs (tree browser)
-f, --flat List all ITEM names (flat browser)
-i, --info Display OPC server information
-q, --servers Query list of available OPC servers
-S, --sessions List sessions in OpenOPC Gateway Service
Options:
-m MODE, --mode=MODE Protocol MODE (dcom, open) (default: OPC_MODE)
-C CLASS,--class=CLASS OPC Automation CLASS (default: OPC_CLASS)
-n NAME, --name=NAME Set OPC Client NAME (default: OPC_CLIENT)
-h HOST, --host=HOST DCOM OPC HOST (default: OPC_HOST)
-s SERV, --server=SERVER DCOM OPC SERVER (default: OPC_SERVER)
-H HOST, --gate-host=HOST OpenOPC Gateway HOST (default: OPC_GATE_HOST)
-P PORT, --gate-port=PORT OpenOPC Gateway PORT (default: OPC_GATE_PORT)
-F FUNC, --function=FUNC Read FUNCTION to use (sync, async)
-c SRC, --source=SOURCE Set data SOURCE for reads (cache, device, hybrid)
-g SIZE, --size=SIZE Group tags into SIZE items per transaction
-z MSEC, --pause=MSEC Sleep MSEC milliseconds between transactions
-u MSEC, --update=MSEC Set update rate for group to MSEC milliseconds
-t MSEC, --timeout=MSEC Set read timeout to MSEC mulliseconds
-o FMT, --output=FORMAT Output FORMAT (table, values, pairs, csv, html)
-L SEC, --repeat=SEC Loop ACTION every SEC seconds until stopped
-y ID, --id=ID,... Retrieve only specific Property IDs
-a STR, --append=STR,... Append STRINGS to each input item name
-x N --rotate=N Rotate output orientation in groups of N values
-v, --verbose Verbose mode showing all OPC function calls
-e, --errors Include descriptive error message strings
-R, --recursive List items recursively when browsing tree
-, --pipe Pipe item/value list from standard input
If you experience any unexpected errors, please check the FAQ on
http://openopc.sourceforge.net for additional help.
If after reading through the FAQ you still require additional help,
then the author of this package would be happy to assist you via
e-mail. Please see the project website for current contact
information.
Technical Support
-----------------
If you have any questions, bug reports, or suggestions for improvements
please feel free to contact the author at:
barry_b@users.sourceforge.net
While I cannot always guarantee a quick response, I eventually respond
to all e-mails and will do my best to solve any issues which are discovered.
Thanks for using OpenOPC for Python!
Credits
-------
Copyright (c) 2008-2012 by Barry Barnreiter (barry_b@users.sourceforge.net)
Copyright (c) 2014 by Anton D. Kachalov (mouse@yandex.ru)
Copyright (c) 2017 by Michal Kwiatkowski (michal@trivas.pl)
Copyright (c) 2022 by j3mg
http://openopc.sourceforge.net/
https://github.com/ya-mouse/openopc
https://github.com/sightmachine/OpenOPC
https://github.com/mkwiatkowski/OpenOPC
Raw data
{
"_id": null,
"home_page": "https://github.com/j3mg/openopc",
"name": "OpenOPC-DA",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.4",
"maintainer_email": "",
"keywords": "python,opc,opc-da,openopc",
"author": "j3mg",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/63/fc/03a3f1d84d68215c4d92c334f7e1e0158f2f68d5b585386a8c79917b9531/OpenOPC-DA-1.5.0.tar.gz",
"platform": null,
"description": "OpenOPC\n=======\n\nOpenOPC for Python 3.7+ is a descendent of http://openopc.sourceforge.net\nwith modifications for Python 3 and distutils.\n\n\nAbout OpenOPC\n-------------------\nOpenOPC for Python is a free, open source OPC (OLE for Process Control)\ntoolkit designed for use with the popular Python programming language.\n\n\nSoftware Developers\n-------------------\n\nIf you elected to install the OpenOPC Development library during the\ninstallation process, then you'll need to also download and install\nthe following packages in order to develop your own Python programs\nwhich use the OpenOPC library:\n\n1. Python 3.7+\n https://www.python.org/download/\n\n2. Python for Windows Extensions (pywin32)\n https://github.com/mhammond/pywin32\n\n3. Pyro5\n https://github.com/irmen/Pyro5\n\nOf course, Python is necessary on all platforms. However the other\npackages may be optional depending on your configuration:\n\n1. Win32 platform, using the OpenOPC Gateway Service\n\nPywin32: optional\nPyro5: required\n\n2. Win32 platform, talking to OPC Servers directly using COM/DCOM\n\nPywin32: required\nPyro5: optional\n\n3. Non-Windows platform (use of Gateway Service is mandatory)\n\nPywin32: not applicable\nPyro5: required\n\nIn order to get the most from the OpenOPC package, Windows developers\nare encouraged to install both Pywin32 and Pyro. Using Pyro to talk to\nthe Gateway Service provides a quick and easy method for bypassing the\nDCOM security nightmares which are all too common when using OPC.\n\n\nDocumentation\n-------------\n\nA PDF manual for OpenOPC is included in this installation inside the\n\"doc\" folder. Users are encouraged to also look at the OpenOPC web\nsite for additional usage examples that may not be contained in the\nmanual.\n\nEXAMPLE - Minimal working program::\n\n import OpenOPC\n opc = OpenOPC.client()\n opc.connect('Matrikon.OPC.Simulation')\n print(opc['Square Waves.Real8'])\n opc.close()\n\n\nOpenOPC Command-line Client\n---------------------------\n\nOpenOPC includes the only publically available command-line OPC client.\nUnlike graphical clients, it can be easily used in scripts or batch files.\nAnd because of its piping capability (i.e. chaining commands together),\nit is far more powerful than other OPC clients\n\n1. Get a listing of the available OPC servers on your computer by\ngoing to the command prompt and entering::\n\n opc -q\n\n2. Set your prefered OPC server as the default by setting the system\nwide enviornment variable OPC_SERVER. (On Windows you can do this\nby going to Control Panel > System > Advanced > Environment Variables)::\n\n OPC_SERVER=Matrikon.OPC.Simulation\n\n3. Display OPC server information via the Win32 COM connection::\n\n opc -i\n\n4. Test to see if the OpenOPC Gateway Service is functioning by\nentering::\n\n opc -m open -i\n\n5. Test some of the other commands available using the OPC Command\nLine Client. To get started, try entering the opc command without\nany arguments in order to see the help page::\n\n opc\n\nTo read an item from your OPC server, just include the item name as\none of your arguments. For example, if you're using Matrikon's\nSimulation server you could do::\n\n opc Random.Int4\n\nTo read items from a specific OPC server you have installed,\ninclude the -s switch followed by the OPC server name. For\nexample::\n\n opc -s Matrikon.OPC.Simulation Random.Int4\n\nTo list available items::\n\n C:\\> opc -f Random.*Int*\n Random.Int1\n Random.Int2\n Random.Int4\n Random.UInt1\n Random.UInt2\n Random.UInt4\n\nTo read values of items every 60 seconds, logging the results to a file\nuntil stopped by Ctrl-C...::\n\n C:\\> opc Random.Int4 Random.Real8 -L 60 >data.log\n\nCommand usage summary::\n\n C:\\> opc \n OpenOPC Command Line Client 1.1.6\n Copyright (c) 2007-2008 Barry Barnreiter (barry_b@users.sourceforge.net)\n \n Usage: opc [OPTIONS] [ACTION] [ITEM|PATH...]\n \n Actions:\n -r, --read Read ITEM values (default action)\n -w, --write Write values to ITEMs (use ITEM=VALUE)\n -p, --properties View properties of ITEMs\n -l, --list List items at specified PATHs (tree browser)\n -f, --flat List all ITEM names (flat browser)\n -i, --info Display OPC server information\n -q, --servers Query list of available OPC servers\n -S, --sessions List sessions in OpenOPC Gateway Service\n \n Options:\n -m MODE, --mode=MODE Protocol MODE (dcom, open) (default: OPC_MODE)\n -C CLASS,--class=CLASS OPC Automation CLASS (default: OPC_CLASS)\n -n NAME, --name=NAME Set OPC Client NAME (default: OPC_CLIENT)\n -h HOST, --host=HOST DCOM OPC HOST (default: OPC_HOST)\n -s SERV, --server=SERVER DCOM OPC SERVER (default: OPC_SERVER)\n -H HOST, --gate-host=HOST OpenOPC Gateway HOST (default: OPC_GATE_HOST)\n -P PORT, --gate-port=PORT OpenOPC Gateway PORT (default: OPC_GATE_PORT)\n \n -F FUNC, --function=FUNC Read FUNCTION to use (sync, async)\n -c SRC, --source=SOURCE Set data SOURCE for reads (cache, device, hybrid)\n -g SIZE, --size=SIZE Group tags into SIZE items per transaction\n -z MSEC, --pause=MSEC Sleep MSEC milliseconds between transactions\n -u MSEC, --update=MSEC Set update rate for group to MSEC milliseconds\n -t MSEC, --timeout=MSEC Set read timeout to MSEC mulliseconds\n \n -o FMT, --output=FORMAT Output FORMAT (table, values, pairs, csv, html)\n -L SEC, --repeat=SEC Loop ACTION every SEC seconds until stopped\n -y ID, --id=ID,... Retrieve only specific Property IDs\n -a STR, --append=STR,... Append STRINGS to each input item name\n -x N --rotate=N Rotate output orientation in groups of N values\n -v, --verbose Verbose mode showing all OPC function calls\n -e, --errors Include descriptive error message strings\n -R, --recursive List items recursively when browsing tree\n -, --pipe Pipe item/value list from standard input\n\nIf you experience any unexpected errors, please check the FAQ on\nhttp://openopc.sourceforge.net for additional help.\n\nIf after reading through the FAQ you still require additional help,\nthen the author of this package would be happy to assist you via\ne-mail. Please see the project website for current contact\ninformation.\n\n\nTechnical Support\n-----------------\n\nIf you have any questions, bug reports, or suggestions for improvements\nplease feel free to contact the author at:\n\nbarry_b@users.sourceforge.net\n\nWhile I cannot always guarantee a quick response, I eventually respond\nto all e-mails and will do my best to solve any issues which are discovered.\n\nThanks for using OpenOPC for Python!\n\nCredits\n-------\nCopyright (c) 2008-2012 by Barry Barnreiter (barry_b@users.sourceforge.net)\nCopyright (c) 2014 by Anton D. Kachalov (mouse@yandex.ru)\nCopyright (c) 2017 by Michal Kwiatkowski (michal@trivas.pl)\nCopyright (c) 2022 by j3mg\n\nhttp://openopc.sourceforge.net/\nhttps://github.com/ya-mouse/openopc\nhttps://github.com/sightmachine/OpenOPC\nhttps://github.com/mkwiatkowski/OpenOPC\n",
"bugtrack_url": null,
"license": "GPLv2",
"summary": "OPC-DA (OLE for Process Control) toolkit for Python 3.7+",
"version": "1.5.0",
"split_keywords": [
"python",
"opc",
"opc-da",
"openopc"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0fe84c0d81f2fa59999adb79dc28988dfdb0655b98ea4fa73d9b2e9c19f1c18f",
"md5": "2335a9d4755b36d640c6f752eeca1675",
"sha256": "449883b806777b6eca0b4934212274b888b55ea01c6fb0d42d45523e8ac3d7ef"
},
"downloads": -1,
"filename": "OpenOPC_DA-1.5.0-py3-none-manylinux1_x86_64.whl",
"has_sig": false,
"md5_digest": "2335a9d4755b36d640c6f752eeca1675",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.4",
"size": 33240,
"upload_time": "2023-01-19T17:51:25",
"upload_time_iso_8601": "2023-01-19T17:51:25.327865Z",
"url": "https://files.pythonhosted.org/packages/0f/e8/4c0d81f2fa59999adb79dc28988dfdb0655b98ea4fa73d9b2e9c19f1c18f/OpenOPC_DA-1.5.0-py3-none-manylinux1_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c82e53fae33e7b8ef112ab7b1692b349ea910931563ee36c5ac2385d93dd17d6",
"md5": "cb8171eb1d66ee2455bdf61a51da4ac1",
"sha256": "0166bb53512deb46525f94eb5c51665886b58cc8e3b75f5b4145fb74cb3ae065"
},
"downloads": -1,
"filename": "OpenOPC_DA-1.5.0-py3-none-win32.whl",
"has_sig": false,
"md5_digest": "cb8171eb1d66ee2455bdf61a51da4ac1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.4",
"size": 35697,
"upload_time": "2023-01-19T17:51:27",
"upload_time_iso_8601": "2023-01-19T17:51:27.393756Z",
"url": "https://files.pythonhosted.org/packages/c8/2e/53fae33e7b8ef112ab7b1692b349ea910931563ee36c5ac2385d93dd17d6/OpenOPC_DA-1.5.0-py3-none-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "920f93be02dde5bc13f9a8d5da79ac82c77bc700b5ddd12c93cd60d2564a32df",
"md5": "293f11a853783eb74cd8d412be886d31",
"sha256": "8f81de8e870153d78f57d4799936d08a1c66bda36f739594e09a342296e1a4ff"
},
"downloads": -1,
"filename": "OpenOPC_DA-1.5.0-py3-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "293f11a853783eb74cd8d412be886d31",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.4",
"size": 33232,
"upload_time": "2023-01-19T17:51:28",
"upload_time_iso_8601": "2023-01-19T17:51:28.921368Z",
"url": "https://files.pythonhosted.org/packages/92/0f/93be02dde5bc13f9a8d5da79ac82c77bc700b5ddd12c93cd60d2564a32df/OpenOPC_DA-1.5.0-py3-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "63fc03a3f1d84d68215c4d92c334f7e1e0158f2f68d5b585386a8c79917b9531",
"md5": "8a0ab323f63896d0dde72aee1dc676f2",
"sha256": "e09ba410bbc3a1923871bc19d4ac166e2066d79d42d270fb19c8ccba24358a39"
},
"downloads": -1,
"filename": "OpenOPC-DA-1.5.0.tar.gz",
"has_sig": false,
"md5_digest": "8a0ab323f63896d0dde72aee1dc676f2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.4",
"size": 33607,
"upload_time": "2023-01-19T17:51:29",
"upload_time_iso_8601": "2023-01-19T17:51:29.906915Z",
"url": "https://files.pythonhosted.org/packages/63/fc/03a3f1d84d68215c4d92c334f7e1e0158f2f68d5b585386a8c79917b9531/OpenOPC-DA-1.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-19 17:51:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "j3mg",
"github_project": "openopc",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "openopc-da"
}