Gianca
Good day everyone!

  What is the meaning of the box "execution order" when double click on a function?
  How does it work?

Thanks in advance.

Gianc.

   Execution Order.png
Reply 0 0
thiagoralves
This literally changes the order in which blocks are executed. If you set them all to zero, they will be executed in the order of the diagram (top to bottom, left to right)
Reply 1 0
Gianca

Thanks,

 I asked this because I sometimes have problems with order execution. I made following example to try to clarify ... Test02.png 

 This code uses two functions, "MySet" and "Myreset" to set and reset "ADD_RQ". On rising edge of "HMI_BUTTON", counter "VAL" should increment by one. The problem is that this code is translated in this way:

PROGRAM program0
VAR
ADD_RQ : BOOL;
HMI_BUTTON : BOOL;
VAL : DINT := 0;
ADD7_ENO : BOOL;
ADD7_OUT : DINT;
R_TRIG1 : R_TRIG;
MySet16_ENO : BOOL;
MySet16_OUT : BOOL;
MyReset4_ENO : BOOL;
MyReset4_OUT : BOOL;
END_VAR

ADD7_OUT := ADD(EN := ADD_RQ, IN1 := VAL, IN2 := 1, ENO => ADD7_ENO);
IF ADD7_ENO THEN
VAL := ADD7_OUT;
END_IF;
R_TRIG1(CLK := HMI_BUTTON);
MySet16_OUT := MySet(EN := R_TRIG1.Q, clk := ADD_RQ, ENO => MySet16_ENO);
MyReset4_OUT := MyReset(EN := ADD_RQ, clk := ADD_RQ, ENO => MyReset4_ENO);
END_PROGRAM

As you can see it seems that custom functions are executed at the end. Originally "Execution Order" were all set to zero, after i tried to change it with no success. I use PLC simulation only. On attachments there is my test project. Hope this help.

Rgds,

  Giancarlo.

Reply 0 0
kortenbach
I noticed the same thing. The picture below shows the exection order in the generated_plc.st file:
 
[203128%2F9131152%2Fmceclip0]
 
I think that this is a bug(?)
 
Changing the execution order doesn't provide a workaround because the changes are not saved, so the execution orders remain 0.
Reply 0 0
thiagoralves
Yes, this is a bug. It seems to follow the creation order instead of the position order. Unfortunately I don’t have plans to fix this as our attention has focused mostly on the new editor.
Reply 0 0
kortenbach
Hi Thiagor,
Pity...
I found a work-around: Cut and paste the code starting from the top and working towards the bottom.
A more elegant work-around would be welcome :-)
Reply 0 0
bosmutus
Hi Thiagor,
Pity...
I found a work-around: Cut and paste the code starting from the top and working towards the bottom.
A more elegant work-around would be welcome :-)
this is a trick,but it works,hope new editor can solve it
Reply 0 0
thiagoralves
The new editor will have that fixed for sure. The FBD implementation is being rewritten from scratch.
Reply 0 0
Reply