Sign in to follow this  
Followers 0
pszczepan

SFC - active action does not reset flag

7 posts in this topic

Hi ! I have such a code When the action is activated first I want to reset flag W400.15 if it is active. The problem is that this does not work and later transition checks if W400.15 is ON. Because it was not reseted code in the action is not executed. Do you have any explanation of that -how I can reset this flag once at the beginning of action? thanks Pawel Strange is that when switch POWER ON/OFF/ON to PLC and I set W400.15 manually before action is activated this code works and reset W400.15. It is just like some hazardous, but have no idea why. The flag W400.15 is only used in this action Edited by pszczepan

Share this post


Link to post
Share on other sites
Hello How is this bit being SET? Are you using a S action? If so, then this can ONLY be RESET with a R action qualifier in the same SFC. This is in the IEC61131-3 specification, I think. Incidentally, if you want to execute an action once as a step executes, use the P1 action qualifier. I love SFC! Pp Edited by ParaffinPower

Share this post


Link to post
Share on other sites
The First Scan Bit (P_First_Cycle) would be a better choice for your Reset than the P_On Bit you are using with the Differential RSET. It is hard to make other comments with the small snapshot you have shown us. Stu....

Share this post


Link to post
Share on other sites
Stu - I think the snippet of code is in an Action associated to an SFC step, so the First Cycle flag will have been and gone when it's executed.

Share this post


Link to post
Share on other sites
It is hard to tell from the little we can see, but that certainly could be the case. It appears to be an Omron PLC, and I haven't used SFC on an Omron, but you would think there would be tools for those kind of operations. I see there is also a P_First_Cycle_Task Bit, which I have never used. I presume it is used the first time a Task is executed. Thanks for the clarification. Stu....

Share this post


Link to post
Share on other sites
Seems to me that the reset will only execute if action is processed on the first scan?

Share this post


Link to post
Share on other sites
The code which I attached is a first line of some action in SFC. So, First scan bit will not work because action is activate much later. First cycle task will not work also, because all SFC code is in one task and the action is also activated later than first cycle task. Finally I splited action to two separate actions and action which should reset the flag is set as P1 action qualifier and the main action is set as D=1s qualifier It works - thanks ParaffinPower

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0