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

DDEPost

Makes a CitectSCADA variable value available for DDE linking (that is posts a DDE link so that it can be read by other DDE compliant applications running on the same computer). This sets-up CitectSCADA to behave as a DDE Server for this DDE channel.

After a value is posted, other Windows applications running on the same computer can read the value by using their own DDE Client functions. If the value of the posted variable changes, any linked applications are informed of the new value.

To link to this value from any DDE Client applications running on the same computer, they need to appropriately use the DDE Client syntax with:

Unlike the DDERead() and DDEWrite() Cicode functions which are static, the DDEPost() function can be used to create a dynamic DDE link, providing the DDE Client applications appropriately set their side of the DDE channel to be automatically updated.

Syntax

DDEPost(sItem, sValue)

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 posted, or 0 (zero) if the function does not succeed in posting the link.

Related Functions

DDEExec, DDERead, DDEWrite

Example

! In Citect Project Editor, create a variable tag named PV1
! In Cicode, post a link to the tag PV1 for external DDE applications to connect with DDEPost("TAGONE",PV1);
/* To link to this posted tag from a cell in Excel, set the cell to
=Citect|Data!TAGONE. This will set the value of the Excel cell to the value of tag PV1. */
/* To link to this posted tag from a field in Word, set the field to{DDEAuto Citect Data TAGONE}. This will set the value of the field link to the value of tag PV1. */

See Also

DDE Functions