Online Forums
Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.
Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.
Do not use the Contact page for technical issues.
OPC DA item with an access path
pip install opclabs_quickopc
and then, in your code, start with
import opclabs_quickopc
# Import .NET namespaces.
from OpcLabs.EasyOpc.DataAccess import *
from OpcLabs.EasyOpc.DataAccess.OperationModel import *
See our Python examples (there are more than 200 of them).
Best regards
Please Log in or Create an account to join the conversation.
I guess I can still be surprised ( by the access path usage ).
In order to specify the access path, you can create the item descriptor like this:
item_descriptor = DAItemDescriptor(item_id)
item_descriptor.AccessPath = access_path
I hope this helps.
Best regards
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
If really needed, I can help with properly specifying the access path. However, I seriously doubt that access path is what you are looking for. I am involved with OPC almost from its beginnings, 25-30 years. And in this whole period, I have *never* seen an actual OPC server that would require or even support access paths. Access paths are esoteric feature that only existed in OPC DA specification 1.0, and has been removed in all subsequent versions of the spec.
I suggest that you rather describe what you want to achieve or why you have asked for the access path. I think that with Matrikon OPC server, the ItemID should be sufficient for the server to identify what you want to read, write, or subscribe to.
Best regards
Please Log in or Create an account to join the conversation.
import sys# Add reference to QuickOPC .NET assembly
# Adjust the path based on where QuickOPC is installed on your systemsys.path.append(r"C:\Program Files (x86)\OPC Labs QuickOPC 2023.2\Assemblies\net472")
clr.AddReference("OpcLabs.EasyOpcClassic")# Import QuickOPC namespaces
from OpcLabs.EasyOpc.DataAccess import EasyDAClient, DAItemDescriptordef read_opc_item(): # Create an instance of the EasyDAClient client = EasyDAClient() try: # Define server, ItemID, and access path server_name = "Matrikon.OPC.Simulation" # Replace with your server's ProgID
item_id = "Random.Int4" # Example ItemID (server-specific)
access_path = "SimulatedData" # Example access path (server-specific) # Create a DAItemDescriptor with ItemID and access path
item_descriptor = DAItemDescriptor(item_id, access_path) # Read the item from the OPC server
result = client.ReadItem("", server_name, item_descriptor) # Check if the read was successful and display the result
if result.Exception is None:
print(f"Value: {result.Value}") print(f"Timestamp: {result.Timestamp}")
print(f"Quality: {result.Quality}") else: print(f"Error reading item: {result.Exception.Message}")
except Exception as ex: print(f"An error occurred: {str(ex)}")if __name__ == "__main__": read_opc_item()
Please Log in or Create an account to join the conversation.