Add Ports
You can create an arbitrary number of input and output ports. To create ports either use the appropriate tool buttons Add Input Port and Add Output Port, or use the shortcuts I for input port and O for output port. Alternatively click Edit on the main menu bar and select the appropriate options.
For this example we need two input ports and one output port:
- Select the Add Input Port button from the toolbar.
Your pointer has switched to a different mode. Every time you click in the grey rectangle of your module in the Model Editor window which represents the bounding box of your model, a port will be generated.
- Click on the side of the grey rectangle (bounding box) in the Model Editor window to create a new input port. It will be put near your cursor location. A second click creates a new input port. You may have to drag the ports to a suitable position if they are on top of each other for model instance. The ports Input1 and Input2 have been created.
- Switch back to the default pointer mode by right mouse click or by clicking the Select Tool icon.
- You can drag the newly created port and move it anywhere in your module view using the left mouse. The grey rectangle resizes automatically.
- Select the Add Output Port button from the toolbar.
- Click on the side of the grey rectangle (bounding box) in the Model Editor window to create a new output port.
Another method to create new ports is to press [ctrl] and then click on an existing port you wish to copy. You can now drag and drop the port you wish to duplicate. When using the context menu option Add Input/Output Port your mouse pointer will not change and one new port will be placed in the Model Editor window. The Edit menu works in the same way as the context menu.
We now need to change the properties of each port.
- Click on the first input port Input1. The Property Editor (in the lower left of your MLDesigner window) now displays the Port Properties of your port Input1.
- Next to Data Type click on the anytype entry and change it to float.
- You can change the name from Input1 if you like.
- Repeat the procedure for Input2 and Output1 changing the Data Type to float for all ports.