Execution Order in SFC module

Dear all,

I have an SFC type module with 20 objects (steps, transitions, etc). 3rd step in the sequrence stores some parameters.

If I put the parameters in FBD view, then they are still visible on SFC view. Since the number of parameters are many, I put them in a composite. The composite can also hold some logic blocks to do some calculations based on parameters.

But the composite (a function block in FBC view) shows execution order sequence number as "21". Will this block execute only after the sequence? Then I will have to add a cross-check in action confirm for parameter updates, & it will take 1 execution cycle to update the block. Is it possible to change the execution sequence order of the SFC objects, to accomodate the composite (or any other Function blocks) to execute in between the sequence (since sequence components are also counted in excution order numbering)?

This also raises the question about the sequence objects execution order. Is this order decided as per the sequence they are dragged in to the module? OR as per the logical connections of steps & transitions?

Thanks in advance for your responses!

Best Regards,

Amod.

 

6 Replies

  • Amod,

    Pretty sure that the SFC logic will always execute first and then the remaining blocks will be executed in the order shown
    - Although it's misleading because the number of steps and transitions is included in the execution numbers but they have no affect

    You can have the parameters be only shown in the parameter list instead of on the control algorithm area.
    - You can Re-create them by deleting and then right click in the parameter list and select "Add..."
    - More risky method of modifying the FHX to change x,y coordinates of the parameters to -100,-100 (see example below Delete in Red, Change to Blue)

    If you modify the FHX
    - you have to make the username or time stamp different in some manner, Example below I would just change user="Administrator" to user="administrator"
    - Backup you system/config before importing just in case

    MODULE TAG="SFC" PLANT_AREA="AREA_A" CATEGORY=""
     user="Administrator" time=1386262408/* "05-Dec-2013 10:53:28" */
    {
      DESCRIPTION="Control Module"
      PERIOD=1
      CONTROLLER=""
      PRIMARY_CONTROL_DISPLAY=""
      INSTRUMENT_AREA_DISPLAY="MOD_FP"
      DETAIL_DISPLAY=""
      TYPE=""
      SUB_TYPE=""
      ASSIGN_BLOCKS_TO_H1_CARD=F
      ATTRIBUTE NAME="PARAM" TYPE=FLOAT
      {
        CONNECTION=INTERNAL_SOURCE
        RECTANGLE= { X=30-100 Y=110-100 H=20 W=110 }
        CATEGORY { CATEGORY=COMMON }
      }

    Regards,

    Matt

  • In reply to Matt Stoner:

    Hi Matt,

    Thanks for the response!

    I tried to change the execution sequence & could set the composite block to execute at order #1 (Before the sequence components??). In FBD view, the set order button is enabled.

    I am aware of FHX file update methods, but could not find any info about execution order in the FHX file. My guess is, the execution order in FHX file is set by sequence in which the blocks are put in the code file; & upon import, they are created in that same sequence to reproduce the same execution order as original export. Though this is only theory & I have not yet tried it. I will check it later today.... may give me a way to execute the composite block in between the sequence steps... :-)

    Regards,

    Amod.

  • Amod,

    Yes the execution order is set by the order the blocks appear in the FHX.

    Regards,

    Matt
  • In reply to Matt Stoner:

    Amod,

    Would the composite block be executed when you desire by adding a Non-Boolean action to the SFC that refers to the composite block in the step you wish the assignments to be made?  An action block may be better - I'll have to try to see which if either works.

    J.D.

  • In reply to JDWheelis:

    Amod,

    That's right, a non-boolean action will execute a function block and keep it executing until get a reset action for that function block or SFC stop. This omit the execution order, in a SFC module the execution order is set from top to bottom and  left to right.

    Regards

  • In reply to lsocorro:

    Thanks guys...!

    I have added the non-boolean action, but just as a precaution, also have added a 1 cycle delay, whenever the composite is performing some calculations. This delay is before I read the calculation results in the next action. As for now, this is working fine. A few seconds added in the execution time, but I guess the application can accomodate it.

    I appreciate all your responses.

    Thanks.

    Amod.