V 10
1
LANG:1 8 (NoName)
PANEL,384 105 227 410 N "_3DFace" 0
EEE E E 1 -1 -1 0  30 70
"" 0 1
EE 2
"CBRef""1"
"EClose"E
""
DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
LAYER, 0 
1
LANG:1 6 Layer1
6 36
"Border1"
""
1 10 340 E E E 1 E 1 E N {0,0,0} E N {153,204,204} E E
 E E
31 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
E E 0 1 1 0 1 E U  1 E 10 10 210 340
2 37
"Text3"
""
1 10 10 E E E 1 E 1 E N {0,0,0} E N {102,153,153} E E
 E E
32 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
E E 0 1 1 0 1 E U  1 E 12 12 208 33
1 2 0 "s" 0 0 0 65 0 0  12 12
 1
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
1
LANG:1 18 ON / STANDBY / OFF
2 38
"Text4"
""
1 10 240 E E E 1 E 1 E N {0,0,0} E N {102,153,153} E E
 E E
33 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
E E 0 1 1 0 1 E U  1 E 12 242 208 263
1 2 0 "s" 0 0 0 65 0 0  12 242
 1
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
1
LANG:1 4 MASK
13 21
"Button1"
""
1 74 490 E E E 1 E 1 E N {0,0,0} E N {153,204,204} E E
 E E
20 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
18 278 112 312
T 
1
LANG:1 7 MASK ON
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int i;
string datapoint;


