Creating ports programmatically

This topic describes the advanced-level APIs used when programming with ports. You use these APIs when the code generator cannot determine how to instantiate the ports. This situation occurs when the port multiplicity is *.

About this task

By default, ports are created by value. However, if at design time you do not know how many ports there will be (multiplicity of *), you can create the ports programmatically.

For example, to instantiate 10 of the src ports, use the following call:

for (int i=0; i<10; ++1) {
     // instantiate and add to the container of the owner
     newSrc();
}

Feedback