[already SOLVED] Default branch called, Variable, castingOrder, VariableType not implemented: NOTYPE_VAR

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
2 posts • Page 1 of 1
a.decelis
Posts:30
Joined: Thu Jun 25, 2015 6:42 pm

[already SOLVED] Default branch called, Variable, castingOrder, VariableType not implemented: NOTYPE_VAR

Post by a.decelis »

Hi,

I have already circumvected this problem, by calling my problematic code from a different event (not the initialization event, but a dpConnect-update-callback).
Any way, just for completness sake, I would like to share my experience.

I [strike]am[/strike] was sometimes getting this warning with WinCC OA 3.14 under Open SuSE Linux and 3.14 P002 under Windows 7:

Code: Select all

WCCOAui      (1), 2016.05.03 17:37:17.660, IMPL, WARNING,    50, Default branch called, Variable, castingOrder, VariableType not implemented: NOTYPE_VAR
WCCOAui      (1), 2016.05.03 17:37:17.661, CTRL, WARNING,     5/ctrl, Location of the following log entry: 
    Module: Vision_2
    Panel: /home/...redacted.../main_panel.xml []
    Script: Initialize
    In panel scope library: redacted/main_panel.xml []
    Line: 54
The warning was emitted during panel initialization, but did not not happen always. It seems that, after the panel had been loaded a few times, the warning appeared no more (until GEDI was restarted).
And I still cannot figure out what does it mean. My guess is that: as I was modifying the attributes from panel refs from the initalization event of the containing panel, I was actually accessing some yet-uninitalized panels' items, and this was causing some internal trouble.

There is a main_panel.xml, and a small_panel.xml The small panel contains several items, including a Primitive Text one (named PT_MESSAGE).
There are 25 instances (panelrefs) of the small_panel in the main panel.
The main panel is being loaded via "ModuleOnWithPanel". When the main pannel initializes, a scopeLib function was called:

Code: Select all

const dyn_string SPANELS1 = makeDynString(...);
const dyn_string SPANELS2 = makeDynString(...);
...
const dyn_anytype SPANELS = makeDynAnytype(SPANELS1, SPANELS2, ...);

void myNowRemovedScopeLibFunction()
{
    for (int i = 1; i

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: [already SOLVED] Default branch called, Variable, castingOrder, VariableType not implemented: NOTYPE_VAR

Post by mkoller »

You can simply reproduce this with the following code:

Code: Select all

main()
{
  dyn_anytype da;
  da[2] = 1;
  
  setValue(da[1][2] + "hello", "text", "");
}
The problem lies in the bug in that script: the setValue() call addresses an index in the dyn_anytype which was not initialized, therefore
the part "da[1][2]" can not be correctly evaluated, since the da[1] is still an empty anytype, therefore the [2] index of that empty anytype is a NOTYPE_VAR.

In your code above, you probably have the bug where you do
const dyn_anytype SPANELS = makeDynAnytype(SPANELS1, SPANELS2, ...);
check what comes in your real code as "..."

2 posts • Page 1 of 1