Extracting project information using Python

More
1 day 7 hours ago #312 by User
Hello everyone,

I’m working on a Python script to extract information from one of my ProviewR projects. So far, I can retrieve basic data such as object names within a root volume and their class types.
I found some documentation about using Python with ProviewR in upgrade57.pdf, but I haven’t figured out how to use the existing functions to get the information I want from my PLC program.

What I’d like to do next is extract more detailed information about the PLC program itself. Ideally, this should be done automatically by some script or built‑in functionality, without having to collect all the information manually. I would prefer to do this in Python, but I’m open to other approaches or tools if they achieve the same result.

For example, imagine the following simple setup in the PLC program:
  • Two GetDv objects: GetDv0 and GetDv1
  • One And object: And0
  • One StoDv object: StoDv0
The connections are:
  • Output of GetDv0 → first input pin of And0
  • Output of GetDv1 → second input pin of And0
  • Output of And0 → input pin of StoDv0
Using a script (preferably Python), I would like to be able to extract:
1. The name and type of all objects in the PLC program
  • e.g. GetDv0 (GetDv), GetDv1 (GetDv), And0 (And), StoDv0 (StoDv)
2. The wiring/connection information between pins
  • e.g. GetDv0 output pin → And0 input pin 1
  • GetDv1 output pin → And0 input pin 2
  • And0 output pin → StoDv0 input pin
Is there a recommended way or API in ProviewR to access this information programmatically (Python or otherwise), or some export that a script can process?
Any pointers to documentation, example scripts, or relevant classes/methods would be greatly appreciated.

Thanks in advance!
/User

Please Log in or Create an account to join the conversation.

Time to create page: 0.389 seconds
Powered by Kunena Forum