<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Parameters Archives | DMC, Inc.</title>
	<atom:link href="https://static.dmcinfo.com/blog/tag/parameters/feed/index.xml" rel="self" type="application/rss+xml" />
	<link></link>
	<description></description>
	<lastBuildDate>Thu, 09 Jul 2026 19:30:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.2</generator>

<image>
	<url>https://static.dmcinfo.com/wp-content/uploads/2025/04/site-icon-150x150.png</url>
	<title>Parameters Archives | DMC, Inc.</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Using Dollar Parameters, Events and Extended Properties in Siemens WinCC OA</title>
		<link>https://static.dmcinfo.com/blog/21605/using-dollar-parameters-events-and-extended-properties-in-siemens-wincc-oa/</link>
		
		<dc:creator><![CDATA[DMC]]></dc:creator>
		<pubDate>Thu, 16 May 2019 09:58:24 +0000</pubDate>
				<category><![CDATA[HMI and SCADA]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Parameters]]></category>
		<category><![CDATA[WinCC]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/21605/using-dollar-parameters-events-and-extended-properties-in-siemens-wincc-oa/</guid>

					<description><![CDATA[<p>WinCC OA is a SCADA development platform created by Siemens. It took me a little while to get comfortable with the different properties when building panels on my first project, so I am attempting to give an overview of the different types of properties, and what their uses are. Many default properties are built into [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21605/using-dollar-parameters-events-and-extended-properties-in-siemens-wincc-oa/">Using Dollar Parameters, Events and Extended Properties in Siemens WinCC OA</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><a href="/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming/siemens-simatic-wincc-programming">WinCC OA</a> is a <a href="/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming">SCADA development</a> platform created by Siemens. It took me a little while to get comfortable with the different properties when building panels on my first project, so I am attempting to give an overview of the different types of properties, and what their uses are.</p>



<p class="wp-block-paragraph"><a href="/latest-thinking/blog/id/9871/getting-started-with-wincc-oa-part-2--folder-structure-gedi-layout">Many default properties</a> are built into shapes, text boxes, and other objects. These include background colors, borders, size, margin, to name a few. These properties can be found in the <strong>Property Editor</strong> window when a panel is selected.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Image-1-R.png" alt="property editor in OA"/></figure>



<p class="wp-block-paragraph">Several additional properties can be utilized in WinCC OA to allow for flexibility and control over the look, interaction, and dynamics of a panel.</p>



<p class="wp-block-paragraph">The properties I am going to focus on in this overview include:</p>



<ul class="wp-block-list">
<li><strong><a href="https://static.dmcinfo.com/latest-thinking/blog/id/9881/using-dollar-parameters-events-and-extended-properties-in-siemens-wincc-oa/#extended-properties-in-oa">The Extended Property</a></strong></li>



<li><strong><a href="https://static.dmcinfo.com/latest-thinking/blog/id/9881/using-dollar-parameters-events-and-extended-properties-in-siemens-wincc-oa/#dollar-parameters-in-oa">Dollar Parameter</a></strong></li>



<li><strong><a href="https://static.dmcinfo.com/latest-thinking/blog/id/9881/using-dollar-parameters-events-and-extended-properties-in-siemens-wincc-oa/#events-in-oa">Event Script</a></strong></li>
</ul>



<p class="wp-block-paragraph">As an example project, I have created a simple panel consisting of a white square and a text field. I want to control the color and text of the panel. The square panel can also cause a popup window to appear when clicked. The popup window allows you to toggle a Boolean data point element the square is connected to and changes the text of the square when this value is toggled.</p>



<h2 class="wp-block-heading" id="h-example-popup-windows">Example Popup Windows</h2>



<p class="wp-block-paragraph"><br>
<em>DP and DPE Structure in PARA</em></p>



<p class="wp-block-paragraph"><br>
<em>Creation of Popup Panel</em></p>



<p class="wp-block-paragraph"><br>
<em>Creation of Square Panel</em></p>



<p class="wp-block-paragraph"><br>
<em>Multiple Instantiations of Square Panel</em></p>



<h2 class="wp-block-heading" id="h-what-is-an-extended-property"><a name="extended-properties-in-oa"></a>What is an Extended Property?</h2>



<p class="wp-block-paragraph">An <strong>extended property</strong> is a custom property for a panel. Extended Properties allow for additional, non-required features. When you are creating a panel, you have a lot of access to properties, but when you go to instantiate the panel, many of the properties are no longer available for you to change. Extended Properties allow you to decide what features you may want to modify for each specific instantiation. See the difference in available properties in the images below.</p>



<p class="wp-block-paragraph"><br>
<em>Properties Listed during Creation of Panel</em></p>



<p class="wp-block-paragraph"><br>
<em>Properties Listed during Instantiation of Panel</em></p>



<p class="wp-block-paragraph">To create Extended Properties, we need four elements. We first need to declare the variable. Then we need to add the #property, along with two functions to get and set the property value. It will look something like this (there are two separate properties I am declaring in this example, one is a string, and the other is an enumerated type I created):</p>



<p class="wp-block-paragraph"><strong>ScopeLib Declarations:</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">WinCC OA CTRL</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>Color propertyA;
string propertyB;

public void setPropertyA(Color thisProperty){
  propertyA = thisProperty;
}

public Color getPropertyA(){
  return propertyA;
}

#property string propertyB

public void setPropertyB(string thisProperty){
  propertyB = thisProperty;
}

public string getPropertyB(){
  return propertyB;
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">Color propertyA;</span></span>
<span class="line"><span style="color: #D4D4D4">string propertyB;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">public </span><span style="color: #569CD6">void</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">setPropertyA</span><span style="color: #D4D4D4">(Color thisProperty){</span></span>
<span class="line"><span style="color: #D4D4D4">  propertyA = thisProperty;</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">public Color </span><span style="color: #DCDCAA">getPropertyA</span><span style="color: #D4D4D4">(){</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> propertyA;</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #9CDCFE">#property</span><span style="color: #D4D4D4"> string propertyB</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">public </span><span style="color: #569CD6">void</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">setPropertyB</span><span style="color: #D4D4D4">(string thisProperty){</span></span>
<span class="line"><span style="color: #D4D4D4">  propertyB = thisProperty;</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">public string </span><span style="color: #DCDCAA">getPropertyB</span><span style="color: #D4D4D4">(){</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> propertyB;</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p class="wp-block-paragraph">Extended properties are best used if you have variants of a specific panel. In my example, I wanted my squares to be all different colors and to be able to change the text for each one. By creating an enum called Color, I was able to create a property with a dropdown instead of relying on the user to type in a string value.</p>



<p class="wp-block-paragraph">propertyB is a text field so I can enter whatever I like for that field. I have shown the enum script below. The <strong>intToColor</strong> and <strong>colorToInt</strong> functions are utilized later in the dollar parameter discussion.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">WinCC OA CTRL</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>enum Color
{
   Red = 0,
   Orange = 1,
   Yellow = 2,
   Green = 3,
   Blue = 4,
   Purple = 5,
   White = 6
};

public Color intToColor (int iColor) {
  switch (iColor)
  {
    case 0:
    return Color::Red;
    break;
    case 1:
    return Color::Orange;
    break;
    case 2:
    return Color::Yellow;
    break;
    case 3:
    return Color::Green;
    break;
    case 4:
    return Color::Blue;
    break;
    case 5:
    return Color::Purple;
    break;
    case 6:
    return Color::White;
    break;
  }
}

public int colorToInt (Color iColor) {
  if (iColor == Color::Red){
    return 0;
  }
  if (iColor == Color::Orange){
    return 1;
  }
  if (iColor == Color::Yellow){
    return 2;
  }
  if (iColor == Color::Green){
    return 3;
  }
  if (iColor == Color::Blue){
    return 4;
  }
  if (iColor == Color::Purple){
    return 5;
  }
  if (iColor == Color::White){
    return 6;
  }
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #569CD6">enum</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">Color</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #4FC1FF">Red</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #4FC1FF">Orange</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #4FC1FF">Yellow</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #4FC1FF">Green</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">3</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #4FC1FF">Blue</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">4</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #4FC1FF">Purple</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">5</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #4FC1FF">White</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">6</span></span>
<span class="line"><span style="color: #D4D4D4">};</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">public Color </span><span style="color: #DCDCAA">intToColor</span><span style="color: #D4D4D4"> (</span><span style="color: #569CD6">int</span><span style="color: #D4D4D4"> iColor) {</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">switch</span><span style="color: #D4D4D4"> (iColor)</span></span>
<span class="line"><span style="color: #D4D4D4">  {</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">case</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Red;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">break</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">case</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Orange;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">break</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">case</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Yellow;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">break</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">case</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">3</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Green;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">break</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">case</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">4</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Blue;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">break</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">case</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">5</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Purple;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">break</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">case</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">6</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::White;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">break</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">public </span><span style="color: #569CD6">int</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">colorToInt</span><span style="color: #D4D4D4"> (Color iColor) {</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (iColor == </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Red){</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (iColor == </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Orange){</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (iColor == </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Yellow){</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (iColor == </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Green){</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">3</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (iColor == </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Blue){</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">4</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (iColor == </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Purple){</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">5</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (iColor == </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::White){</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">6</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p class="wp-block-paragraph">To cause the colors of the squares to change, I must add in logic. I added the following logic to the <strong>Initialize script of the square object</strong> in the Square panel. This simply sets the background color of the object based on what Color property is assigned to it.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">WinCC OA CTRL</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>main()
{
  if (propertyA == Color::Red){
    this.backCol = "Red";  
  }
  if (propertyA == Color::Orange){
    this.backCol = "Orange";  
  }
  if (propertyA == Color::Yellow){
    this.backCol = "Yellow";  
  }
  if (propertyA == Color::Green){
    this.backCol = "Green";  
  }
  if (propertyA == Color::Blue){
    this.backCol = "Blue";  
  }
  if (propertyA == Color::Purple){
    this.backCol = "Purple";  
  }
  if (propertyA == Color::White){
    this.backCol = "White";
  }
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">main</span><span style="color: #D4D4D4">()</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (propertyA == </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Red){</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">this</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">backCol</span><span style="color: #D4D4D4"> = </span><span style="color: #CE9178">&quot;Red&quot;</span><span style="color: #D4D4D4">;  </span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (propertyA == </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Orange){</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">this</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">backCol</span><span style="color: #D4D4D4"> = </span><span style="color: #CE9178">&quot;Orange&quot;</span><span style="color: #D4D4D4">;  </span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (propertyA == </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Yellow){</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">this</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">backCol</span><span style="color: #D4D4D4"> = </span><span style="color: #CE9178">&quot;Yellow&quot;</span><span style="color: #D4D4D4">;  </span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (propertyA == </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Green){</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">this</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">backCol</span><span style="color: #D4D4D4"> = </span><span style="color: #CE9178">&quot;Green&quot;</span><span style="color: #D4D4D4">;  </span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (propertyA == </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Blue){</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">this</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">backCol</span><span style="color: #D4D4D4"> = </span><span style="color: #CE9178">&quot;Blue&quot;</span><span style="color: #D4D4D4">;  </span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (propertyA == </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::Purple){</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">this</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">backCol</span><span style="color: #D4D4D4"> = </span><span style="color: #CE9178">&quot;Purple&quot;</span><span style="color: #D4D4D4">;  </span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (propertyA == </span><span style="color: #4EC9B0">Color</span><span style="color: #D4D4D4">::White){</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">this</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">backCol</span><span style="color: #D4D4D4"> = </span><span style="color: #CE9178">&quot;White&quot;</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p class="wp-block-paragraph">To change the text values, we must add the same logic to the Initialize script of the text object in the Square panel. This code will be <strong>modified later on</strong> when we add in dollar parameters.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">WinCC OA CTRL</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>main()
{
  this.text = propertyB;
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">main</span><span style="color: #D4D4D4">()</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #569CD6">this</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">text</span><span style="color: #D4D4D4"> = propertyB;</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p class="wp-block-paragraph">Now that we have added the extended properties, when we instantiate the Square panel, these properties will appear in the Extended properties tab. I want the first square to be red, so I selected that from the drop down and gave it a label of ‘R,’ and then repeated the procedure for the subsequent squares added.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Image-8-R.png" alt="extended properties"/></figure>



<p class="wp-block-paragraph">When I set all the extended properties, I ran the panel in quick test mode and saw the following results:</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Image-9-R.png" alt="colored properties"/></figure>



<p class="wp-block-paragraph">This allows for a single panel (my Square panel) to be used with different variations that can be set upon instantiation.</p>



<h2 class="wp-block-heading" id="h-what-is-a-dollar-parameter-parameter"><a name="dollar-parameters-in-oa"></a>What is a Dollar Parameter ($-Parameter)?</h2>



<p class="wp-block-paragraph">A <strong>Dollar Parameter</strong> is a panel parameter that can be replaced with a corresponding data point (dp) or data point element (dpe). Unlike extended properties, dollar parameters should be considered as a required panel parameter. These are used ideally for connecting OA to corresponding data points in a PLC project through Para.</p>



<p class="wp-block-paragraph"><strong>NOTE:</strong><br>
A data point is an object, and a data point element is the specific attribute of that object, such as a motor (dp) with start, stop, or&nbsp;speed variables (dpe). In our example, <strong>dpTest</strong> is the data point, and boolTestDPE, intTestDPE, stringTestDPE are the data point elements.</p>



<p class="wp-block-paragraph"><strong>ScopeLib Declarations of the Square Panel:</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">WinCC OA CTRL</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>#uses "Colors"

Color propertyA;
string propertyB;

// This is my dollar parameter
string dp = $dp;
  
// This is my event 
#event myEventFunction()

// This is my extended property
#property Color propertyA

public void setPropertyA(Color thisProperty){
  propertyA = thisProperty;
}

public Color getPropertyA(){
  return propertyA;
}

#property string propertyB

public void setPropertyB(string thisProperty){
  propertyB = thisProperty;
}

public string getPropertyB(){
  return propertyB;
}

void callPopup(){
  int color = colorToInt(propertyA);
  ChildPanelOnCentral("popup.xml", propertyB, makeDynString("$dp:" + dp, "$propertyA:" + color));
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #9CDCFE">#uses</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">&quot;Colors&quot;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">Color propertyA;</span></span>
<span class="line"><span style="color: #D4D4D4">string propertyB;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955">// This is my dollar parameter</span></span>
<span class="line"><span style="color: #D4D4D4">string dp = $dp;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span></span>
<span class="line"><span style="color: #6A9955">// This is my event </span></span>
<span class="line"><span style="color: #9CDCFE">#event</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">myEventFunction</span><span style="color: #D4D4D4">()</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955">// This is my extended property</span></span>
<span class="line"><span style="color: #9CDCFE">#property</span><span style="color: #D4D4D4"> Color propertyA</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">public </span><span style="color: #569CD6">void</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">setPropertyA</span><span style="color: #D4D4D4">(Color thisProperty){</span></span>
<span class="line"><span style="color: #D4D4D4">  propertyA = thisProperty;</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">public Color </span><span style="color: #DCDCAA">getPropertyA</span><span style="color: #D4D4D4">(){</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> propertyA;</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #9CDCFE">#property</span><span style="color: #D4D4D4"> string propertyB</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">public </span><span style="color: #569CD6">void</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">setPropertyB</span><span style="color: #D4D4D4">(string thisProperty){</span></span>
<span class="line"><span style="color: #D4D4D4">  propertyB = thisProperty;</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">public string </span><span style="color: #DCDCAA">getPropertyB</span><span style="color: #D4D4D4">(){</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> propertyB;</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #569CD6">void</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">callPopup</span><span style="color: #D4D4D4">(){</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #569CD6">int</span><span style="color: #D4D4D4"> color = </span><span style="color: #DCDCAA">colorToInt</span><span style="color: #D4D4D4">(propertyA);</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #DCDCAA">ChildPanelOnCentral</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;popup.xml&quot;</span><span style="color: #D4D4D4">, propertyB, </span><span style="color: #DCDCAA">makeDynString</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;$dp:&quot;</span><span style="color: #D4D4D4"> + dp, </span><span style="color: #CE9178">&quot;$propertyA:&quot;</span><span style="color: #D4D4D4"> + color));</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p class="wp-block-paragraph"><strong>NOTE:</strong><br>
Dollar parameters are converted to a string constant at runtime.<br>
Because dollar parameters are essentially strings, they can also be used to pass any primitive datatype between panels, not just dp/dpe.</p>



<p class="wp-block-paragraph">Dollar parameters are great for nested panels and popup windows. When a popup is called, the popup can be passed information it needs, such as the root of a <strong>dpe path</strong>. If the popup window has several functions all pertaining to the same object, they can use the same dollar parameter root and append their dpe to the root path. If required, most likely in a more complex panel, you can have multiple dollar parameters passed. This will make more sense in the example program.</p>



<p class="wp-block-paragraph">Dollar parameters are set in the ScopeLib of the instantiated panel. To pass a dollar parameter through a panel, the dollar parameter variable name must match the panel originating the dollar parameter and the panel providing the dollar parameter.</p>



<p class="wp-block-paragraph">There are many functions built into WinCC OA that can utilize the dollar parameter. You can find descriptions of these functions in the help guide of WinCC OA.</p>



<p class="wp-block-paragraph"><strong>Four Tips on Dollar Parameters:</strong></p>



<ol class="wp-block-list">
<li>If you use an underscore (“_”) at the beginning of your dollar parameter name, it makes it an optional dollar parameter<br>
 <img decoding="async" alt="optional parameter" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/optional-dollar-parameter.png"></li>



<li>If you use certain lower case letters at the beginning of the name, it will force a type on the dollar parameter (Hungarian Notation). The full gamut of character types is found in the <strong>OA help documentation </strong>under <strong>‘Parameters’</strong><br>
 <img decoding="async" alt="characters in parameter" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/characters-in-parameters.png"></li>



<li>By using certain keywords in the name of your dollar parameter, you can bring up a selector window specific for the dollar parameter type you want <strong>(keywords: ‘dp’, ‘dpe’, ‘color’, ‘text’, ‘panel’, ‘keyword’)</strong>. For example, if you use the word ‘color’ in your dollar parameter name and then select the ellipses when defining the reference, you will be prompted with the color selector window.<br>
 <img decoding="async" alt="testing parameter" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/reference-defining-parameter.png"><img decoding="async" alt="color of parameter" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/color-of-parameter.png"><br>
 If none of the keywords are in your dollar parameter name, when you select the ellipses you are given the generic selector (shown below). <img decoding="async" alt="generic selctor" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/generic-selector.png"></li>



<li>Dollar parameter functions support reference parameters if you define the function with them (use an ampersand at the beginning of the function argument name), for example: ‘int &amp;a’. Documentation on this can also be found in the OA help documentation.</li>
</ol>



<h2 class="wp-block-heading" id="h-example">Example</h2>



<p class="wp-block-paragraph">In this example, I have a square panel that calls a popup window when it is clicked. I want the square to pass along its color information to the popup window so they match in color. There is also a button on the Popup that I want to toggle the value of the Boolean DPE in PARA (dpTest.boolTestDPE). When I toggle this value, it will update the text of the Square panel to say TRUE if the value is true. Otherwise, it will revert to its default value.</p>



<p class="wp-block-paragraph">To do this, I need to declare the dollar parameter in the ScopeLib of both the <strong>Square panel</strong> and the <strong>Popup panel</strong>.</p>



<p class="wp-block-paragraph"><strong>ScopeLib of Square Panel:</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">WinCC OA CTRL</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>#uses "Colors"

Color propertyA;

// This is my dollar parameter
string dp = $dp;</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #9CDCFE">#uses</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">&quot;Colors&quot;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">Color propertyA;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955">// This is my dollar parameter</span></span>
<span class="line"><span style="color: #D4D4D4">string dp = $dp;</span></span></code></pre></div>



<p class="wp-block-paragraph"><strong>ScopeLib of Popup Panel:</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">WinCC OA CTRL</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>string dp = $dp;
Color propertyA = intToColor($propertyA);</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">string dp = $dp;</span></span>
<span class="line"><span style="color: #D4D4D4">Color propertyA = </span><span style="color: #DCDCAA">intToColor</span><span style="color: #D4D4D4">($propertyA);</span></span></code></pre></div>



<p class="wp-block-paragraph">You will notice a couple of things:</p>



<ol class="wp-block-list">
<li style="margin-bottom:10px">I did not make the color variable a dollar parameter in the ScopeLib of the Square panel. This is because this variable is presumably not tied to anything in the PLC, so it doesn&rsquo;t need to be declared&nbsp;as a dollar parameter.</li>



<li>The Popup panel uses a function to convert the dollar parameter it receives. This is because of the way the information is being passed between the two panels. As I mentioned before, the dollar parameters are passed as strings. The Popup panel is expecting a Color, so I must pass the Color as an int that can be converted back into a Color.</li>
</ol>



<p class="wp-block-paragraph">I want to the popup to control the Boolean DPE, so I set the logic to do that in the ‘Clicked’ script for the Popup panel’s button. The dpGet and dpSet functions are built into WinCC OA, and information on their usage can be found in the help documentation.</p>



<p class="wp-block-paragraph"><strong>Clicked Script for Button of Popup Panel:</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">WinCC OA CTRL</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>main(mapping event)
{
  bool temp;
  dpGet(dp + ".boolTestDPE", temp);
  dpSet(dp + ".boolTestDPE", !temp); 
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">main</span><span style="color: #D4D4D4">(mapping event)</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #569CD6">bool</span><span style="color: #D4D4D4"> temp;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #DCDCAA">dpGet</span><span style="color: #D4D4D4">(dp + </span><span style="color: #CE9178">&quot;.boolTestDPE&quot;</span><span style="color: #D4D4D4">, temp);</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #DCDCAA">dpSet</span><span style="color: #D4D4D4">(dp + </span><span style="color: #CE9178">&quot;.boolTestDPE&quot;</span><span style="color: #D4D4D4">, !temp); </span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p class="wp-block-paragraph">I must also set the logic to change the text value of the text in the Square panel. This is done in the Initialize script of the text box in the Square Panel’s creation window.</p>



<p class="wp-block-paragraph"><strong>Initialize Script for Square Panel&#8217;s text field:</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">WinCC OA CTRL</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>main()
{
  bool temp;
  dpConnect("ChangeText", dp + ".boolTestDPE");
}

void ChangeText(string dpe, bool temp) {
  if (temp){
      this.text = "TRUE";
  }
  else {
    this.text = propertyB;
  }
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">main</span><span style="color: #D4D4D4">()</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #569CD6">bool</span><span style="color: #D4D4D4"> temp;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #DCDCAA">dpConnect</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;ChangeText&quot;</span><span style="color: #D4D4D4">, dp + </span><span style="color: #CE9178">&quot;.boolTestDPE&quot;</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #569CD6">void</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">ChangeText</span><span style="color: #D4D4D4">(</span><span style="color: #4EC9B0">string</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">dpe</span><span style="color: #D4D4D4">, </span><span style="color: #569CD6">bool</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">temp</span><span style="color: #D4D4D4">) {</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (temp){</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #569CD6">this</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">text</span><span style="color: #D4D4D4"> = </span><span style="color: #CE9178">&quot;TRUE&quot;</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">else</span><span style="color: #D4D4D4"> {</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">this</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">text</span><span style="color: #D4D4D4"> = propertyB;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p class="wp-block-paragraph">The function to call the popup is where the magic happens of passing the dollar parameters. This is a function that is built into WinCC OA and takes a dyn_string as one of its arguments for passing dollar parameters. Information on this function and other child panel functions can be found in the help documentation of OA.</p>



<p class="wp-block-paragraph"><strong>ScopeLib of the Square Panel:</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">WinCC OA CTRL</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>void callPopup(){
  int color = colorToInt(propertyA);
  ChildPanelOnCentral("popup.xml", propertyB, makeDynString("$dp:" + dp, "$propertyA:" + color));
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #569CD6">void</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">callPopup</span><span style="color: #D4D4D4">(){</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #569CD6">int</span><span style="color: #D4D4D4"> color = </span><span style="color: #DCDCAA">colorToInt</span><span style="color: #D4D4D4">(propertyA);</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #DCDCAA">ChildPanelOnCentral</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;popup.xml&quot;</span><span style="color: #D4D4D4">, propertyB, </span><span style="color: #DCDCAA">makeDynString</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;$dp:&quot;</span><span style="color: #D4D4D4"> + dp, </span><span style="color: #CE9178">&quot;$propertyA:&quot;</span><span style="color: #D4D4D4"> + color));</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p class="wp-block-paragraph">I must call the callPopup function when the square is clicked, so that is done in the ‘Clicked’ script of the Square panel when it is being created. You can ignore the triggerEvent function for now, that will be discussed later.</p>



<p class="wp-block-paragraph"><strong>Clicked Script of the Square Panel:</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">WinCC OA CTRL</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>main(mapping event)
{
    triggerEvent("myEventFunction");
    callPopup();
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">main</span><span style="color: #D4D4D4">(mapping event)</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">triggerEvent</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;myEventFunction&quot;</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">callPopup</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p class="wp-block-paragraph">The final task is to instantiate the Square panel and set the dollar parameter. When we go to instantiate the Square panel, we will be prompted to enter a dollar parameter value when we add the panel to our screen. The window that appears looks like this:</p>



<p class="wp-block-paragraph"><br>
The Window to set your dollar parameter upon instantiation</p>



<p class="wp-block-paragraph">The dp can be set here, but if you forget to do it here or want to enter the value later, it can also be found towards the bottom of the Property Editor panel once the panel is instantiated.</p>



<p class="wp-block-paragraph"><br>
The property window of the instantiated panel with the dollar parameter listed</p>



<p class="wp-block-paragraph">Once the dp is set, we can test out the results.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Image-12-R.png" alt="test results"/></figure>



<p class="wp-block-paragraph">I selected the yellow ‘Y’ square, and the following pop-up appeared with a yellow background.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Image-13-R.png" alt="test results"/></figure>



<p class="wp-block-paragraph">The current value of boolTestDPE in Para before the toggle button is pressed.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Image-14-R.png" alt="original attributes"/></figure>



<p class="wp-block-paragraph">After the toggle button is pressed, the text of all the squares changed to ‘TRUE’</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Image-15-R.png" alt="TRUE attributes"/></figure>



<p class="wp-block-paragraph">The value was also updated in Para.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Image-16-R.png" alt="value updated"/></figure>



<p class="wp-block-paragraph">I closed that popup window and selected the purple ‘P’ square, and you can see the popup background color changed accordingly.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Image-17-R.png" alt="value updated"/></figure>



<h2 class="wp-block-heading" id="h-what-is-an-event"><a name="events-in-oa"></a>What is an Event?</h2>



<p class="wp-block-paragraph"><strong>An event</strong> is where custom logic can be placed if a panel has logic that needs to be run based on a defined action. This could equally be performed with scope-lib logic. Depending on the use case, it might be more beneficial to use the Event property or to use ScopeLib.</p>



<p class="wp-block-paragraph"><strong>ScopeLib</strong> is best used if it is logic that is consistently called for all variations of the button object. You may have a ‘CLOSE PANEL’ button that will close the panel the button is on if the button is clicked. The logic for closing the panel could be placed in an event script, or it could be placed in ScopeLib. If every close button is designed to close the panel, it might be best to put this in ScopeLib for consolidation and maintainability of code. Event property is better used in instances when the script called may vary with different instances of the panel.</p>



<p class="wp-block-paragraph">If you want the panel to return a value on closing only on some panels, or if you want the button to execute logic that calls a confirmation popup window might be instances when you use the Event script. It can also be useful in cases where the functionality is not well defined, or the functionality changes over time. The difference is having the code set in the creation of the panel or in the instantiation of the panel.</p>



<p class="wp-block-paragraph">For our example, we will add an event script to the red ‘RED’ square that causes the square to change to white when it is clicked.</p>



<p class="wp-block-paragraph">To declare an event, we use the following format:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">WinCC OA CTRL</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>#event myEventFunction()</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #9CDCFE">#event</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">myEventFunction</span><span style="color: #D4D4D4">()</span></span></code></pre></div>



<p class="wp-block-paragraph">Now when we look at the Extended Property tab, we see myEventScript listed as an option. This function is listed in every instantiated Square panel, but each square can have their own function.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Image-18-R.png" alt="property editor"/></figure>



<p class="wp-block-paragraph">I am adding the following code to my red ‘RED’ Square’s Event Function:</p>



<p class="wp-block-paragraph">Defining the event function, in the Event Script of the instantiated panel:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">WinCC OA CTRL</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>myEventFunction()
{
  this.backCol = "White";
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">myEventFunction</span><span style="color: #D4D4D4">()</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #569CD6">this</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">backCol</span><span style="color: #D4D4D4"> = </span><span style="color: #CE9178">&quot;White&quot;</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p class="wp-block-paragraph">In order for the function to have any effect, it must be triggered. You can put the trigger anywhere you want, I am choosing to put it in the ‘Clicked’ script for the Square panel in its creation window (you saw this in an earlier image when discussing dollar parameters, and here it is again).</p>



<p class="wp-block-paragraph">How to call an Event Function, this was placed in the &#8216;Clicked&#8217; script of the created panel:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">WinCC OA CTRL</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>main(mapping event)
{
    triggerEvent("myEventFunction");
    callPopup();
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">main</span><span style="color: #D4D4D4">(mapping event)</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">triggerEvent</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;myEventFunction&quot;</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">callPopup</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p class="wp-block-paragraph">Now when I select the red ‘Red’ square, the square turns white. The rest of the squares still keep their colors when they are selected.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Image-19-R.png" alt="Red toggle"/></figure>



<p class="wp-block-paragraph"><strong>NOTE:</strong><br>
Do not use dollar parameters in events, if you want to use a function like dpSet(), the string to the dpe must be hardcoded.</p>



<p class="wp-block-paragraph">Hopefully, that gives you some help on using the additional parameters in WinCC OA.</p>



<p class="wp-block-paragraph">Miscellaneous tips that have come up:</p>



<ul class="wp-block-list">
<li>Holding shift while creating a pipe or a line makes it adhere to 45-degree angle increments.</li>



<li>Holding shift while creating a rectangle will make a square.
 
 
<ul class="wp-block-list">
<li>Both of these are true of most graphics creation applications</li>
</ul>
</li>



<li>Hiding the panel’s title bar on a thin client will possibly cause the panel to stop working, and in cases of modal windows cause the ITC to become unresponsive.</li>
</ul>



<p class="wp-block-paragraph">&nbsp;</p>



<p class="wp-block-paragraph">Learn more about DMC&#8217;s <a href="/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming/siemens-simatic-wincc-programming">WinCC OA Services</a> and <a href="/contact">contact us</a> for additional questions or programming assistance.</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21605/using-dollar-parameters-events-and-extended-properties-in-siemens-wincc-oa/">Using Dollar Parameters, Events and Extended Properties in Siemens WinCC OA</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
