DDEPost
- Last UpdatedJul 18, 2023
- 2 minute read
Makes a Plant SCADA variable value available for DDE linking (which means it posts a DDE link so that it can be read by other DDE compliant applications running on the same computer). This sets up Plant SCADA to behave as a DDE Server for this DDE channel.
Note: This function is disabled unless the parameter [DDE]Enable is set to 1 in the Citect.ini file.
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:
-
"Citect" as the <DDE Server application name>
-
"Data" as the <DDE Topic name>
-
The name used for the first parameter sItem in this DDEPost() function as the <DDE data item name>.
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 empty string if the function does not succeed in posting the link.
Related Functions
Example
! In Cicode, post a string "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 string "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 string "PV1". */
See Also