Difference between revisions of "Inside the Python support in QuickOPC"

From OPC Labs Knowledge Base
Jump to navigation Jump to search
Line 3: Line 3:
 
= QuickOPC with Python.NET =
 
= QuickOPC with Python.NET =
  
 +
== .NET Runtime Initialization  ==
  
 
= QuickOPC with Python (COM) =
 
= QuickOPC with Python (COM) =

Revision as of 15:49, 3 November 2023

QuickOPC can currently be used from Python using two approaches: With the help of Python.NET (the new, recommended approach), and over Microsoft COM (older approach, deprecated).

QuickOPC with Python.NET

.NET Runtime Initialization

QuickOPC with Python (COM)

In this approach, the pypiwin32 Python package is used to access QoickOPC COM API from Python. For the reasons explained further below, this approach is now deprecated. The examples using the COM approach remain in the product, at least for the time being.

The disadvantages of the COM approach include:

  • Strictly limited to Windows only.
  • Multiple layers involved (QuickOPC is .NET API primarily, the COM API layer sits on top of it, then Python layer accesses this COM API), with performance and possibly also reliability implications.
  • The fact that COM API is involved "in the middle" precludes usage of many .NET features, such as generics, methods overloads, or callbacks.
  • The pypiwin32 package is poorly documented, and does not appear to be very actively maintained.
  • Apparent impossibility to make the event notifications work.