2023年12月21日发(作者:)

Lab 11–Adding Auto Reconnect to DDESuiteLinkClient5-37Lab 11 –Adding Auto Reconnect to

DDESuiteLinkClientIntroductionInthislab, you will configure the $gDDESuiteLinkClient to automatically reconnect to the data source

when the connection is lost. You will do so by extending the objects with UDAs with scripts.

Using a UDA/script combination, you will also add additional diagnostic information that will indicate the

number of disconnects the object has experienced since it last went on ivesUpon completion of this lab, you will be able to:Create scripts in an objectCreate scripts with multiple execution typesAdd reconnect functionality to the $gDDESuiteLinkClient objectApplication Server2012

5-38Module 5 –Extending the ObjectsAdd the Auto Reconnect FunctionalityIn the following steps, you will create a script that will automatically reconnect to the data source when the

connection is the Template Toolbox,Globaltoolset, double-click $gDDESuiteLinkClientto open the

configuration the Scriptstab, click the the new script Reconnectand press ys Learning Services

Lab 11–Adding Auto Reconnect to ure the Reconnectscript as follows:Aliases:Declarations:Scripts: Execution type:BasicsExpression:

Trigger Period:Script bodylockedlockedExecute(default) tionstatus<>200:00:ect=true;This script will attempt to reconnect every 5 seconds when not connectedto the data ation Server2012

5-40Module 5 –Extending the ObjectsNow, you will validate the script syntax by using the Validatefeature. If the script has a syntax error, it will

appear in the yellow bar just above the script body area.

the right of the Execution typedrop-down list, click the ys Learning Services

Lab 11–Adding Auto Reconnect to the UDAstab, click the the new UDA press ure the as follows:Data type:Category: the Scriptstab, click the the new script rand press ation Server2012

5-42Module 5 –Extending the ure the rscript as follows:Aliases:Declarations:Scripts: Execution type:BasicsExpression:

Trigger type:Script bodylockedlockedExecute(default) tionstatus<>=+1;This script will increase a counter by one every time the condition is the ys Learning Services

Lab 11–Adding Auto Reconnect to DDESuiteLinkClient5-43You will now add code within the same script undera different execution type that will run when the object

goes on still in the rscript, change the Execution typeto the script body, type =0;.This script will reset the counter to zero every time the object goes on and closethe configuration the Commentfield of the Check Indialog box, type Reconnect scriptand click the Check Inprogress displays Object 1 or 1 completed, click oy PLCSim, leaving the default the Deployprogress displays 100% completed, click ation Server2012

5-44Module 5 –Extending the ObjectsView the Scripts in RuntimeNext, you will use Object Viewerto view the runtime data of the the Deploymentview, right-click PLCSimand select View in Object on the the following attributes to the watch window:e watch :Your instructor will now disconnect your connection to the Device Integration server, and then

reconnect the connection so that you can observe the Watch List now displays that there was a disconnect, but the connection has been ys Learning Services