How can a $-Instance be handed over to a child panel

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
3 posts • Page 1 of 1
Ändy
Posts:2
Joined: Mon Oct 08, 2018 10:18 am

How can a $-Instance be handed over to a child panel

Post by Ändy »

Hello @All,

long story short: I try to do a presumably "legacy" tutorial to get into WinCC OA 3.15. At one point I want to create a Child-Panel that holds a toggle-switch that changes values in the parent panel by $reference. Just the wizard proceeding is explained and it also does not work. I have two issues which, at leat I think, are adressing the same problem of not being to able to set references properly.

First issue: When I Drag-and-Drop the switch_1 and enter e.g. "$flap.response.malfunction.end_of_travel", nothing is entered in the $-Parameter field in the attribute-editor . My approach is to change the entries in the automatically generated Initialize- and Clicked-Script as follows (initial values behind the "//" ) but I also tried to enter the line into all attributes of the $-Parameter field, which doesn't change anything :

Initialize-Script:

Code: Select all

string msDPERm;
bool mbIBit;
string msToggle;

main()
{
  msDPERm = $flap.response.malfunction.end_of_travel;    // msDPERm =$dpe_value_Rm;
  mbIBit = FALSE;          // mbIBit      =$b_IBit;
  msToggle = TRUE;       // msToggle =$b_Toggle;
  
  STD_switch_1(); 
}  
Clicked-Script:

Code: Select all

string msDPERm;
string msDPEOff;
string msDPEOn;
string msToggle;

main()
{
 msDPERm=$flap.response.malfunction.end_of_travel; // msDPERm=$dpe_value_Rm;
 msDPEOff=$flap.response.malfunction.end_of_travel; // msDPEOff=$dpe_value_Off;
 msDPEOn=$flap.response.malfunction.end_of_travel; // msDPEOn=$dpe_value_On;
 msToggle=TRUE;//$b_Toggle;
 
 STD_switch_1_LeftKlick();
}
Second issue: I try to include a panel that contains the aforementioned switch into a RightMousePressed-Script by using the wizard but the Dialog-field "Parameters as they appear in the script" does not contain e.g. "$flap:$flap", no matter what I do.

Here I tried to adapt the RightMousePressed-Script by substituting the makeDynString "" by "$flap:"+$flap :

Code: Select all

main()
{
  EP_childPanelOn();
}

void EP_childPanelOn()
{
  ChildPanelOnCentral("objects/EOTmalfunction.pnl",
      "EOT malfunction",
      makeDynString("$flap:"+$flap));  // I tried to give the child the needed reference
}
The entering of "$flap:"+$flap instead of an empty String results in CTRL errors to be thrown :

Code: Select all

WARNING,    13/uim,
WARNING,    71, DP does not exist
and also a print that there are issues "dpConnect, -1:_online.._value" in the switch's Initialize-Script, which is not a suprize, because I don't use the *:_original.._value, which is erroneous and doesn't allow the respective script to be saved. I used this method, because in other references of the $-Parameter fields there is the path e.g. " $dpe_value_Rm = $flap.response.malfunction.end_of_travel" .

So far I tried everything that I thought could work. :blush:

Thanks in advance,

nmnogueira
Posts:125
Joined: Thu May 05, 2011 12:59 pm

Re: How can a $-Instance handed over to child panel

Post by nmnogueira »

Code: Select all

msDPERm = $flap.response.malfunction.end_of_travel;    // msDPERm =$dpe_value_Rm;
should be

Code: Select all

msDPERm = $flap+".response.malfunction.end_of_travel";    // msDPERm =$dpe_value_Rm;

Ändy
Posts:2
Joined: Mon Oct 08, 2018 10:18 am

Re: How can a $-Instance handed over to child panel

Post by Ändy »

D'oh... I didn't see that. With the switch's scripts adapted with $flap+"..." it finally works.

Thank you very(!) much.

3 posts • Page 1 of 1