CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Wed Sep 18, 2019 12:24 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Wed Jan 08, 2014 8:00 am 
Offline

Joined: Thu Jan 02, 2014 9:53 am
Posts: 3
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


Top
   
PostPosted: Wed Jan 08, 2014 9:12 am 
Offline
Frequent User
Frequent User
User avatar

Joined: Fri Mar 18, 2011 4:12 pm
Posts: 266
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.

_________________
Check out the CODESYS store: http://store.codesys.com/

CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions


Top
   
PostPosted: Wed Jan 08, 2014 9:22 am 
Offline

Joined: Thu Jan 02, 2014 9:53 am
Posts: 3
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


Top
   
PostPosted: Wed Jan 08, 2014 9:25 am 
Offline
Frequent User
Frequent User
User avatar

Joined: Fri Mar 18, 2011 4:12 pm
Posts: 266
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.

_________________
Check out the CODESYS store: http://store.codesys.com/

CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions


Top
   
PostPosted: Wed Jan 08, 2014 9:40 am 
Offline
Frequent User
Frequent User
User avatar

Joined: Fri Mar 18, 2011 4:12 pm
Posts: 266
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.)

_________________
Check out the CODESYS store: http://store.codesys.com/

CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions


Top
   
PostPosted: Wed Jan 08, 2014 10:38 am 
Offline

Joined: Thu Jan 02, 2014 9:53 am
Posts: 3
Hi,

Thanks for the reply.

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

This worked :)

Regards,
Mangesh


Top
   
PostPosted: Wed Jan 08, 2014 10:44 am 
Offline
Frequent User
Frequent User
User avatar

Joined: Fri Mar 18, 2011 4:12 pm
Posts: 266
Hi, Mangesh,

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

_________________
Check out the CODESYS store: http://store.codesys.com/

CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 7 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited