Does CoDeSys provide the possibility to set the gateway (e.g. IP number) and scan the network for devices, by python script.
In the examples, I see no gateway IP number at all. While in the GUI, I have to select a gateway and set the active path.
e.g.
# set "Python.project" to active application
app = proj.active_application
onlineapp = online.create_online_application(app)
# login to device
onlineapp.login(OnlineChangeOption.Try, True)
The goal is to give a script two parameters (project name and gateway IP number). And that script would download the project to that device. (The project itself does not contain the gateway information.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-04-16
Originally created by: M.Schaber
Hi, Edwin,
Edwin hat geschrieben:
Does CoDeSys provide the possibility to set the gateway (e.g. IP number) and scan the network for devices, by python script.
In the examples, I see no gateway IP number at all. While in the GUI, I have to select a gateway and set the active path.
e.g.
# set "Python.project" to active application
app = proj.active_application
onlineapp = online.create_online_application(app)
# login to device
onlineapp.login(OnlineChangeOption.Try, True)
The goal is to give a script two parameters (project name and gateway IP number). And that script would download the project to that device. (The project itself does not contain the gateway information.)
For scripts, device Objects have the following methods:
So you can set the gateway and address CoDeSys uses to connect to a specific device, the "active path". The adress here is the CoDeSys address (like "[011D.8001.9ED4]") and not an IP address, as it has to cover routing through several cascaded field busses.
Sadly, the Guid is not yet displayed anywhere in the UI. The easiest way to get the Guid for a Gateway currently is to set the active path of a device to that gateway, and then dump it via "print projects.primary.find("name_of_device", True)[0].get_gateway()" in a script.
It is not yet possible to configure the list of available Gateways itsself (like the "Add Gateway" button) from the script, however. If you need this functionality, please file it as a requirement via our support department.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Next I'll try to set the controller communication setting...
Also I detected that the Menu; Project; Export file contains the GatewayGuid.
Search for <single type="System.Guid" name="GatewayGuid"> in the *.export file.</single>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does CoDeSys provide the possibility to set the gateway (e.g. IP number) and scan the network for devices, by python script.
In the examples, I see no gateway IP number at all. While in the GUI, I have to select a gateway and set the active path.
e.g.
# set "Python.project" to active application
app = proj.active_application
onlineapp = online.create_online_application(app)
# login to device
onlineapp.login(OnlineChangeOption.Try, True)
The goal is to give a script two parameters (project name and gateway IP number). And that script would download the project to that device. (The project itself does not contain the gateway information.)
Originally created by: M.Schaber
Hi, Edwin,
For scripts, device Objects have the following methods:
So you can set the gateway and address CoDeSys uses to connect to a specific device, the "active path". The adress here is the CoDeSys address (like "[011D.8001.9ED4]") and not an IP address, as it has to cover routing through several cascaded field busses.
Sadly, the Guid is not yet displayed anywhere in the UI. The easiest way to get the Guid for a Gateway currently is to set the active path of a device to that gateway, and then dump it via "print projects.primary.find("name_of_device", True)[0].get_gateway()" in a script.
It is not yet possible to configure the list of available Gateways itsself (like the "Add Gateway" button) from the script, however. If you need this functionality, please file it as a requirement via our support department.
I used:
And that resulted in a 16 byte GUID.
Next I'll try to set the controller communication setting...
Also I detected that the Menu; Project; Export file contains the GatewayGuid.
Search for <single type="System.Guid" name="GatewayGuid"> in the *.export file.</single>