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 Mon Nov 19, 2018 10:55 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Fri Jun 02, 2017 4:41 pm 
Offline

Joined: Wed Apr 13, 2016 10:27 am
Posts: 21
Hello support team,

I have tried to insert a POU, Task config and symbol config into the new project with the following modified example script of "taskconfig-example.py" by Martin:

Code:
#
# Main program
#
proj = projects.primary

found = proj.find('Application', True)
assert(found, 'Application not found')
app = found[0]
print(app)
# add POU
pou = app.create_pou(mypou)

# Create task configuration
taskconfig = app.create_task_configuration()
assert(taskconfig, 'task config was not created')

# add symbol config
taskconfig = app.create_symbol_configuration()


after executed the script, I can create POU under connector "Application" successfully. but creating Task and Symbol config were failed. CDY show error "'Script Object' object hast no attribute 'create_task_configuration' .( the same error message in case of creating Symbol config).

Have any idea, what is wrong with above script? or the CDY version does not support the methods?

Thanks for Help!
hhz


Top
   
PostPosted: Tue Jun 06, 2017 11:22 am 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 232
Hi hhz.

hhz wrote:
Have any idea, what is wrong with above script? or the CDY version does not support the methods?

Both features are available for CODESYS V3.5 SP10 or newer.

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 Jun 08, 2017 1:04 pm 
Offline

Joined: Wed Apr 13, 2016 10:27 am
Posts: 21
Hi Martin,

Thanks!

I have test it with SP10 . Adding POU and Task config work, but Symbol config done not work.
Error diagnose hows no attribute "create_symbol_configuration()".

Is the script commands wrong?

BR.


Top
   
PostPosted: Thu Jun 08, 2017 2:21 pm 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 232
Hi hhz.

hhz wrote:
Is the script commands wrong?

Where did you get that command? It is wrong. See my example below.

Code:
from System import Guid

optimizedCalculator = Guid('{0141eb75-141b-4ea1-9a8c-75f952b22a6c}')

app = projects.primary.active_application
symbol = app.create_symbol_config(False, False, optimizedCalculator)
print('Symbol config created')

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 Jun 08, 2017 4:38 pm 
Offline

Joined: Wed Apr 13, 2016 10:27 am
Posts: 21
Thanks ! now it works well. :D


Top
   
PostPosted: Wed Sep 27, 2017 8:11 am 
Offline

Joined: Mon Sep 25, 2017 1:14 pm
Posts: 3
Thanks for the help on the taskconfig, but the creating of a symbol config doesn't work for me.

I have run your example code in SP10 (well, KeMotion 3.10a, but it uses CoDeSys 3.5.10 under the hood), but it gives me the AttributeError that the ScriptObject has no 'create_symbol_config' attribute.
I've checked the scriptengine.dll and did an API-dump and it has the command 'create_symbol_config', with the two bools and the Guid as parameters, but it doesn't seem to use it.
I've downloaded and installed CoDeSys 3.5.11P2 (x64) and it has no problem creating a symbol configuration from script.
Relevant part of my code:
Code:
    app=projects.primary.active_application
    print(app.is_application, app.is_active_application) # True True
    symconf = app.create_symbol_config(False, False, Guid.Empty)
Using
Code:
   optimizedCalculator = Guid('{0141eb75-141b-4ea1-9a8c-75f952b22a6c}')
and giving optimizedCalculator as parameter instead of Guid.Empty does not affect the issue of the AttributeError arising. Neither does changing the bools to True.

How can this be resolved?

Edit:
I manually made a symbol configuration and I printed it. It does not qualify as a ScriptSymbolConfigObject (not even as a NoSymbolConfigObject) and using symconf.is_symbol_config gives an AttributeError. I can't do anything with it beyond basic ScriptObject-handling (such as get_name, guid, remove, etc...)

Testing the same script with a project in SP11P2 works flawlessly and it shows up as a ScriptSymbolConfigObject and the corresponding methods work with no issue.
This seems to be an issue with the implementation of CoDeSys 3.5.10 by KEBA in KeMotion 3.10a. Is there a way I can check whether this is the case by comparing some SP11P2 dll's with those from KeMotion?
I'm also wondering why the commands do show up in the API dump.

BR

Wouter


Top
   
PostPosted: Wed Sep 27, 2017 4:50 pm 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 232
Hi Wouter.

WousV wrote:
How can this be resolved?

Edit:
I manually made a symbol configuration and I printed it. It does not qualify as a ScriptSymbolConfigObject (not even as a NoSymbolConfigObject) and using symconf.is_symbol_config gives an AttributeError. I can't do anything with it beyond basic ScriptObject-handling (such as get_name, guid, remove, etc...)

Testing the same script with a project in SP11P2 works flawlessly and it shows up as a ScriptSymbolConfigObject and the corresponding methods work with no issue.
This seems to be an issue with the implementation of CoDeSys 3.5.10 by KEBA in KeMotion 3.10a. Is there a way I can check whether this is the case by comparing some SP11P2 dll's with those from KeMotion?
I'm also wondering why the commands do show up in the API dump.

The Scripting API for the SymbolConfig is implemented in the plug-in ScriptDriverSymbolcConfigObject. If the plug-in is installed and loaded with the profile you should be able to use it.

In CODESYS you can see what plug-ins are loaded but I don't know if there is a way in KeMotion. I think you should contact the support from KEBA and ask them for help.

BR
Martin

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


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