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 Sat Dec 07, 2019 5:27 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Dec 10, 2018 12:05 pm 
Offline

Joined: Tue Apr 24, 2018 11:57 am
Posts: 4
In SFC I can call action with qualifiers like P0, R, S, N, LD, ... It means that there is a way to apply qualifier to action, but in ST if I can action like

Code:
myAction(S);


I get error during compilation.

How can I call an action with qualifiers in ST?


Top
   
PostPosted: Thu Jan 24, 2019 10:29 pm 
Offline
Frequent User
Frequent User

Joined: Fri Sep 02, 2011 8:02 pm
Posts: 309
ST doesn't work that way. The IEC qualifiers are really replacement for ST code to make SFC easier to manage (LD has some similar items).

For example, and IEC action (action code or boolean var) without a qualifier looks like this in ST:

Code:
MyAction();

or

Code:
Done := TRUE;


If you use the set qualifier (S), it would be something like this:

Code:
IF DoOnce= TRUE THEN
   MyAction();
   DoOnce := FALSE;
END_IF


or

Code:
IF DoOnce = TRUE THEN
   Done := TRUE;
   DoOnce := FALSE;
END_IF

_________________
Scott Cunningham
KEB America, Inc.
www.kebblog.com
www.kebamerica.com


Top
   
PostPosted: Fri Feb 01, 2019 4:14 pm 
Offline

Joined: Tue Apr 24, 2018 11:57 am
Posts: 4
What if I have impulse and I have a trigger. On raise I want to start action and perform it before other signal.

Code:
VAR
    xSignal1: BOOL;
    xSignal2: BOOL;
    xWork: BOOL;
    fbRT1: R_TRIG;
    fbRT2: R_TRIG;
END_VAR

fbRT1(CLK := xSignal1);
fbRT2(CLK := xSignal2);

IF fbRT1.Q THEN
    xWork := TRUE;
END_IF;

IF fbRT2.Q THEN
    xWork := FALSE;
END_IF;

IF xWork THEN
    actMyAction();
END_IF;


This simple task and code is huge. I hoped to shorten it few lines.

Code:
VAR
    xSignal1: BOOL;
    xSignal2: BOOL;
    xSignal1M: BOOL;
    xSignal2M: BOOL;
END_VAR

IF fxSignal1 AND NOT xSignal1M THEN
    actMyAction(S);
END_IF;
xSignal1M := xSignal1;

IF xSignal2 AND NOT xSignal2M THEN
    actMyAction(R);
END_IF;
xSignal2M := xSignal2;


That would really make some things simpler.


Top
   
PostPosted: Sun Feb 03, 2019 11:33 am 
Offline
Frequent User
Frequent User

Joined: Thu Mar 17, 2016 1:24 pm
Posts: 195
Check this:
https://help.codesys.com/webapp/_cds_ex ... n=3.5.14.0
https://help.codesys.com/webapp/_cds_ex ... n=3.5.14.0

_________________
Make CODESYS great again


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