CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Wed Oct 18, 2017 11:13 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Feb 01, 2006 11:34 pm 
Hi!

Is it possible to write a control algorithm (or something) in e.g. c-language and then wrap it as a function block in codesys?

BR,

JuPe


Top
   
 Post subject:
PostPosted: Mon Feb 06, 2006 12:01 pm 
Offline
Site Admin
User avatar

Joined: Mon Jan 31, 2005 10:48 am
Posts: 185
Yes, in general you can link C code as so called external library.

See the attached file for details.

But please note that the device has to be prepared for that method. So you can try the described method, or in case it does not work, please contact your OEM.


You do not have the required permissions to view the files attached to this post.

_________________
Roland Wagner
Moderator


Top
   
 Post subject: hierarchical fb's?
PostPosted: Tue Feb 07, 2006 11:15 am 
How about hierarchical function blocks? Can I create a new function block as a composition of other (basic or composite) blocks? Can this be saved as a new block type or re-used in some other way?

Best Regards,
JuPe


Top
   
 Post subject:
PostPosted: Tue Feb 07, 2006 11:27 am 
Offline
Site Admin
User avatar

Joined: Mon Jan 31, 2005 10:48 am
Posts: 185
Yes, of course, but with some limitation.

In CoDeSys you can call existing function blocks (no matter whether they are developed in CoDeSys or C) and create new function blocks out of them. And you can save these new function blocks in libraries.

In a C routine implemented as a function block in an external librariy you can of course call other C routines. But you cannot call another CoDeSys function blocks out of such a C routine.

Typically spoken you will install a set of C routines within one (or several) external libraries as a kind of C layer. In CoDeSys you will include those libraries and access to the routines as function blocks, functions or programs and combine them together in POUs. These POUs can as well be saved as a library, but this time as an (internal) CoDeSys library. As soon as you open this new CoDeSys library the referenced external libraries will automatically included into the project (of course the directory settings have to fit).

_________________
Roland Wagner
Moderator


Top
   
PostPosted: Tue May 02, 2017 1:02 pm 
Offline

Joined: Wed Apr 16, 2014 9:10 am
Posts: 1
Hi,

Is this method also working in Codesys V3.x ?
Or is it only possible in V2.3 ?

thank you.


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 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