CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Fri Jul 28, 2017 1:41 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Mar 14, 2017 3:23 pm 
Offline

Joined: Wed Mar 01, 2017 3:07 pm
Posts: 5
Hi there,

I wonder if it is possible now to set up the gateway and device by IP address and device address?
I have looked up on the forum and in the ScriptEngine.chm. The only way I found was to use the device name, shown below.

Quote:
projects.primary.find("Device name", True)
get_gateway()
get_address()
set_gateway_and_address(gateway, address)


Thank you in advance :D


Top
   
PostPosted: Tue Mar 14, 2017 5:50 pm 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 202
Hi chenhe.

chenhe wrote:
I wonder if it is possible now to set up the gateway and device by IP address and device address?
I have looked up on the forum and in the ScriptEngine.chm. The only way I found was to use the device name, shown below.

With CODESYS V3.5 SP9 or newer you can use the method set_gateway_and_ip_address(...) to specify the IP address for the device.

You can find your gateway object by its name with the following code:
Code:
gw = online.gateways['Gateway-1']

If you don't have a gateway you can create one with online.gateways.add_new_gateway(...). You need to create a dictionary with the parameters required by the gateway driver. Each parameter must be converted to match the required type in the driver. I can provide an example if you need one.

BR
Martin

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

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


Top
   
PostPosted: Thu Mar 16, 2017 9:26 am 
Offline

Joined: Wed Mar 01, 2017 3:07 pm
Posts: 5
Hello M.Keller,

I'd like to have the example for creating new gateway. Thanks again. :D

M.Keller wrote:

If you don't have a gateway you can create one with online.gateways.add_new_gateway(...). You need to create a dictionary with the parameters required by the gateway driver. Each parameter must be converted to match the required type in the driver. I can provide an example if you need one.


Top
   
PostPosted: Thu Mar 16, 2017 12:21 pm 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 202
Hi chenhe.

chenhe wrote:
I'd like to have the example for creating new gateway.

I attached an example for creating a gateway.

BR
Martin


You do not have the required permissions to view the files attached to this post.

_________________
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  [ 4 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