Copying a Block in a Block

You can copy partially or totally the elements of a block into another block. It is particularly useful to copy the elements of a block defined in a library into MainBlock.

This command is only available in the context of a Functional or Logical component. It is not available for the edition of a library.

To show the functionalities of this command, you will use a library containing two blocks Counter and MainCounter. MainCounter instantiates Counter. The aim of the task is to duplicate the behavior of the library into the Functional or Logical behavior.


Before you begin: A Functional or Logical representation must be opened in the State Logic Modeling workbench.
Related Topics
LCM Tools Toolbar
  1. Insert the library into a Functional/Logical behavior (see typical example below).



  2. Select the Counter block and press Ctrl+C to copy it.

  3. Select Internal Content and press Ctrl+V to paste the block.



  4. Click Yes. The block Counter is added to Internal Content.



    Now, you can copy the content of MainCounter into MainBlock.

  5. Select Copy Block in Block .

    The following dialog box appears.



    1. Select the Source Block by clicking MainCounter in the RFLP tree.

    2. Select the target by clicking MainBlock in the RFLP tree.

    3. Select the Copy Connexions checkbox. The other boxes for copying ports, signals and instances are automatically selected because connections cannot be copied without the elements mapped to its connections.

    4. Select the Copy Behavior checkbox. If the type of the target block is not the same as the source block, the type of the target block will be converted to the one of the cource block. This option will also copy the SFC+ graph or the State chart.

  6. Click OK.



    All the Port, Signal, Instance and Behavior elements of MainCounter are copied into MainBlock. Note that the kind of the block is changed, the Dataflow block is converted to a State Chart block.

    Important: The elements copied are not added to the target block, they replace the exiting ones.

  7. You can delete the library from the RFLP tree. The behavior of the MainCounter is now copied to the Functional Component.