Applies To:
  • CitectSCADA 5.xx

Summary:
I am using a DDE link between Citect and a purpose build application. The DDE transfer works using DDEExec() to run functions within each of the two DDE clients. The link between the two clients uses a form of hand shaking to synchronise the transfer of data. ie the non Citect application calls a Cicode function to transfer data and Citect responds with a similar call to acknowledge that the message was received. The problem is that the slow response time causes the non Citect application to timeout during the download loop. I have used DDeSpy to determine that the delay appears to occur between the DDE message being posted by the non Citect app and when the Cicode function is run to process the data. What may be causing this delay?  

Solution:
In V5.xx the way that Cicode functions are executed from DDE has changed. In older Citect versions when a Cicode function was called from DDE then the function would execute without first reading any data from the PLC. This could cause the Cicode function to access stale data and a ReRead() in the function was necessary to avoid this. In the current version all the PLC data required in the Cicode function will be read before the function starts executing. If the Cicode function touches a large number of PLC tags and the PLC communications are slow, this could delay the start of the function.

Check what PLC tags your function is touching and keep this to a minimum. Also, make sure your data is blocked optimally in your PLC. If you don't want the Cicode to read from the PLC first then create a stub Cicode function which you call via DDE. This function will simply call TaskNew() to your main Cicode function.

 

Keywords:
 

Attachments