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
myAction(S);
I get error during compilation.
How can I call an action with qualifiers in ST?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2019-01-24
Originally created by: scott_cunningham
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:
MyAction();
or
Done:=TRUE;
If you use the set qualifier (S), it would be something like this:
IFDoOnce=TRUETHENÂ Â MyAction();Â Â DoOnce:=FALSE;END_IF
or
IFDoOnce=TRUETHENÂ Â Done:=TRUE;Â Â DoOnce:=FALSE;END_IF
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What if I have impulse and I have a trigger. On raise I want to start action and perform it before other signal.
VARÂ Â xSignal1:BOOL;Â Â xSignal2:BOOL;Â Â xWork:BOOL;Â Â fbRT1:R_TRIG;Â Â fbRT2:R_TRIG;END_VARfbRT1(CLK:=xSignal1);fbRT2(CLK:=xSignal2);IFfbRT1.QTHENÂ Â xWork:=TRUE;END_IF;IFfbRT2.QTHENÂ Â xWork:=FALSE;END_IF;IFxWorkTHENÂ Â actMyAction();END_IF;
This simple task and code is huge. I hoped to shorten it few lines.
VARÂ Â xSignal1:BOOL;Â Â xSignal2:BOOL;Â Â xSignal1M:BOOL;Â Â xSignal2M:BOOL;END_VARIFfxSignal1ANDNOTxSignal1MTHENÂ Â actMyAction(S);END_IF;xSignal1M:=xSignal1;IFxSignal2ANDNOTxSignal2MTHENÂ Â actMyAction(R);END_IF;xSignal2M:=xSignal2;
That would really make some things simpler.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
I get error during compilation.
How can I call an action with qualifiers in ST?
Originally created by: scott_cunningham
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:
or
If you use the set qualifier (S), it would be something like this:
or
What if I have impulse and I have a trigger. On raise I want to start action and perform it before other signal.
This simple task and code is huge. I hoped to shorten it few lines.
That would really make some things simpler.
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 m