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 Jun 25, 2019 8:58 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Wed Jul 27, 2011 1:06 pm 
Offline

Joined: Sat Oct 24, 2009 7:37 am
Posts: 13
Hi all,

I am a little confused about what the actual place of python is. Is it anohter language that we can write control programs in? And will we be able to use it to make GUI for machine control?

Thanks,

_________________
Russell Gee
Manmachine Pty Ltd
www.manmachine.com.au


Top
   
PostPosted: Wed Jul 27, 2011 1:17 pm 
Offline
Site Admin
User avatar

Joined: Mon Jan 31, 2005 10:48 am
Posts: 222
As you can read under http://forum-en.3s-software.com/viewtopic.php?f=18&t=1889 Python is meant to be a script language for the automation of development steps while working with CoDeSys. Thus it replaces the former batch mode for exactly the same task. And it thus can not be used as another language for the programming of the control applications.

Typical applications for the use of Python in connection with CoDeSys are
  • automation of import/export of externally saved POUs
  • automation of test or commission routines
  • automation of all other development steps that you will use regularly in exactly the same way. You could regard it as a macro language.

_________________
Roland Wagner
Moderator


Top
   
PostPosted: Wed Jul 27, 2011 1:58 pm 
Offline

Joined: Sat Oct 24, 2009 7:37 am
Posts: 13
Thanks Roland,
I work with several devices that use the CoDeSys enviroment. For example Bosch Rexroth PLC, ABB PLC, SEW PLC, Festo PLC. I develop programs for machines using these platforms. Is python going to help me? Or is it more aimed at the developers who are developing for platforms loke those above?
And if it can help me what are some practical examples of what it can do?

Regards,

_________________
Russell Gee
Manmachine Pty Ltd
www.manmachine.com.au


Top
   
PostPosted: Wed Jul 27, 2011 2:58 pm 
Offline
Frequent User
Frequent User
User avatar

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

Python scripting won't help you with the writing of code itsself. But it can help to automate several steps during deployment. Some examples of what can be done can be found in this forum: http://forum-en.3s-software.com/viewtopic.php?f=18&t=1890

Another example was a script which connected to a device, read some variables, and then sent those values via email.

You can also call CoDeSys from a windows batch file and command it to execute a script (with the parameters --runscript and --noUI), so you can automate some tasks (e. G. via the windows task scheduler or on a continous integration server).

One use case is for an OEM which uses the scripts to create tailored codesys projects out of machine configurations.

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

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


Top
   
PostPosted: Wed Jul 27, 2011 3:00 pm 
Offline
Site Admin
User avatar

Joined: Mon Jan 31, 2005 10:48 am
Posts: 222
Hi,

at first you have to be aware that Python is only available in CoDeSys V3. Probably most of the devices you have mentioned still work with CoDeSys V2.3. CoDeSys V3 is not downward compatible, thus you will not be able to benefit from Python inside CoDeSys.

In order to get an idea how Python can help you could check the examples under http://forum-en.3s-software.com/viewtopic.php?f=18&t=1906 and http://forum-en.3s-software.com/viewtopic.php?f=18&t=1890.

In general as already mentioned Python is useful for automatically executing commands of the development environment, such as

open project
import POU xxx
set communication to device xxx
login
download the application
write certain values to certain variables
logout
save project

(of course this is a rough abstraction of the code :!: )

Imagine you have to do that exactly in the same way for several time, e.g. at a series of machines with the same application and PLC (which are not connected in one single network) - with a Python script you could execute the whole batch of commands with one click (and without becoming crazy after the 10th repetition... :D ).

I hope this will help you to have an idea how Python can accelerate your work.

_________________
Roland Wagner
Moderator


Top
   
PostPosted: Wed Jul 27, 2011 3:06 pm 
Offline

Joined: Sat Oct 24, 2009 7:37 am
Posts: 13
Thanks Gents,

I will see when somthing arises I have some further questions re V3 and V2 comaptibility. I will post these on the V3 Forum

_________________
Russell Gee
Manmachine Pty Ltd
www.manmachine.com.au


Top
   
PostPosted: Mon Jan 09, 2012 2:07 pm 
Offline

Joined: Wed Dec 28, 2011 4:07 pm
Posts: 1
Quote:
Typical applications for the use of Python in connection with CoDeSys are
  • automation of import/export of externally saved POUs
  • automation of test or commission routines
  • automation of all other development steps that you will use regularly in exactly the same way. You could regard it as a macro language.



Hello,

you listed above that it´s possible to use Python for automation of test? How did you mean that? I ´m interested in how Python could be used as a test tool. Did you mean that through a Python Script I´m able to write variables in the debug - mode and doing so I´m able to test for example a certain Function_Block?

Greetings.


Top
   
PostPosted: Tue Jan 10, 2012 9:08 am 
Offline
Frequent User
Frequent User
User avatar

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

daflodedeing wrote:
you listed above that it´s possible to use Python for automation of test? How did you mean that? I ´m interested in how Python could be used as a test tool. Did you mean that through a Python Script I´m able to write variables in the debug - mode and doing so I´m able to test for example a certain Function_Block?


Yes, you can read, write and force variables using python scripts. Under the hoods, this uses the same CoDeSys monitoring mechanism which is also used in the online POU editors and the Watch window. So, for example, you can write python scripts which download and start an application, and then sets some input variables, waits, and verifies the output variables.

We're also currently working on a CoDeSys-Add-On called "Testmanager" which specifically supports test automation, but there's no official release date yet.

HTH,
Markus

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