PLCnext on LinkedInPLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

  1. dewanpieterse
  2. PLCnext Technology & PLCnext Controls
  3. Tuesday, 14 July 2020

Hi everyone

I am yet to receive a controller but I have access through VPN to a 1152 controller.

 

I am looking to access variables from the linux side through, for example, a python script. How can I go about this?

The plan eventually is to use the controller connected to an inverter, to push inverter variables either through API / MQTT / FTP to a server.

I have read that I can access the OPC UA server with python but this is an extra step (is this a feasible solution?) and I would like to access the GDS directly.

 

At this stage, I am not able to access the controller through PLCnext Engineer but can ask to change variables/settings on the controller.

 

Thank you in advance.

Dewan

Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi Dewan,

If you would like to access variables on a PLC from a remote client, then you currently have a few options, including:

A python client would probably use the OPC UA or REST services. None of these services give direct access to the GDS, so that shouldn't be a deciding factor.

If you would like to access variables on a PLC from an application running on the PLC, then you have a few more options. A python script running on the PLC will still use either OPC UA or REST, but applications started by the PLCnext Runtime process - written in either IEC-61131, C++ or C# - can read and write GDS variables in other ways. For example, a C++ application (like the one in the SampleRuntime example) can use the C++ API to read and write GDS variables.

Hope this helps.

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

dewanpieterse Accepted Answer Pending Moderation
0
Votes
Undo

Hi Martin

Thank you for the clarification, this will definitely help.

I will give feedback as soon as I've made progress on the above.

Dewan

Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

No worries. I know I was a little vague about the "other ways" you can access GDS variables from PLCnext Runtime apps, so if you would like more information about this (or anything else), please let us know.

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.