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