for (i=0;i<=5;i++){

  sprintf(datapoint, \"Crate00.HV_card%02d.HVcaMask.Send:_original.._value\",i);
  dpSetWait(datapoint, 255);
   }
for (i=0;i<=11;i++){

  sprintf(datapoint, \"Crate00.LV_card%02d.LVcaMask.Send:_original.._value\",i);
  dpSetWait(datapoint, 15);
   }

  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
  
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 22
"AllMasksOff"
""
1 183 810 E E E 1 E 1 E N {0,0,0} E N {153,204,204} E E
 E E
20 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
108 278 202 312
T 
1
LANG:1 8 MASK OFF
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int i;
string datapoint;


for (i=0;i<=5;i++){

  sprintf(datapoint, \"Crate00.HV_card%02d.HVcaMask.Send:_original.._value\",i);
  dpSetWait(datapoint, 0);
   }
for (i=0;i<=11;i++){

  sprintf(datapoint, \"Crate00.LV_card%02d.LVcaMask.Send:_original.._value\",i);
  dpSetWait(datapoint, 0);
   }

  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
  
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 23
"Button3"
""
1 20 150 E E E 1 E 1 E N {0,0,0} E N {153,204,204} E E
 E E
20 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
18 148 112 182
T 
1
LANG:1 2 ON
"// SimpleCtrlScriptStart {invalid}
main()
{

   PS_LVON();
   PS_HVON();
   PS_LVSet();   
   PS_HVSet();
 
}

PS_HVON()
{
dyn_errClass err;
int i,j, channel;
string DPsend, DPrecv;
float VALsend, VALrecv;
dyn_string valset1, valset2; 
dyn_float initValue;

//User Wait
setValue(\"\", \"backCol\", \"Blue\");

//Send SDO's to all updated HV channels
for (i=0;i<=47;i++){

    //Read one HV channel
    channel=i+100;
    dpSetWait(\"Crate00.Controller.CCchRead.Send:_original.._value\", channel);
    
    //Compare Send and Receive values for this channel
    valset1=makeDynString(\"HVchVolt\",\"HVchITrp\",\"HVchRamp\"); 
    for (j=1;j<=3; j++){
        sprintf(DPsend, \"Crate00.Channel%02d.%s.Send:_original.._value\",i,valset1[j]);
        sprintf(DPrecv, \"Crate00.Channel%02d.%s.Recv:_original.._value\",i,valset1[j]);
        dpGet(DPsend, VALsend);
        dpGet(DPrecv, VALrecv);
        
        //Send new value to crate controller only when changed
        if (VALsend != VALrecv) {
           dpSetWait(DPsend, VALsend);
        }

    }
}
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 


}


PS_LVON()
{
dyn_errClass err;
int i,j, channel;
string DPsend, DPrecv;
float VALsend, VALrecv;
dyn_string valset1, valset2; 
dyn_float initValue;

//User wait
setValue(\"\", \"backCol\", \"Green\");

//Send SDO's to all updated LV channels
for (i=0;i<=47;i++){

    //Read one LV channel
    dpSetWait(\"Crate00.Controller.CCchRead.Send:_original.._value\",i);
    
    //Compare Send and Receive values for this channel
    valset2=makeDynString(\"LVcaTrip\",\"LVcaMask\",\"LVch_Vcc\",\"LVch_Vdd\",\"LVchVCSV\",\"LVchPINV\",\"LVchDTrp\",\"LVchCTrp\",\"LVchTTrp\",\"LVchTLim\",\"LVchCLKS\",\"LVchCLKR\",\"LVchVOut\");
    for (j=3;j<=13;j++){
        sprintf(DPsend, \"Crate00.Channel%02d.%s.Send:_original.._value\",i,valset2[j]);
        sprintf(DPrecv, \"Crate00.Channel%02d.%s.Recv:_original.._value\",i,valset2[j]);
        dpGet(DPsend, VALsend);
        dpGet(DPrecv, VALrecv);
        
        //Send new value to crate controller only when changed
        if (VALsend != VALrecv) {
           dpSetWait(DPsend, VALsend);
        }
    }
}
//set this LV channels after changing all new values
dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", i);

  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
  
}


PS_LVSet()
{
dyn_errClass err;
int  channel, i,icard,lv;
int set;

//User wait
setValue(\"\", \"backCol\", \"Yellow\");

for (i=0;i<=47;i++){

    //set this HV channel
    dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", i);
    delay(0,50);

  setValue(\"\", \"backCol\", \"{102,102,204}\");
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 
}

}

PS_HVSet()
{
dyn_errClass err;
int  channel, i,icard,lv;
int set;

//User wait
setValue(\"\", \"backCol\", \"Red\");

for (i=0;i<=47;i++){
    
    //set this HV channel
    channel=100+i;
    dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", channel);
    delay(0,50);
    }
    
  setValue(\"\", \"backCol\", \"{102,102,204}\");
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}

//Function Button8_EventClick()
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 24
"Button5"
""
1 20 50 E E E 1 E 1 E N {0,0,0} E N {153,204,204} E E
 E E
21 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
18 48 112 82
T 
1
LANG:1 5 HV ON
"// SimpleCtrlScriptStart {invalid}
main()
{

   PS_HVON();  
   PS_HVSet();
 
}

PS_HVON()
{
dyn_errClass err;
int i,j, channel;
string DPsend, DPrecv;
float VALsend, VALrecv;
dyn_string valset1, valset2; 
dyn_float initValue;

//User Wait
setValue(\"\", \"backCol\", \"Blue\");

//Send SDO's to all updated HV channels
for (i=0;i<=47;i++){

    //Read one HV channel
    channel=i+100;
    dpSetWait(\"Crate00.Controller.CCchRead.Send:_original.._value\", channel);
    
    //Compare Send and Receive values for this channel
    valset1=makeDynString(\"HVchVolt\",\"HVchITrp\",\"HVchRamp\"); 
    for (j=1;j<=3; j++){
        sprintf(DPsend, \"Crate00.Channel%02d.%s.Send:_original.._value\",i,valset1[j]);
        sprintf(DPrecv, \"Crate00.Channel%02d.%s.Recv:_original.._value\",i,valset1[j]);
        dpGet(DPsend, VALsend);
        dpGet(DPrecv, VALrecv);
        
        //Send new value to crate controller only when changed
        if (VALsend != VALrecv) {
           dpSetWait(DPsend, VALsend);
        }

    }
}
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 


}




PS_HVSet()
{
dyn_errClass err;
int  channel, i,icard,lv;
int set;

//User wait
setValue(\"\", \"backCol\", \"Red\");

for (i=0;i<=47;i++){
    
    //set this HV channel
    channel=100+i;
    dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", channel);
    delay(0,50);
    }
    
  setValue(\"\", \"backCol\", \"{102,102,204}\");
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}

" 0
 E E E
13 28
"Button10"
""
1 20 180 E E E 1 E 1 E N {0,0,0} E N {153,204,204} E E
 E E
25 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
18 178 112 212
T 
1
LANG:1 3 OFF
"// SimpleCtrlScriptStart {invalid}
main()
{

   PS_LVON();
   PS_HVON();
   PS_LVSet();   
   PS_HVSet();
 
}

PS_HVON()
{
dyn_errClass err;
int i,j, channel;
string DPsend, DPrecv;
float VALsend, VALrecv;
dyn_string valset1, valset2; 
dyn_float initValue;

//User Wait
setValue(\"\", \"backCol\", \"Blue\");

//Send SDO's to all updated HV channels
for (i=0;i<=47;i++){

    //Read one HV channel
    channel=i+100;
    dpSetWait(\"Crate00.Controller.CCchRead.Send:_original.._value\", channel);
    
    //Compare Send and Receive values for this channel
    valset1=makeDynString(\"HVchVolt\",\"HVchITrp\",\"HVchRamp\"); 
    for (j=1;j<=3; j++){
        sprintf(DPsend, \"Crate00.Channel%02d.%s.Send:_original.._value\",i,valset1[j]);
        sprintf(DPrecv, \"Crate00.Channel%02d.%s.Recv:_original.._value\",i,valset1[j]);
        dpGet(DPsend, VALsend);
        dpGet(DPrecv, VALrecv);
        
        //Send new value to crate controller only when changed
        if (VALsend != VALrecv) {
           dpSetWait(DPsend, VALsend);
        }

    }
}
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 


}


PS_LVON()
{
dyn_errClass err;
int i,j, channel;
string DPsend, DPrecv;
float VALsend, VALrecv;
dyn_string valset1, valset2; 
dyn_float initValue;

//User wait
setValue(\"\", \"backCol\", \"Green\");

//Send SDO's to all updated LV channels
for (i=0;i<=47;i++){

    //Read one LV channel
    dpSetWait(\"Crate00.Controller.CCchRead.Send:_original.._value\",i);
    
    //Compare Send and Receive values for this channel
    valset2=makeDynString(\"LVcaTrip\",\"LVcaMask\",\"LVch_Vcc\",\"LVch_Vdd\",\"LVchVCSV\",\"LVchPINV\",\"LVchDTrp\",\"LVchCTrp\",\"LVchTTrp\",\"LVchTLim\",\"LVchCLKS\",\"LVchCLKR\",\"LVchVOut\");
    for (j=3;j<=13;j++){
        sprintf(DPsend, \"Crate00.Channel%02d.%s.Send:_original.._value\",i,valset2[j]);
        sprintf(DPrecv, \"Crate00.Channel%02d.%s.Recv:_original.._value\",i,valset2[j]);
        dpGet(DPsend, VALsend);
        dpGet(DPrecv, VALrecv);
        
        //Send new value to crate controller only when changed
        if (VALsend != VALrecv) {
           dpSetWait(DPsend, VALsend);
        }
    }
}
//set this LV channels after changing all new values
dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", i);

  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
  
}


PS_LVSet()
{
dyn_errClass err;
int  channel, i,icard,lv;
int set;

//User wait
setValue(\"\", \"backCol\", \"Yellow\");

for (i=0;i<=47;i++){

    //set this HV channel
    dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", i);
    delay(0,50);

  setValue(\"\", \"backCol\", \"{102,102,204}\");
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 
}

}

PS_HVSet()
{
dyn_errClass err;
int  channel, i,icard,lv;
int set;

//User wait
setValue(\"\", \"backCol\", \"Red\");

for (i=0;i<=47;i++){
    
    //set this HV channel
    channel=100+i;
    dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", channel);
    delay(0,50);
    }
    
  setValue(\"\", \"backCol\", \"{102,102,204}\");
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 41
"Button11"
""
1 110 50 E E E 1 E 1 E N {0,0,0} E N {153,204,204} E E
 E E
36 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
108 48 202 82
T 
1
LANG:1 5 LV ON
"// SimpleCtrlScriptStart {invalid}
main()
{

   PS_LVON();  
   PS_LVSet();
 
}

PS_LVON()
{
dyn_errClass err;
int i,j, channel;
string DPsend, DPrecv;
float VALsend, VALrecv;
dyn_string valset1, valset2; 
dyn_float initValue;

//User Wait
setValue(\"\", \"backCol\", \"Blue\");

//Send SDO's to all updated HV channels
for (i=0;i<=47;i++){

    //Read one HV channel
    channel=i+100;
    dpSetWait(\"Crate00.Controller.CCchRead.Send:_original.._value\", channel);
    
    //Compare Send and Receive values for this channel
    valset1=makeDynString(\"HVchVolt\",\"HVchITrp\",\"HVchRamp\"); 
    for (j=1;j<=3; j++){
        sprintf(DPsend, \"Crate00.Channel%02d.%s.Send:_original.._value\",i,valset1[j]);
        sprintf(DPrecv, \"Crate00.Channel%02d.%s.Recv:_original.._value\",i,valset1[j]);
        dpGet(DPsend, VALsend);
        dpGet(DPrecv, VALrecv);
        
        //Send new value to crate controller only when changed
        if (VALsend != VALrecv) {
           dpSetWait(DPsend, VALsend);
        }

    }
}
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 


}




PS_LVSet()
{
dyn_errClass err;
int  channel, i,icard,lv;
int set;

//User wait
setValue(\"\", \"backCol\", \"Red\");

for (i=0;i<=47;i++){
    
    //set this HV channel
    channel=100+i;
    dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", channel);
    delay(0,50);
    }
    
  setValue(\"\", \"backCol\", \"{102,102,204}\");
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 
}
" 0
 E E E
13 42
"Button13"
""
1 20 80 E E E 1 E 1 E N {0,0,0} E N {153,204,204} E E
 E E
37 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
18 78 112 112
T 
1
LANG:1 10 HV STANDBY
"// SimpleCtrlScriptStart {invalid}
main()
{

   PS_HVOStandby();  
   PS_HVSet();
 
}

PS_HVOFF()
{
dyn_errClass err;
int i,j, channel;
string DPsend, DPrecv;
float VALsend, VALrecv;
dyn_string valset1, valset2; 
dyn_float initValue;

//User Wait
setValue(\"\", \"backCol\", \"Blue\");

//Send SDO's to all updated HV channels
for (i=0;i<=47;i++){

    //Read one HV channel
    channel=i+100;
    dpSetWait(\"Crate00.Controller.CCchRead.Send:_original.._value\", channel);
    
    //Compare Send and Receive values for this channel
    valset1=makeDynString(\"HVchVolt\",\"HVchITrp\",\"HVchRamp\"); 
    for (j=1;j<=3; j++){
        sprintf(DPsend, \"Crate00.Channel%02d.%s.Send:_original.._value\",i,valset1[j]);
        sprintf(DPrecv, \"Crate00.Channel%02d.%s.Recv:_original.._value\",i,valset1[j]);
        dpGet(DPsend, VALsend);
        dpGet(DPrecv, VALrecv);
        
        //Send new value to crate controller only when changed
        if (VALsend != VALrecv) {
           dpSetWait(DPsend, VALsend);
        }

    }
}
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 


}




PS_HVSet()
{
dyn_errClass err;
int  channel, i,icard,lv;
int set;

//User wait
setValue(\"\", \"backCol\", \"Red\");

for (i=0;i<=47;i++){
    
    //set this HV channel
    channel=100+i;
    dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", channel);
    delay(0,50);
    }
    
  setValue(\"\", \"backCol\", \"{102,102,204}\");
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 44
"Button17"
""
1 110 80 E E E 1 E 1 E N {0,0,0} E N {153,204,204} E E
 E E
39 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
108 78 202 112
T 
1
LANG:1 10 LV STANDBY
"// SimpleCtrlScriptStart {invalid}
main()
{

   PS_LVstandby();  
   PS_LVSet();
 
}

PS_LVstandby()
{
dyn_errClass err;
int i,j, channel;
string DPsend, DPrecv;
float VALsend, VALrecv;
dyn_string valset1, valset2; 
dyn_float initValue;

//User Wait
setValue(\"\", \"backCol\", \"Blue\");

//Send SDO's to all updated HV channels
for (i=0;i<=47;i++){

    //Read one HV channel
    channel=i+100;
    dpSetWait(\"Crate00.Controller.CCchRead.Send:_original.._value\", channel);
    
    //Compare Send and Receive values for this channel
    valset1=makeDynString(\"HVchVolt\",\"HVchITrp\",\"HVchRamp\"); 
    for (j=1;j<=3; j++){
        sprintf(DPsend, \"Crate00.Channel%02d.%s.Send:_original.._value\",i,valset1[j]);
        sprintf(DPrecv, \"Crate00.Channel%02d.%s.Recv:_original.._value\",i,valset1[j]);
        dpGet(DPsend, VALsend);
        dpGet(DPrecv, VALrecv);
        
        //Send new value to crate controller only when changed
        if (VALsend != VALrecv) {
           dpSetWait(DPsend, VALsend);
        }

    }
}
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 


}




PS_LVSet()
{
dyn_errClass err;
int  channel, i,icard,lv;
int set;

//User wait
setValue(\"\", \"backCol\", \"Red\");

for (i=0;i<=47;i++){
    
    //set this HV channel
    channel=100+i;
    dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", channel);
    delay(0,50);
    }
    
  setValue(\"\", \"backCol\", \"{102,102,204}\");
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 
}
" 0
 E E E
13 25
"Button6"
""
1 20 110 E E E 1 E 1 E N {0,0,0} E N {153,204,204} E E
 E E
22 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
18 108 112 142
T 
1
LANG:1 6 HV OFF
"// SimpleCtrlScriptStart {invalid}
main()
{

   PS_HVOFF();  
   PS_HVSet();
 
}

PS_HVON()
{
dyn_errClass err;
int i,j, channel;
string DPsend, DPrecv;
float VALsend, VALrecv;
dyn_string valset1, valset2; 
dyn_float initValue;

//User Wait
setValue(\"\", \"backCol\", \"Blue\");

//Send SDO's to all updated HV channels
for (i=0;i<=47;i++){

    //Read one HV channel
    channel=i+100;
    dpSetWait(\"Crate00.Controller.CCchRead.Send:_original.._value\", channel);
    
    //Compare Send and Receive values for this channel
    valset1=makeDynString(\"HVchVolt\",\"HVchITrp\",\"HVchRamp\"); 
    for (j=1;j<=3; j++){
        sprintf(DPsend, \"Crate00.Channel%02d.%s.Send:_original.._value\",i,valset1[j]);
        sprintf(DPrecv, \"Crate00.Channel%02d.%s.Recv:_original.._value\",i,valset1[j]);
        dpGet(DPsend, VALsend);
        dpGet(DPrecv, VALrecv);
        
        //Send new value to crate controller only when changed
        if (VALsend != VALrecv) {
           dpSetWait(DPsend, VALsend);
        }

    }
}
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 


}




PS_HVSet()
{
dyn_errClass err;
int  channel, i,icard,lv;
int set;

//User wait
setValue(\"\", \"backCol\", \"Red\");

for (i=0;i<=47;i++){
    
    //set this HV channel
    channel=100+i;
    dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", channel);
    delay(0,50);
    }
    
  setValue(\"\", \"backCol\", \"{102,102,204}\");
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 26
"Button7"
""
1 132 210 E E E 1 E 1 E N {0,0,0} E N {153,204,204} E E
 E E
23 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
108 108 202 142
T 
1
LANG:1 6 LV OFF
"// SimpleCtrlScriptStart {invalid}
main()
{

   PS_HVOFF();  
   PS_HVSet();
 
}

PS_HVOFF()
{
dyn_errClass err;
int i,j, channel;
string DPsend, DPrecv;
float VALsend, VALrecv;
dyn_string valset1, valset2; 
dyn_float initValue;

//User Wait
setValue(\"\", \"backCol\", \"Blue\");

//Send SDO's to all updated HV channels
for (i=0;i<=47;i++){

    //Read one HV channel
    channel=i+100;
    dpSetWait(\"Crate00.Controller.CCchRead.Send:_original.._value\", channel);
    
    //Compare Send and Receive values for this channel
    valset1=makeDynString(\"HVchVolt\",\"HVchITrp\",\"HVchRamp\"); 
    for (j=1;j<=3; j++){
        sprintf(DPsend, \"Crate00.Channel%02d.%s.Send:_original.._value\",i,valset1[j]);
        sprintf(DPrecv, \"Crate00.Channel%02d.%s.Recv:_original.._value\",i,valset1[j]);
        dpGet(DPsend, VALsend);
        dpGet(DPrecv, VALrecv);
        
        //Send new value to crate controller only when changed
        if (VALsend != VALrecv) {
           dpSetWait(DPsend, VALsend);
        }

    }
}
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 


}




PS_HVSet()
{
dyn_errClass err;
int  channel, i,icard,lv;
int set;

//User wait
setValue(\"\", \"backCol\", \"Red\");

for (i=0;i<=47;i++){
    
    //set this HV channel
    channel=100+i;
    dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", channel);
    delay(0,50);
    }
    
  setValue(\"\", \"backCol\", \"{102,102,204}\");
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 
}
" 0
 E E E
13 46
"Button19"
""
1 110 150 E E E 1 E 1 E N {0,0,0} E N {153,204,204} E E
 E E
41 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
108 148 202 182
T 
1
LANG:1 7 STANDBY
"// SimpleCtrlScriptStart {invalid}
main()
{

   PS_LVON();
   PS_HVON();
   PS_LVSet();   
   PS_HVSet();
 
}

PS_HVON()
{
dyn_errClass err;
int i,j, channel;
string DPsend, DPrecv;
float VALsend, VALrecv;
dyn_string valset1, valset2; 
dyn_float initValue;

//User Wait
setValue(\"\", \"backCol\", \"Blue\");

//Send SDO's to all updated HV channels
for (i=0;i<=47;i++){

    //Read one HV channel
    channel=i+100;
    dpSetWait(\"Crate00.Controller.CCchRead.Send:_original.._value\", channel);
    
    //Compare Send and Receive values for this channel
    valset1=makeDynString(\"HVchVolt\",\"HVchITrp\",\"HVchRamp\"); 
    for (j=1;j<=3; j++){
        sprintf(DPsend, \"Crate00.Channel%02d.%s.Send:_original.._value\",i,valset1[j]);
        sprintf(DPrecv, \"Crate00.Channel%02d.%s.Recv:_original.._value\",i,valset1[j]);
        dpGet(DPsend, VALsend);
        dpGet(DPrecv, VALrecv);
        
        //Send new value to crate controller only when changed
        if (VALsend != VALrecv) {
           dpSetWait(DPsend, VALsend);
        }

    }
}
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 


}


PS_LVON()
{
dyn_errClass err;
int i,j, channel;
string DPsend, DPrecv;
float VALsend, VALrecv;
dyn_string valset1, valset2; 
dyn_float initValue;

//User wait
setValue(\"\", \"backCol\", \"Green\");

//Send SDO's to all updated LV channels
for (i=0;i<=47;i++){

    //Read one LV channel
    dpSetWait(\"Crate00.Controller.CCchRead.Send:_original.._value\",i);
    
    //Compare Send and Receive values for this channel
    valset2=makeDynString(\"LVcaTrip\",\"LVcaMask\",\"LVch_Vcc\",\"LVch_Vdd\",\"LVchVCSV\",\"LVchPINV\",\"LVchDTrp\",\"LVchCTrp\",\"LVchTTrp\",\"LVchTLim\",\"LVchCLKS\",\"LVchCLKR\",\"LVchVOut\");
    for (j=3;j<=13;j++){
        sprintf(DPsend, \"Crate00.Channel%02d.%s.Send:_original.._value\",i,valset2[j]);
        sprintf(DPrecv, \"Crate00.Channel%02d.%s.Recv:_original.._value\",i,valset2[j]);
        dpGet(DPsend, VALsend);
        dpGet(DPrecv, VALrecv);
        
        //Send new value to crate controller only when changed
        if (VALsend != VALrecv) {
           dpSetWait(DPsend, VALsend);
        }
    }
}
//set this LV channels after changing all new values
dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", i);

  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
  
}


PS_LVSet()
{
dyn_errClass err;
int  channel, i,icard,lv;
int set;

//User wait
setValue(\"\", \"backCol\", \"Yellow\");

for (i=0;i<=47;i++){

    //set this HV channel
    dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", i);
    delay(0,50);

  setValue(\"\", \"backCol\", \"{102,102,204}\");
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 
}

}

PS_HVSet()
{
dyn_errClass err;
int  channel, i,icard,lv;
int set;

//User wait
setValue(\"\", \"backCol\", \"Red\");

for (i=0;i<=47;i++){
    
    //set this HV channel
    channel=100+i;
    dpSetWait(\"Crate00.Controller.CCch_Set.Send:_original.._value\", channel);
    delay(0,50);
    }
    
  setValue(\"\", \"backCol\", \"{102,102,204}\");
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err); 
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
0
LAYER, 1 
1
LANG:1 6 Layer2
0
LAYER, 2 
1
LANG:1 6 Layer3
0
LAYER, 3 
1
LANG:1 6 Layer4
0
LAYER, 4 
1
LANG:1 6 Layer5
0
LAYER, 5 
1
LANG:1 6 Layer6
0
LAYER, 6 
1
LANG:1 6 Layer7
0
LAYER, 7 
1
LANG:1 6 Layer8
0
0