Hello together,
In the init of the panel, we are using ifDollarDefined("$foo"), still we are getting warnings about missing $ parameters when loading this panel in a module.
I just wanted to know if there is a way to prevent WinCC OA from generating these warnings when loading panels on modules without providing the respective dollar parameters in the rootPanelOnModule method.
Thanks and with best regards,
moTo
ifDollarDefined() and RootPanelOnModule generates Warnings
- moto3101
- Posts:37
- Joined: Tue Aug 22, 2017 2:04 pm
ifDollarDefined() and RootPanelOnModule generates Warnings
- fmulder
- Posts:330
- Joined: Wed Feb 03, 2010 9:46 am
Re: ifDollarDefined() and RootPanelOnModule generates Warnings
You probably have something like this in your code:
I've also seen messages like you say when you define the variable as a panel global variable in your Scopelib.
* Do not define the variable with the $ in your scopelib
* Define the variable in your EventInitialize (with or without isDollarDefined)
The better way to do this is, which will keep away the error message is:
p.s.
I often use this trick to test my panels. When I make an icon then I make sure that it runs with a dollar code or without a dollar code.
Example:
Hope this helps
share the fun
Frenk Mulder
Code: Select all
string strFoo = $foo;
* Do not define the variable with the $ in your scopelib
* Define the variable in your EventInitialize (with or without isDollarDefined)
The better way to do this is, which will keep away the error message is:
Code: Select all
string strFoo;
if( isDollarDefined( "$Foo" ))
{
strFoo = $Foo;
}
I often use this trick to test my panels. When I make an icon then I make sure that it runs with a dollar code or without a dollar code.
Example:
Code: Select all
string strDatapoint = "MYVALVE"; // Use a default datapoint for testing
// This icon can be used with or without the dollar code
if( isDollarDefined( "$datapoint" ))
{
strDatapoint = $Datapoint;
}
share the fun
Frenk Mulder
- moto3101
- Posts:37
- Joined: Tue Aug 22, 2017 2:04 pm
Re: ifDollarDefined() and RootPanelOnModule generates Warnings
Hello Frenk,
thanks for your reply.
and in the init we have
Still, when loading a panel in a module without providing the dp parameters we get the error.
the error vanishes.
Personally, I don't see the point in throwing errors if we are checking if the parameter is defined.
Best regards,
moTo
thanks for your reply.
No we don't, that's the thing that confuses me. We are defining the variable in the scope lib:You probably have something like this in your code:Code: Select all
string strFoo = $foo;
Code: Select all
string strDatapoint = "";
Code: Select all
if( isDollarDefined( "$dp" ))
{
strDatapoint = $dp;
}
Code: Select all
RootPanelOnModule("Folder/panel.pnl","Foo","BarModule",makeDynString();If we are usingCTRL, WARNING, 51, Parameter incorrect, did not find the $-parameter, $dp
PARAM,WARNING, 81, Syntax error, $-Parameter, Module: BarModule
Code: Select all
RootPanelOnModule("Folder/panel.pnl","Foo","BarModule",makeDynString($dp:);Personally, I don't see the point in throwing errors if we are checking if the parameter is defined.
Best regards,
moTo
- fmulder
- Posts:330
- Joined: Wed Feb 03, 2010 9:46 am
Re: ifDollarDefined() and RootPanelOnModule generates Warnings
We do 'string strDP' in the scopelib.
We assign the dollar code in the EventInitialize.
Do not mention "$DP" in the scopelib.
We had the same issue. Our rule now is : no $ codes in the scopelib
Good luck
Frenk Mulder
We assign the dollar code in the EventInitialize.
Do not mention "$DP" in the scopelib.
We had the same issue. Our rule now is : no $ codes in the scopelib
Good luck
Frenk Mulder
- moto3101
- Posts:37
- Joined: Tue Aug 22, 2017 2:04 pm
- mkoller
- Posts:741
- Joined: Fri Sep 17, 2010 9:03 am
Re: ifDollarDefined() and RootPanelOnModule generates Warnings
Are we talking about an issue with $-parameters throwing warnings when using XML Panel files, which has been solved in 3.15 P8 ?
- moto3101
- Posts:37
- Joined: Tue Aug 22, 2017 2:04 pm
Re: ifDollarDefined() and RootPanelOnModule generates Warnings
Dear Martin,
we are using .pnl files. However, we are not using 3.15 but 3.14.
Best regards,
moTo
we are using .pnl files. However, we are not using 3.15 but 3.14.
Best regards,
moTo
