openopc | OpenOPC for Python3.4
kandi X-RAY | openopc Summary
kandi X-RAY | openopc Summary
OpenOPC for Python 1.2.0 Copyright (c) 2008-2012 by Barry Barnreiter (barry_b@users.sourceforge.net) Copyright (c) 2014 by Anton D. Kachalov (mouse@yandex.ru).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Write data to table
- Print usage of OpenOPC
- Returns the value of an environment variable
- Get all sessions
- Create a new RPC client
- Convert a timestamp to a string
- Rotate data
- Generate rows of data
openopc Key Features
openopc Examples and Code Snippets
Community Discussions
Trending Discussions on openopc
QUESTION
I am using the OpenOPC library to read data from an OPC Server, I am using 'Matrikon OPC Simulation Server', when I try to read the data it sends me the following error:
...ANSWER
Answered 2020-Oct-28 at 07:20I solved this issue by adding sync=True
when calling opc.read()
CODE:
QUESTION
How do I convert OPC DA protocol in to Rest API calls? I was looking at the OpenOPC library https://github.com/mkwiatkowski/openopc. Will I have to write the Rest API part of the architecture myself? Are there libraries that already have this conversion?
...ANSWER
Answered 2020-Sep-08 at 09:06There's the library https://github.com/matzpersson/opc-rest-api From the description of the project:
Python Rest API using OpenOPC to provide direct API access for any OS platform. This proxy has to be installed on a Windows box with Python and OpenOPC installed to provide a API Gateway to other platforms.
The description is here http://headstation.com/archives/using-opc-rest-api/ From that it looks like you don't need to write the Rest API part yourself.
The library has been created by https://stackoverflow.com/users/6833456/matz see question OpenOPC Gateway Running use Client in OsX or Linux
QUESTION
I'm currently using openOPC for python 2.7, I would like to know if is it possible to convert the library to 3.4, I've tried using 2to3 but it didn't work properly, all the versions available only work on python 2, so I'm stucked. I've tried as well looking for another library with OPC-DA connection, but with no success. Have anyone tried to use OpenOPC successfully in Python 3?
...ANSWER
Answered 2017-Mar-15 at 15:08This project on github adapts OpenOPC for Python 3.4 and newer. Try that.
QUESTION
As per the explanation in the documentation(OpenOPC Documentation), opc.properties('Testtest/test.test') should return a list of tuple(id, description, value) but this is only giving me value.
...ANSWER
Answered 2019-Jul-23 at 15:48That's because you are setting id=
.
From the docs (emphasis mine):
Requesting properties for a single item returns a list of (id, description, value) tuples. Each tuple in the list represents a single property.
>>> opc.properties('Random.Int4')
[(1, 'Item Canonical DataType', 'VT_I4'), (2, 'Item Value', 491), (3, 'Item Quality', 'Good'), (4, ...
and:
The optional id parameter can be used to limit the returned value to that of a single property...
>>> opc.properties('Random.Int4', id=1)
'VT_I4'
QUESTION
I need to change the color of QPushButton, but an error occurred: "AttributeError: type object 'ProyectoTFM' has no attribute 'ui'". I don't know hoy to acced to a ui variable from my thread. This is my code:
...ANSWER
Answered 2017-May-05 at 22:41A few things:
- You never actually pass the UI to the function actualizarDatosOPC so it doesn't know it exists.
Is there any reason you can't use PyQt's built in threading tools? If you are going to use PyQt it might make sense to buy into the whole framework.
QUESTION
I have a python script that reads data from an OPCDA server and then push it to InfluxDB.
So basically it connects to the OPCDA using the OpenOPC library and to InfluxDB using the InfluxDB Python client and then starts an infinite while loop that runs every 5 seconds to read and push data to the database.
I have installed the script as a Service using NSSM. What is the best practice to ensure that the script is running 24/7 ? How to avoid crashes ? Should i daemonize the script ?
Thank you in advance,
Bnjroos
...ANSWER
Answered 2018-Oct-09 at 05:32I suggest at least to add logging at the script level. You could also use custom Exit Codes from python so NSSM knows to report failure. Your failure would probably be when connecting to your services so, i.e. netowrk down or something so you could write custom exceptions for NSSM to restart. If it's running every 5 seconds you would probably know very soon.
Ensuring availability and avoiding crashes is about your code more than infrastructure, hence the above recommendations.
I believe using NSSM (for scheduling and such) is better than daemonizing, since you're basically adding functionality of NSSM in your script and potentially adding more code that may fail.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install openopc
Get a listing of the available OPC servers on your computer by going to the command prompt and entering:
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)
Test your Win32 COM connection to the OPC server by entering the following at the command prompt:
Test to see if the OpenOPC Gateway Service is functioning by entering:
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:
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page