Error in running pyPLCn.py with AXC F 2152
Hi all,
I'm using AXC F 2152 and trying to exchange python data with PLCnext Enginner.
For that, I'm downloaded pyPLCn example code from GitHub and it worked well.
But the problem occurs when I create a new project at PLCnext Engineer.
I matched the variables' name in pyPLCn's "example.py" with those in the newly created project's Global data.
And I saw an error message like attached below.
I think it's kinda request-respone error (but i'm not sure).
The reason that I thought like that is, according to the "pyPLCn.py" code in pyPLCn
if the "reponse.status_code" is not 201, the error message I mentioned appears and hear is the part of the code.
How can I fix this problem?
Thanks in advance.
Comments
Hello maxhong97,
you might want to create an issue with the GitHub repository for your question.
This library is not provided by Phoenix Contact.
GitHub - AlexanderSkachkov/pyPLCn
A guess on the error cause thou:
Looks like you are trying to report groups with a wrong request,
Or did not login using scope:variables
First register a group then you can retrieve multiple variables via the groupID at once.
or maybe the issue is parsing the response.
Requests (plcnext.help)
Also make sure that you have either an active Ehmi page (with variables) or enabled the REST service via PLCnext Engineer.
Can you provide the raw http Request/Responses that got send recieved ?
kind regards,
Oliver
Hi Oliver,
Thank you for your comment.
As you advised, I figured out that I missed the check box "REST interface".
So after I did check the REST interface option in PLCnext Enginner, the problem solved.
Again, Thank you for your support.
Have a nice day!