<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to WebVisu Numpad dialog - Dialogtitle not accepting string variable</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/0832dfd352/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Visualization/thread/0832dfd352/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Visualization/thread/0832dfd352/</id><updated>2025-05-29T09:38:26.833000Z</updated><subtitle>Recent posts to WebVisu Numpad dialog - Dialogtitle not accepting string variable</subtitle><entry><title>WebVisu Numpad dialog - Dialogtitle not accepting string variable</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/0832dfd352/?limit=25#735f" rel="alternate"/><published>2025-05-29T09:38:26.833000Z</published><updated>2025-05-29T09:38:26.833000Z</updated><author><name>critcho</name><uri>https://forge.codesys.com/u/critcho/</uri></author><id>https://forge.codesys.coma04d568fbff3c249710b8d914653c88684abed84</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have a WebVisu page which is re-used for multiple types of gas; it displays the alarm thresholds etc. for one gas at a time. I have an array of structures holding the set-points for each of the gasses. I'm trying to change the dialog title for the value input pop-up (VisuDialogs.Numpad). &lt;/p&gt;
&lt;p&gt;The Dialogtitle is set to Gas_Alarms.HighAlarmActivationLevelDialog, which is a string(50):&lt;/p&gt;
&lt;p&gt;When the gas type is changed (page first loaded, or prev/next buttons), METHOD Gas_Alarms.Update_Display_Variables is called, to update the strings used for the dialog titles so it shows &lt;em&gt;GasName High Alarm Activation Level (EngineeringUnits)&lt;/em&gt;, e.g. &lt;em&gt;CO2 High Alarm Activation Level (PPM)&lt;/em&gt;:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;HighAlarmActivationLevelDialog&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;Insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;High&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Alarm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Activation&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;Level&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;EngineeringUnits&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;HighAlarmActivationLevelDialog&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;Insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;HighAlarmActivationLevelDialog&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;GasName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;(That's not where the problem is, I'm just explaining why I'm using a variable dialogue title.)&lt;/p&gt;
&lt;p&gt;The variables used are definitely strings, but i'm always getting the error:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"The type of the dialog title must be either STRING or WSTRING".&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I've tried moving HighAlarmActivationLevelDialog etc. to the GVL and also changing them to WSTRING, I even tried adding them to the structure array, but I always get the same error.&lt;/p&gt;
&lt;p&gt;Clearing the dialog title for that element removes the error - so I'm confident it's not a phantom error caused by something else. But I should be able to add these titles, can't just nuke them all to make it work.&lt;/p&gt;
&lt;p&gt;The MinVal and MaxVal for the Numpad are called from the array, e.g. GVL.Gas_Alarm_Configs&lt;span&gt;[0]&lt;/span&gt;.ScaledValueMIN, they are not getting an error. I am using array indexes 1 - 5 for the gasses, when I load the form or change gas, I copy the selected index to index 0 of the array, and values from Gas_Alarm_Configs&lt;span&gt;[0]&lt;/span&gt;.&lt;em&gt;&lt;span&gt;&lt;span&gt;[ALL]&lt;/span&gt;&lt;/span&gt;&lt;/em&gt; are displayed on the page. When they hit save, I copy Gas_Alarm_Configs&lt;span&gt;[0]&lt;/span&gt;.&lt;em&gt;&lt;span&gt;&lt;span&gt;[ALL]&lt;/span&gt;&lt;/span&gt;&lt;/em&gt; to Gas_Alarm_Configs&lt;span&gt;[CurrentGasIndex]&lt;/span&gt;.&lt;em&gt;&lt;span&gt;&lt;span&gt;[ALL]&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;.&lt;br/&gt;
(ALL just means every element, I can't figure out how to display an asterix in this question... :) )&lt;/p&gt;
&lt;p&gt;I've searched online for variable title dialog, but not found anything to help.&lt;/p&gt;
&lt;p&gt;Thanks for your help!&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>