Calling a DLL from an Embed diagram

The process of calling a DLL from an Embed diagram involves binding the DLL to a userFunction block and then wiring the userFunction block into the diagram. During simulation, each time the userFunction block is executed, Embed calls the DLL.

After you bind a DLL to a userFunction block, Embed renames the userFunction block with the DLL name. For example, if you created a DLL named AC Motor, Embed renames the userFunction block to AC Motor.

If you elected to retain connector labels when you created the DLL, you can display the labels on the userFunction block using the View > Connector Labels command. Connector labels make it easy to correctly wire a userFunction block into a diagram.

To bind a DLL to a userFunction block

1.    From the Blocks > Extensions menu, drag a userFunction block into your diagram.

2.    Choose Edit > Block Properties.

3.    Click the userFunction block.

The DLL Properties dialog box appears.

4.    Do the following:

      In the DLL File box, enter the complete file specification of the DLL. This name corresponds with name specified in the Result File box in the Code Generation Properties dialog box. If you are not sure where the DLL file resides, click Select to locate it.

      In the Base Function box, enter cgMain.

5.    Click OK.

To view connector labels on a DLL

      Choose View > Connector Labels.