- Posts: 27
- Thank you received: 0
Extracting project information using Python
1 month 2 weeks ago #312
by User
Extracting project information using Python was created 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:
1. The name and type of all objects in the PLC program
Any pointers to documentation, example scripts, or relevant classes/methods would be greatly appreciated.
Thanks in advance!
/User
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
- Output of GetDv0 → first input pin of And0
- Output of GetDv1 → second input pin of And0
- Output of And0 → input pin of StoDv0
1. The name and type of all objects in the PLC program
- e.g. GetDv0 (GetDv), GetDv1 (GetDv), And0 (And), StoDv0 (StoDv)
- e.g. GetDv0 output pin → And0 input pin 1
- GetDv1 output pin → And0 input pin 2
- And0 output pin → StoDv0 input pin
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.
1 month 1 week ago #314
by claes
Replied by claes on topic Extracting project information using Python
Hi User,
The information about the connections are stored in buffer attributes that only can be interpreted by the plc editor, not by Python or any other API (except undocumented c). The only way you can see the content is if you dump the database to text file with reload.sh. I guess it would be possible to parse the dump file, but it's not easy to figure out which input or output a connection is connected to. You can find the pin number in the dump, but to translate this to an input or output you need to know which inputs and outputs are visible and the list of attributes for this class.
/Claes
The information about the connections are stored in buffer attributes that only can be interpreted by the plc editor, not by Python or any other API (except undocumented c). The only way you can see the content is if you dump the database to text file with reload.sh. I guess it would be possible to parse the dump file, but it's not easy to figure out which input or output a connection is connected to. You can find the pin number in the dump, but to translate this to an input or output you need to know which inputs and outputs are visible and the list of attributes for this class.
/Claes
Please Log in or Create an account to join the conversation.
Time to create page: 0.456 seconds