SFC Control Module .FHX Export/Import

Hello,

I'm currently trying to generate copies of a few Command Driven Control Modules; the sequences are quite complex so instead of copy pasting the modules and manually going into each SFC Step to edit the contents, I'm trying to do an .FHX export and carefully search/replace the parameters I need to change. The problem I have encountered is the following:

The field "FUNCTION BLOCK DEFINITION: Name: __#####_#####__" inside the .FHX file, which identifies each SFC-based composite block (COMMAND Block) seems to be auto generated when the Control Module and its components are first created. So even if I was to create a copy of the original Command Driven Control Module, export it as an .FHX, search/replace its contents, and then re-import it, it also updates the contents of the SFC Steps in the original Command Driven Control Module, this makes sense as the Function Block Definition Names of the COMMAND Blocks are the exact same on both Command Driven Control Modules.

I'm curious to know if there a way to uniquely identify the COMMAND Blocks' Function Block Definition Names of the new the module copy? I have not tried to manually change the numbers to something random, as this could cause issues if the Function Block Definition Name is already being used by another module.

Any thoughts, help, or comments would be appreciated.

Thank you,

Jaime M.

  • What you are asking for is very risky (won't be supported) and you could potentially lose configuration and/or corrupt the database if you don't do this correctly (which is why it wouldn't be supported).

    Can you use a Command Driven Class and then just link the module blocks to the correct item needed?

    If the logic is staying the same and you are only changing module names then I would definitely suggest using this method instead. You can even IGNORE module blocks for cases that don't have "exactly" the same equipment. To learn more about this method, In Books Online you can go to

    • Configuration -> Module Reference -> Equipment module example
    • Configuration -> Batch -> Batch Tutorial -> Equipment definition -> Equipment module classes
  • In reply to Matt Stoner:

    I agree with Matt.
    If I were you (Jaime) I will create class-based Command Driven Module, and Control Modules for field equipment.
    I dont know how looks your sequnece (actions, transitions, monitors) and DIAGRAM
    If we need to use the same logic (but different field equipment) best way is using something like alliases linked to field equipment.
    Actions and transitions should contain alliases - not real equipment names.
    Next is to create CDMs to each unit, and you need only to bind proper devices (equipment) to alliases.
  • In reply to Matt Stoner:

    Due to time constrains, it would be more efficient to edit the .FHX file than turning all the sequences to class-based, and editing their parameters to be used in a class-based environment. The sequences and the equipment are the exact same, all I'm doing is literally adding a prefix to a lot of the tags/names.

    I'm now considering a few options; some feedback or opinions would be appreciated:

    A) Create a new Command Driven Control Module (Let's call it Mod-A) based on the exact same Named-Set that the original Command Driven Control Module is using. This would generate new Function Block Definition Names, which I can use to edit my .FHX file. I would then delete Mod-A, and re-import my .FHX file. Hopefully this would create new COMMAND blocks, instead of updating the original ones. Only downside is, I'm not familiar with how DeltaV Explorer keeps track of the Function Block Definition Names, so I'm not sure if this would cause more grief.

    B) Create a copy of the original Command Driven Control Module, go into each COMMAND block, and manually update all fields with the new prefix. This is less preferred as it would be very time consuming, and since the COMMAND Blocks would have the same Function Block Definition Names, it would probably also update the original Command Driven Control Module (Unless, manually editing the contents COMMAND Driven Control Module, auto-generates new Function Block Definition Names).

    C) Create a new Command Driven Control Module (Let's call it Mod-A) based on the exact same Named-Set that the original Command Driven Control Module is using. This would give me the full lay-out of the module. I would then copy and paste the contents of each COMMAND Block from the original into Mod-A, export my new Command Driven Control Module into an .FHX, modify it, and then re-import.

    I should mention, I am running this on a lab set-up with complete virtualization. So any problems encountered while testing this can easily get reverted. I would make sure the modules are fully tested before being deployed to the real applications.

    Thank you!
  • Hi Jaime

    Matt and Roman gave you good practice to be sure of the result.
    Anyway, if you plan to duplicate and modify FHX file, you have to take some précautions :
    - Inside DV explorer, when you duplicate a SFC (SFC, PLM, ...), what you see in the copied item is an alias of the original.
    So, if you modify it, you will modify the original item too.
    To embed the SFC parts individualy :
    - Open the copy in DV Explorer and practice an very little modification, like a Step or a Transition move graphicaly.
    - Do that in each SFC part. For example, il you copy a PLM, you have SFC for each RUN, ABORT, STOP, ... part
    - When it's done, you can export the copied and mofified module to a FHX file.
    Use a serious text editor to enter and modify the FHX file (for example, Notepad++)
    - In the file, when you have identified the part you want to modify, have a look to the first line :
    It looks like that :
    MODULE TAG="SEQUENCE-EXAMPLE" PLANT_AREA="AREA_A" CATEGORY=""
    user="scott" time=841953881/* "05-Sep-1996 15:04:41" */
    To be sure the import operation to proceed, add 10 seconds to the "time=" parameter.
    The import sofware will see a date that is younger than the last modified module date it knows, so it will ask for import.

    I repeat the recommandations of Matt : Be very attentive and, of course, perform a database backup before import new risky data.
  • As said by others this is very risky. I recommend using class based approach.

    Consider using an isolated DeltaV system ( a single proplus) to import, check, and manually adjust manipulated FHX . Then export items from this isolated system and import into development system.

    Regarding SFC command composites identificator (__#####_#####__); note that this string is changed by deltav when a COMMAND is edited, even if you only open COMMAND into control studio DeltaV will change this identificator if EQM is saved. So, if after importing modifed FHX you open imported class with Control Studio you click on all commands and then you save the class all those identificators will be changed.
  • In reply to Jaime M.:

    You may not have time now but if you need to make a change you will be making X number of the same change, I would still think it's in your best interest to go the class based route.

    In addition to what Jack has documented, You need to touch every composite that isn't linked that you expect to make changes so don't forget the MONITOR for EM and any composite within these composites as well.

    You don't have to change the time in the FHX, you can leave that the same and just change the User to be different that it currently is and it will prompt on import if you want to update (changing a single character to upper or lower case will do)...say yes on import :)
  • In reply to Jack_France:

    Thank you for the answer Jack, this worked great. Also, It's good to note that like Matt said, changing the time stamp is not required, a change to the "User" name field does the job.