SFC Action Implemented as SFC

don
2009-08-31
2009-08-31
  • don - 2009-08-31

    Hello,

    I am writing a program in which the main sequence is controlled by a 'Main' POU written in SFC using IEC Steps. There is a step within the Main POU called 'Drive'. There is a (N)on-stored action associated with the Drive step called 'DriveToBay', which is written in SFC. I am finding that when the Main POU returns to the Drive step, the DriveToBay SFC action continues from the step that it was running previously (i.e., it does not start from the Init step). I would like it to start from the Init step. The documentation tells me this can be achieved by setting the SFCInit variable, but I do not know how to access the variable when the SFC resides within an SFC action.

    Any help greatly appreciated.

    Don.

     
  • don - 2009-08-31

    Ok, found a solution. I implemented the 'DriveToBay' SFC within a separate program POU. I declared SFCInit as a boolean input variable for the POU. I then called the DriveToBay POU from an action written in FBD within my Drive step. I set the SFCInit input variable to 'NOT Drive.x'. Seems to be working well. If there are any better solutions, please let me know.

    Best regards,

    Don.

     
  • t.lundahl - 2009-08-31

    don hat geschrieben:
    I declared SFCInit as a boolean input variable for the POU.

    As a tip is to read up on SFCReset as well, they work almost the same, the SFCReset will actually execute the Init step earlier than SFCInit.

    /TorbjΓΆrn

     

Log in to post a comment.