Write value when screen is opened and closed

<< Click to Display Table of Contents >>

Navigation:  Examples > Change tag's value >

Write value when screen is opened and closed

Previous pageReturn to chapter overviewNext page

In this example, we'll show how to record a value when opening and closing a screen.

 

1. Create a tag named Tag:

 

tagvalue

 

2. Let's create 2 screens - General and Popup. On the general screen we will place a button that will open the Pop-up screen and on the pop-up screen we will place a button to close the pop-up screen:

 

generalscreen

popupscreen

 

3. Let's create 2 scripts of the Screen type. One is executed when the popup screen opens. The second one is executed when the popup window is closed:

 

closescript

openscript

 

Let's write scripts:

 

closescripttext

openscripttext

After you have recorded the script, be sure to launch it by clicking the button on the toolbar: runsimulation

 

4. Let’s link these scripts to the pop-up screen:

 

clip0050

screenproperties

 

5. Run simulation to check the settings:

 

writeopenclose

 

You can download this project here.