CODESYS - the IEC 61131-3 automation software
https://forum.codesys.com/

Getting the gatewayPath in codesys
https://forum.codesys.com/viewtopic.php?f=18&t=5553
Page 1 of 1

Author:  morem [ Wed Jan 08, 2014 8:00 am ]
Post subject:  Getting the gatewayPath in codesys

Hi,

I am trying to set the gateway path and device address using Python script.

To set the gateway path I should first have the GUID of the Gateway.

I tried to get the guid using following code.

for dev in proj.get_children():
if dev.is_device:
tmpDevice = dev.get_device_identification()
strGateWay = dev.get_gateway()
print strGateWay

However, I am getting GUID value as
00000000-0000-0000-0000-000000000000.

Could you please help me in getting the proper GUID value for gateway.


Regards,
Mangesh

Author:  M.Schaber [ Wed Jan 08, 2014 9:12 am ]
Post subject:  Re: Getting the gatewayPath in codesys

The empty guid "00000000-0000-0000-0000-000000000000" is set when no gateway is configured for the device yet.

If you manually configure the gateway and network path to the device once (so you can login to the PLC), the gateway guid will be set, and you can print it using your script.

Then you can set it in other projects.

Author:  morem [ Wed Jan 08, 2014 9:22 am ]
Post subject:  Re: Getting the gatewayPath in codesys

Hi,

Thanks for the reply.

We want to automate a following scenario and we have script to perform following operations

1. Create an empty project using Python script.
2. Import a PLCOpenxml file for the project with device information.
3. Now I want to go online by setting the gateway path programmatically.

Is it possible without any manual intervention? I will not like to set the Gateway path manually.

Regards,
Mangesh

Author:  M.Schaber [ Wed Jan 08, 2014 9:25 am ]
Post subject:  Re: Getting the gatewayPath in codesys

Hi, Magesh,

Just configure it manually once, and print out the value. Then use the printed value within your script to configure the other projects non-interactively.

Author:  M.Schaber [ Wed Jan 08, 2014 9:40 am ]
Post subject:  Re: Getting the gatewayPath in codesys

Just another note: Our issue database has the improvement CDS-24285 to enable configuration of gateways by name, gateway management, and to start network scans. However, this issue is not yet scheduled for implementation. If you work for a CODESYS OEM, you can contact our support department so they register your companys name with that issue, that will raise the priority. (If you don't work for an CODESYS OEM, but you bought some hardware which ships with codesys, you can ask your hardware vendor to register their name with CDS-24285.)

Author:  morem [ Wed Jan 08, 2014 10:38 am ]
Post subject:  Re: Getting the gatewayPath in codesys

Hi,

Thanks for the reply.

Printed the value manually once and used the same guid for setting the Gateway Path.

This worked :)

Regards,
Mangesh

Author:  M.Schaber [ Wed Jan 08, 2014 10:44 am ]
Post subject:  Re: Getting the gatewayPath in codesys

Hi, Mangesh,

The Guid is valid for the same installation of codesys, but it will be a different one on a different machine.

Page 1 of 1 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/