Cicode Programming Reference > Cicode Function Categories > Dynamic Data Exchange Functions Introduction > DDEWrite

DDEWrite

Writes a value to an external Windows application, for example, to an Excel spreadsheet. The value is written once to the application. To write the value dynamically, you need to call this function at the rate at which the data needs to be updated.

Use DDEWrite() to cause CitectSCADA runtime to initiate the DDE conversation with a DDE compliant application running on the same computer.

Syntax

DDEWrite(sApplication, sDocument, sItem, sValue)

sApplication:

The application name (.EXE filename), for example, "WinWord".

sDocument:

The document, topic, or file name.

sItem:

A unique name for the item; for example, the variable name, field name, or spreadsheet cell position.

sValue:

The value of the item.

Return Value

The value that is sent to the other application, or an empty string if the function does not successfully write the value.

Related Functions

DDEExec, DDEPost, DDERead

Example

/* Write the value of a CitectSCADA variable named 
TAGONE to R1C1 (Row1,Column1) of an Excel spreadsheet named 
"Sheet1". The value is in string format. */
DDEWrite("Excel","Sheet1","R1C1",TAGONE);

See Also

DDE Functions