Creating a two-way link with DDE

The DDE block is a combination of the DDEreceive block and DDEsend block: the DDE block can both send and receive information. As a server, the DDE block passes source information to another application to work on. As a client, the DDE block receives updated information back from the application.

To create a two-way DDE link

Use this procedure when you want Embed to fill in the name of the server and topic pair of the destination application.

1.    In the application, select the information you want linked to your block diagram, and choose Edit > Copy (CTRL+C).

The information is copied to the Clipboard.

2.    Switch to Embed and open the block diagram in which you want to link the copied information.

3.    Insert a DDE block in the work area.

4.    Right-click the DDE block or choose Edit > Block Properties and click it.

The DDE Link Configure dialog box appears.

5.    Choose Paste Link and the additional options you want. (See dialog box below.)

6.    Click OK, or press ENTER.

7.    In Embed, wire the block (containing the information you want linked to the other application) to the DDE block.

8.    Right-click the DDE block.

The DDE Link Configure dialog box appears.

9.    In the Send Item box, enter a unique name.

10.  Choose Copy Link and the additional options you want. (See dialog box below.)

11.  Click OK button, or press ENTER.

12.  Switch back to the application file.

13.  Move the insertion point to where you want to insert the information and click.

14.  Choose Edit > Paste Link.

Note: Some applications have a Paste Special command instead of a Paste Link command. Refer to the application's documentation for information on linking.

Bitmap: Applies a bitmap image to the DDE block. If you do not know the name, click Image to select one.

Custom Update Interval: Overrides the time step interval for sending and receiving information. If you enter 1, DDE requests and sends information once per sec; if you enter 10, DDE requests and sends information once every 10 sec; and so on. If you do not enter a value, DDE updates at each time step of the simulation.

Data Timeout: Indicates the time, in sec, that Embed will wait to receive simulation time step data from the client. The default is 2 sec.

Output Dimension: Controls the dimensionality of the data entering and exiting the block. The choices are scalar, vector (n x m), or matrix (m x n).

Poke Data: This option does not apply to the DDE block.

Receive Item: Indicates a name that references cells, cell ranges, values, or a field of data in the source file. For example, R1C1 references the information in the cell occupying row 1, column 1 of an Excel spreadsheet.

If the source application supports Copy Link, Embed automatically fills in this parameter when you click Paste Link.

If the source application does not support Copy Link, you must enter the same name that the source file uses as its item name.

Send Item: Indicates a name for the source information. The destination file uses this name for its item field. To maintain multiple DDE links from a single block diagram, the name you enter must be unique. The information in this box defaults to simDataIn.

Server|Topic: Indicates the name of the application (server) and the type of information (topic) to which you’re establishing a link. For example, VBDDE|NNET sends data to and receives data from the application called VBDDE on the NNET topic. Use the pipe (|) character to separate the server from the topic.

Synchronous Operation: This option does not apply to the DDE block.