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 "" 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 firstname.lastname@example.org
Check out the CODESYS store: http://store.codesys.com/CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions