I'm running very simple test program and I'm having some issues with order execution. Please see following images for better understanding. I was able to get this to work by adding rising edge block to StopPB_ON transition, but I think that it should work with out it as well. Hopefully someone can explain why it does not.
Thank You
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you have race condition in the chart.
your Run_Mode step will get active state, but just for one cycle - that is why you did not notice that. In this cycle the upper branch is evaluated: the Run_Mode is now active and StopPB_ON is TRUE, causing that Stop_Mode jump (from upper branch) prepares Stop_mode to be active in the next cycle and Run_Mode to be inactive in the next cycle.
Regards
Roman
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
r.evbatyrov hat geschrieben:
Hi sverko,
you have race condition in the chart.
your Run_Mode step will get active state, but just for one cycle - that is why you did not notice that. In this cycle the upper branch is evaluated: the Run_Mode is now active and StopPB_ON is TRUE, causing that Stop_Mode jump (from upper branch) prepares Stop_mode to be active in the next cycle and Run_Mode to be inactive in the next cycle.
Regards
Roman
Hi Roman,
First of all thank you for taking time to answer my question. I think that by selecting/checking "Calculate active transitions only" should take care of race condition and force StopPB_ON condition under Auto_Mode to be the only active transition. I might be wrong, but I thought that this is the main purpose of this option.
Regards,
Sverko
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
no, it is not.
"Calculate active transitions only" is an option to skip the evaluation of unrelated transitions. So, this option has no influence on the chain's logic. The decision whether some transition is considered to be active depends on the state of step before it.
Regards,
Roman
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
r.evbatyrov hat geschrieben:
Hi sverko,
no, it is not.
"Calculate active transitions only" is an option to skip the evaluation of unrelated transitions. So, this option has no influence on the chain's logic. The decision whether some transition is considered to be active depends on the state of step before it.
Regards,
Roman
Hi Roman,
Could you please explain why attached file is working differently with addition of R_TRIG next to edge detection contact (StopPB_ON)?
your actual design problem is the transition StopPB_ON which appears twice on the diagram and will be evaluated in adjacent cycles, confusing the logic which step should be activated in the next cycle.
Adding R_TRIG to the transition code causes that the transition code will be evaluated TRUE on rising edge of xStopPB only - that means the transition is evaluated TRUE only once (for the transition element in the lower branch, preparing the Run_Mode step to be active in the next cycle). The second evaluation of the transition (in the next cycle from the the UPPER branch) will produce FALSE, preventing jumping to Stop_Mode. Without trigger the transition StopPB_ON would remain TRUE, causing jump to Stop_Mode.
Regards
Roman
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm running very simple test program and I'm having some issues with order execution. Please see following images for better understanding. I was able to get this to work by adding rising edge block to StopPB_ON transition, but I think that it should work with out it as well. Hopefully someone can explain why it does not.
Thank You
Hi sverko,
you have race condition in the chart.
your Run_Mode step will get active state, but just for one cycle - that is why you did not notice that. In this cycle the upper branch is evaluated: the Run_Mode is now active and StopPB_ON is TRUE, causing that Stop_Mode jump (from upper branch) prepares Stop_mode to be active in the next cycle and Run_Mode to be inactive in the next cycle.
Regards
Roman
Hi Roman,
First of all thank you for taking time to answer my question. I think that by selecting/checking "Calculate active transitions only" should take care of race condition and force StopPB_ON condition under Auto_Mode to be the only active transition. I might be wrong, but I thought that this is the main purpose of this option.
Regards,
Sverko
Hi sverko,
no, it is not.
"Calculate active transitions only" is an option to skip the evaluation of unrelated transitions. So, this option has no influence on the chain's logic. The decision whether some transition is considered to be active depends on the state of step before it.
Regards,
Roman
Hi Roman,
Could you please explain why attached file is working differently with addition of R_TRIG next to edge detection contact (StopPB_ON)?
Thanks,
Sverko
Test_11_22_16.project [158.56 KiB]
Hi Sverko,
your actual design problem is the transition StopPB_ON which appears twice on the diagram and will be evaluated in adjacent cycles, confusing the logic which step should be activated in the next cycle.
Adding R_TRIG to the transition code causes that the transition code will be evaluated TRUE on rising edge of xStopPB only - that means the transition is evaluated TRUE only once (for the transition element in the lower branch, preparing the Run_Mode step to be active in the next cycle). The second evaluation of the transition (in the next cycle from the the UPPER branch) will produce FALSE, preventing jumping to Stop_Mode. Without trigger the transition StopPB_ON would remain TRUE, causing jump to Stop_Mode.
Regards
Roman