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 Tue Feb 19, 2019 4:27 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
 Post subject: network scan with python
PostPosted: Thu Feb 13, 2014 3:50 pm 
Offline

Joined: Wed Feb 05, 2014 11:33 am
Posts: 5
When I create a new project and click 'login', then I get a message box "No active path defined. Do you want to set it?".
If I click "Yes", there is done a network scan, my device will be found and I can go online.
How can I do this network scan in python?

thank you


Top
   
PostPosted: Thu Feb 13, 2014 3:59 pm 
Offline
Frequent User
Frequent User
User avatar

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

You can set a network path and gateway via scripting, if you have that information, but currently, a network scan cannot be triggered by the scripting yet.

The improvement CDS-24285 will implement that functionality, but it is not scheduled yet.

If you want to influence the priority of this issue, you can use the usual channels (our support department for OEMs, your OEM for end-users) to increase it. :-)

HTH,
Markus

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

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


Top
   
PostPosted: Tue Jul 14, 2015 1:57 pm 
Offline

Joined: Fri Jul 10, 2015 10:52 am
Posts: 35
My only problem with this that even if I know the installation-windows dependent GUID of the gateway I can not know the device ID since (even if the device is the same, with same firmware on the same IP) its changing from time to time.

So hardcoding the GUID and "bus independent Codesys" address is not a solution.

Any idea how to resolve this?


Top
   
PostPosted: Wed Jul 15, 2015 10:34 am 
Offline
Frequent User
Frequent User
User avatar

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

Sadly, I don't have any good idea, that's why we did file the aforementioned improvement in our database. :(

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

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


Top
   
PostPosted: Tue Sep 29, 2015 1:29 pm 
Offline

Joined: Fri Jul 10, 2015 10:52 am
Posts: 35
Hi

I recently updated to SP7 and noticed that some of my script are failing (either entering debug mode or at login).
I'm still trying to figure out what went wrong but noticed a really strange behaviour in gateway setting:

When using the graphical interface (Device/Gateway configuration) I can enter the address of the device manually or choose my device
from the scan list. But seems there is a difference between these two. (Lets assume that I have a device with address '0003.2A0E.B0CA'.

a) Choosing the device from the list with double click will result a green connection
b) Entering manually the exact following string '0003.2A0E.B0CA' (without ofc '') will report me that there is no route to host
c) Entering manually the exact following string '[0003.2A0E.B0CA]' will result a green connection
d) Entering manually the exact following string '[0003.2A0E.B0CA] (active)' will result a green connection

Since from scripting there is no way to scan and choose a device from a list, I'm manually trying to force the values using set_getway...(...) call.
But this will result the same as I would have entered like point b).
Giving the c) or d) format to this interface function results an 'Invalid address format' exception.

Any idea whats wrong/changed/am I doing wrong with SP7?


Top
   
PostPosted: Wed Sep 30, 2015 7:20 am 
Offline
Frequent User
Frequent User
User avatar

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

etamgul wrote:
Hi

I recently updated to SP7 and noticed that some of my script are failing (either entering debug mode or at login).
I'm still trying to figure out what went wrong but noticed a really strange behaviour in gateway setting:

When using the graphical interface (Device/Gateway configuration) I can enter the address of the device manually or choose my device
from the scan list. But seems there is a difference between these two. (Lets assume that I have a device with address '0003.2A0E.B0CA'.

a) Choosing the device from the list with double click will result a green connection
b) Entering manually the exact following string '0003.2A0E.B0CA' (without ofc '') will report me that there is no route to host
c) Entering manually the exact following string '[0003.2A0E.B0CA]' will result a green connection
d) Entering manually the exact following string '[0003.2A0E.B0CA] (active)' will result a green connection

Since from scripting there is no way to scan and choose a device from a list, I'm manually trying to force the values using set_getway...(...) call.
But this will result the same as I would have entered like point b).
Giving the c) or d) format to this interface function results an 'Invalid address format' exception.

Any idea whats wrong/changed/am I doing wrong with SP7?


As far as I can see, there were no code changes in this area of scripting APIs in SP7.

In the UI, you need to put the address between brackets "[1234]" to disambiguate them from names, for addresses like "AFFE". So putting in the address in Format b will try to search for a PLC with the string as the name.

I think we could snip surrounding []s in the scripting API (to make it equally accept format b and c). Case D should not be accepted by the scripting API in my opinion.

I can't tell why you don't get any connection using the script - this should be investigated and debugged, please contact support@codesys.com.

_________________
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  [ 6 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: Andreas Kehrer 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