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 Wed Feb 19, 2020 7:49 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Jan 24, 2020 3:43 pm 
Offline

Joined: Sun Jan 12, 2020 4:19 pm
Posts: 5
Hi,
First steps in codesys...
Is there an equivalent to IF-Then-Else or Case in the FBD language? It seems to exist in the ST and I naively assume the you could do in FBD the same as in ST. :)
thanks, J.


Top
   
PostPosted: Fri Jan 24, 2020 5:43 pm 
Offline

Joined: Wed Jan 08, 2020 1:50 pm
Posts: 19
For IF-THEN-ELSE:
SEL is an idiomatic way, if (and only if) the two branches do not have side effects.
An ugly way is using a chain of boxes each with EN/ENO.
But please, even if you can write a FOR loop in Ladder, it does not mean it is a good idea. If you are unable to avoid side effects in branches, it is better to stay in ST: the resulting code will be more clear to others (including your future self).


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 2 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