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 Thu Dec 13, 2018 7:45 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Nov 28, 2017 11:50 am 
Offline

Joined: Mon Nov 20, 2017 2:20 pm
Posts: 5
Hi everyone,

I found this forum and i hope you can help me with my Problem.

I use the Automation Builder from ABB and i try to install a Siemens device description with python i need this for an automated Test with Third Party Devices.

The dev Desc is stored on a local Harddrive.

I have found some functions, which i think, i can use for this.
This is the code i used:
Code:
import scriptengine
source_list = scriptengine.device_repository.sources
print(source_list)
scriptengine.device_repository.import_device('S:\\Libraries\\ThirdPartyDevices\\GSDML-V2.32-Siemens-ET200SP-20170518.xml',source_list[0])


The output of the code is
Code:
<_3S.CoDeSys.ScriptDriverDeviceObject.ScriptRepositorySourceList object at 0x000000000000003A [_3S.CoDeSys.ScriptDriverDeviceObject.ScriptRepositorySourceList]>
SystemError: Invalid device description: Node 'DeviceDescription' not found


The problem is that i don´t no if i used the correct function to install the device description and the correct inputs.


I have a second problem, but i don´t know if this is the right place of the forum to ask. If not please let me know where i can post it here.

In my test I also use V2 Codesys, which is also integrated in the Automation Builder of ABB. And i want to know if it is possible to read out the massages of Codesys V2 ether with python or cmd commands?

I hope someone can help me with my problem.

Best Regards and have a nice week

Sebastian


Top
   
PostPosted: Tue Nov 28, 2017 4:12 pm 
Offline
Frequent User
Frequent User

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

Sebi_11 wrote:
I use the Automation Builder from ABB and i try to install a Siemens device description with python i need this for an automated Test with Third Party Devices.

The dev Desc is stored on a local Harddrive.

I have found some functions, which i think, i can use for this.
This is the code i used:
Code:
import scriptengine
source_list = scriptengine.device_repository.sources
print(source_list)
scriptengine.device_repository.import_device('S:\\Libraries\\ThirdPartyDevices\\GSDML-V2.32-Siemens-ET200SP-20170518.xml',source_list[0])


The output of the code is
Code:
<_3S.CoDeSys.ScriptDriverDeviceObject.ScriptRepositorySourceList object at 0x000000000000003A [_3S.CoDeSys.ScriptDriverDeviceObject.ScriptRepositorySourceList]>
SystemError: Invalid device description: Node 'DeviceDescription' not found


The problem is that i don´t no if i used the correct function to install the device description and the correct inputs.

We added the support for importing third party device desciptions through the Scripting API with CODESYS V3.5 SP10.

Here some example code:
Code:
allConvert = Guid('{C633F245-876F-45E8-AAB4-3FBD994C08B8}')

print("Import EDS device description")
devId = device_repository.import_device(basepath + r'\750-337.EDS', repoSource, allConvert)
devDesc = device_repository.get_device(devId)

The important part is the parameter allConvert which specifies the Guid of the conversion factory. The Guid in my example is the most used factory because it tries different other factories to convert the input file to our native format.

Sebi_11 wrote:
I have a second problem, but i don´t know if this is the right place of the forum to ask. If not please let me know where i can post it here.

In my test I also use V2 Codesys, which is also integrated in the Automation Builder of ABB. And i want to know if it is possible to read out the massages of Codesys V2 ether with python or cmd commands?

Please post this part in a suitable thread of the CODESYS V2 sub forum because in here the chance of an answer is not very high.

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 Nov 30, 2017 10:48 am 
Offline

Joined: Mon Nov 20, 2017 2:20 pm
Posts: 5
Hi Martin,

first of all thank you very much for your help.

I used your examplecode and now part of my script is working.

But i have a Problem to import DevDesc in XML Format.

If i run this code:
Code:
import scriptengine
source_list = scriptengine.device_repository.sources
allConvert = Guid('{C633F245-876F-45E8-AAB4-3FBD994C08B8}')
devId_ECAT = scriptengine.device_repository.import_device('S:\\Libraries\\ThirdPartyDevices\\Balluff BNI ECT 508 105 Z015 ECS V2.2.X IO-Link-Master.xml',source_list[0], allConvert)


The value of devId_ECAT of this is None, and the DevDesc isn´t imported.

Does the convert Guid work for XML DevDesc´s? Is it possible to import XML DevDesc?

Best Regards
Sebastian


Top
   
PostPosted: Thu Nov 30, 2017 4:03 pm 
Offline
Frequent User
Frequent User

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

Sebi_11 wrote:
But i have a Problem to import DevDesc in XML Format.

If i run this code:
Code:
import scriptengine
source_list = scriptengine.device_repository.sources
allConvert = Guid('{C633F245-876F-45E8-AAB4-3FBD994C08B8}')
devId_ECAT = scriptengine.device_repository.import_device('S:\\Libraries\\ThirdPartyDevices\\Balluff BNI ECT 508 105 Z015 ECS V2.2.X IO-Link-Master.xml',source_list[0], allConvert)


The value of devId_ECAT of this is None, and the DevDesc isn´t imported.

Does the convert Guid work for XML DevDesc´s? Is it possible to import XML DevDesc?

I found nearly the same device description of your code in the Internet and the script could import it without a problem.

Was there any error message in the Message view of CODESYS or anything else? Which version of CODESYS do you use?

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: Fri Dec 01, 2017 10:55 am 
Offline

Joined: Mon Nov 20, 2017 2:20 pm
Posts: 5
Hi Martin,

thanks again for your help and I found my mistake. I used the wrong path in the script :oops: .

Now, after i changed the Path, everything works fine :D .

Best Regards
Sebastian


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 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