V 10
1
LANG:1 2 HV
PANEL,481 265 255 465 N {204,204,204} 0
EEE E E 1 -1 -1 0  20 30
"" 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
2 1
"Text1"
""
1 30 41 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
2 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  0 E 32 43 99 58
0 2 0 "s" 0 0 0 192 0 0  32 43
 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 11 Channel Nb.
2 31
"Text2"
""
1 57 91 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
28 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  0 E 32 73 92 88
0 2 0 "s" 0 0 0 192 0 0  32 73
 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 11 LV slot Nb.
2 33
"Text3"
""
1 57 122 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
29 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  0 E 32 104 93 119
0 2 0 "s" 0 0 0 192 0 0  32 104
 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 11 HV slot Nb.
2 36
"Text5"
""
1 30 11 E E E 1 E 1 E N {0,0,0} E N "_Transparent" 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  0 E 32 13 84 28
0 2 0 "s" 0 0 0 192 0 0  32 13
 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 9 Crate Nb.
13 10
"LVonCH"
""
1 120 158 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E E
10 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
118 156 202 190
T 
1
LANG:1 8 LV CH ON
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int hv,icard;
const int max = 4;
//char *datapoint[max];
//[20]= {\"HVcaMask\", \"HVcoVolt\", \"HVcoITrp\",  \"HVcoRamp\"};
string datapoint1;
int i,j;
dyn_string valset; 
dyn_float initValue;



dpGet(\"SCTps:Item.HV:_original.._value\", hv);
valset=makeDynString(\"LVccTrip\",\"LVccMask\",\"LVco_Vcc\",\"LVco_Vdd\",\"LVcoVCSV\",\"LVcoPINV\",\"LVcoDTrp\",\"LVcoCTrp\",\"LVcoTTrp\",\"LVcoTLim\",\"LVcoCLKS\",\"LVcoCLKR\",\"LVcoVOut\");
initValue=makeDynFloat(46*2.5,15,3.5*50,4*50,4*25,6*20,50/2,50/2,128+50,128+60,0,0,1);
 for(j=1; j<=13; j++)
    {
	if(j<=2)
	  {
// swithcing on all LV Cards 
       icard=hv/4;
//       sprintf(datapoint1, \"SCTps:Crate0.LVCard_%d.%s:_original.._value\",icard,valset[j]);
//       dpSetWait(datapoint1, initValue[j]);
 	  }
// swithcing on all LV Channels 
 	else
      {
      sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.LV.%s:_original.._value\",hv,valset[j] );
      dpSetWait(datapoint1, initValue[j]);
      }
   }
   
  
      setValue(\"\", \"backCol\", \"Red\"); 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
     setValue(\"\", \"backCol\", \"{204,204,204}\");
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate1.HV.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 12
"HVonCH"
""
1 40 158 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E E
12 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
38 156 122 190
T 
1
LANG:1 8 HV CH ON
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int i,icard;
const int max = 4;
string datapoint;
int hv;

//char *datapoint[max];
//[20]= {\"HVcaMask\", \"HVcoVolt\", \"HVcoITrp\",  \"HVcoRamp\"};
string datapoint1;

dpGet(\"SCTps:Item.HV:_original.._value\", hv);
icard=hv/8;
//sprintf(datapoint1, \"SCTps:Crate0.HVCard_%d.%s:_original.._value\",icard,\"HVccMask\" );
//dpSetWait(datapoint1, 255);
sprintf(datapoint1, \"SCTps:Crate0.Channel_%02d.HV.%s:_original.._value\",hv,\"HVcoVolt\" );
dpSetWait(datapoint1, 100);
DebugN( datapoint1, hv );
sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",hv,\"HVcoITrp\" );
dpSetWait(datapoint1, 1100);
sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",hv,\"HVcoRamp\" );
dpSetWait(datapoint1, 3);



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

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate1.HV.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 14
"HVoffCH"
""
1 40 188 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E E
14 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
38 186 122 220
T 
1
LANG:1 9 HV CH OFF
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int i,icard;
const int max = 4;
string datapoint;
int hv;

//char *datapoint[max];
//[20]= {\"HVcaMask\", \"HVcoVolt\", \"HVcoITrp\",  \"HVcoRamp\"};
string datapoint1;

dpGet(\"SCTps:Item.HV:_original.._value\", hv);
icard=hv/8;

sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",hv,\"HVcoVolt\" );
dpSetWait(datapoint1, 0);
sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",hv,\"HVcoITrp\" );
dpSetWait(datapoint1, 1100);
sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",hv,\"HVcoRamp\" );
dpSetWait(datapoint1, 3);
//sprintf(datapoint1, \"SCTps:Crate0.HVCard_%d.%s:_original.._value\",icard,\"HVccMask\" );
//dpSetWait(datapoint1, 0);
  
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate1.HV.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 15
"LVoffCH"
""
1 140 288 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E E
15 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
118 186 202 220
T 
1
LANG:1 9 LV CH OFF
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int hv,icard;
const int max = 4;
//char *datapoint[max];
//[20]= {\"HVcaMask\", \"HVcoVolt\", \"HVcoITrp\",  \"HVcoRamp\"};
string datapoint1;
int i,j;
dyn_string valset; 
dyn_float initValue;



dpGet(\"SCTps:Item.HV:_original.._value\", hv);
valset=makeDynString(\"LVccTrip\",\"LVccMask\",\"LVco_Vcc\",\"LVco_Vdd\",\"LVcoVCSV\",\"LVcoPINV\",\"LVcoDTrp\",\"LVcoCTrp\",\"LVcoTTrp\",\"LVcoTLim\",\"LVcoCLKS\",\"LVcoCLKR\",\"LVcoVOut\");
initValue=makeDynFloat(46*2.5,15,0.*50,0*50,0*25,0*20,50/2,50/2,128+50,128+60,0,0,0);
 for(j=1; j<=13; j++)
    {
	if(j<=2)
	  {
// swithcing on all LV Cards 
//       icard=hv/4;
//       sprintf(datapoint1, \"SCTps:Crate0.LVCard_%d.%s:_original.._value\",icard,valset[j]);
//       dpSetWait(datapoint1, initValue[j]);
 	  }
// swithcing on all LV Channels 
 	else
      {
      sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.LV.%s:_original.._value\",hv,valset[j] );
      dpSetWait(datapoint1, initValue[j]);
      }
   }
   
      setValue(\"\", \"backCol\", \"Red\");
 
  
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
 
      setValue(\"\", \"backCol\", \"{204,204,204}\");
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate1.HV.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 16
"SendHVch"
""
1 40 128 E E E 1 E 1 E N {255,255,255} E N {0,0,255} E E
 E E
15 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 ""
38 126 122 160
T 
1
LANG:1 7 SEND CH
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int hv;

  dpGet(\"SCTps:Item.HV:_original.._value\", hv);
  hv=hv+100;
  dpSetWait(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\", hv);
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate0.Elmb_0.CCco_Set}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 17
"ReadHVch"
""
1 462 248 E E E 1 E 1 E N {255,255,255} E N {0,0,255} E E
 E E
16 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 ""
38 216 122 250
T 
1
LANG:1 7 READ CH
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int hv;

  dpGet(\"SCTps:Item.HV:_original.._value\", hv);
  hv=hv+100;
  dpSetWait(\"SCTps:Crate0.Elmb_0.CCcmRead:_original.._value\", hv);
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate0.Elmb_0.CCco_Set}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 18
"SendLVch"
""
1 120 128 E E E 1 E 1 E N {255,255,255} E N {255,153,51} E E
 E E
17 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 ""
118 126 202 160
T 
1
LANG:1 7 SEND CH
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int lv;

  dpGet(\"SCTps:Item.HV:_original.._value\", lv);
  dpSetWait(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\", lv);
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate0.Elmb_0.CCco_Set}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 19
"ReadLVch"
""
1 120 218 E E E 1 E 1 E N {255,255,255} E N {255,153,51} E E
 E E
18 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 ""
118 216 202 250
T 
1
LANG:1 7 READ CH
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int lv;

  dpGet(\"SCTps:Item.HV:_original.._value\", lv);
  dpSetWait(\"SCTps:Crate0.Elmb_0.CCcmRead:_original.._value\", lv);
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate0.Elmb_0.CCco_Set}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 22
"Button9"
""
1 120 344 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
21 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
118 342 202 376
T 
1
LANG:1 8 LV CA ON
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int hv,icard;
string datapoint1;
int i,j;
dyn_string valset; 
dyn_float initValue;


dpGet(\"SCTps:Item.HV:_original.._value\", hv);
icard=hv/4;

for (i=icard*4;i<=icard*4+3;i++){

valset=makeDynString(\"LVccTrip\",\"LVccMask\",\"LVco_Vcc\",\"LVco_Vdd\",\"LVcoVCSV\",\"LVcoPINV\",\"LVcoDTrp\",\"LVcoCTrp\",\"LVcoTTrp\",\"LVcoTLim\",\"LVcoCLKS\",\"LVcoCLKR\",\"LVcoVOut\");
initValue=makeDynFloat(46*2.5,15,3.5*50,4*50,4*25,6*20,50/2,50/2,128+50,128+60,0,0,1);
 for(j=1; j<=13; j++)
    {
	if(j<=2)
	  {
      }
 	else
      {
      sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.LV.%s:_original.._value\",i,valset[j] );
      dpSetWait(datapoint1, initValue[j]);
//DebugN(\"i\", i ,\"hv\", hv,\"valset[j]\", valset[j], \"initValue[j]\", initValue[j]);
      }

   }
   
      setValue(\"\", \"backCol\", \"Red\");
      DebugN(\" LV channel\", i);  
  
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
 }
      setValue(\"\", \"backCol\", \"{204,204,204}\");
}
// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate1.HV.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 23
"CardONHV"
""
1 40 344 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
22 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
38 342 122 376
T 
1
LANG:1 8 HV CA ON
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int i,icard;
const int max = 4;
string datapoint;
int hv;

//char *datapoint[max];
//[20]= {\"HVcaMask\", \"HVcoVolt\", \"HVcoITrp\",  \"HVcoRamp\"};
string datapoint1;

dpGet(\"SCTps:Item.HV:_original.._value\", hv);
icard=hv/8;

for (i=icard*8;i<=icard*8+7;i++){
  //sprintf(datapoint1, \"SCTps:Crate0.HVCard_%d.%s:_original.._value\",icard,\"HVccMask\" );
  //dpSetWait(datapoint1, 255);
  sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",i,\"HVcoVolt\" );
  dpSetWait(datapoint1, 100);
  sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",i,\"HVcoITrp\" );
  dpSetWait(datapoint1, 1100);
  sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",i,\"HVcoRamp\" );
  dpSetWait(datapoint1, 3);


      setValue(\"\", \"backCol\", \"Red\");
      DebugN(\" HV channel\", i);  
  
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
 }
      setValue(\"\", \"backCol\", \"{204,204,204}\");
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate1.HV.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 24
"CardOFFHV"
""
1 40 374 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
23 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
38 372 122 406
T 
1
LANG:1 9 HV CA OFF
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int i,icard;
const int max = 4;
string datapoint;
int hv;

//char *datapoint[max];
//[20]= {\"HVcaMask\", \"HVcoVolt\", \"HVcoITrp\",  \"HVcoRamp\"};
string datapoint1;

dpGet(\"SCTps:Item.HV:_original.._value\", hv);
icard=hv/8;

for (i=icard*8;i<=icard*8+7;i++){
  sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",i,\"HVcoVolt\" );
  dpSetWait(datapoint1, 0);
  sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",i,\"HVcoITrp\" );
  dpSetWait(datapoint1, 1100);
  sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",i,\"HVcoRamp\" );
  dpSetWait(datapoint1, 3);
//sprintf(datapoint1, \"SCTps:Crate0.HVCard_%d.%s:_original.._value\",icard,\"HVccMask\" );
//dpSetWait(datapoint1, 0);


      setValue(\"\", \"backCol\", \"Red\");
      DebugN(\" HV channel\", i);  
  
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
 }
      setValue(\"\", \"backCol\", \"{204,204,204}\");
}
// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate1.HV.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 25
"Button12"
""
1 140 474 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
24 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
118 372 202 406
T 
1
LANG:1 9 LV CA OFF
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int hv,icard;
const int max = 4;
//char *datapoint[max];
//[20]= {\"HVcaMask\", \"HVcoVolt\", \"HVcoITrp\",  \"HVcoRamp\"};
string datapoint1;
int i,j;
dyn_string valset; 
dyn_float initValue;

dpGet(\"SCTps:Item.HV:_original.._value\", hv);
icard=hv/4;

for (i=icard*4;i<=icard*4+3;i++){

dpGet(\"SCTps:Item.HV:_original.._value\", hv);
valset=makeDynString(\"LVccTrip\",\"LVccMask\",\"LVco_Vcc\",\"LVco_Vdd\",\"LVcoVCSV\",\"LVcoPINV\",\"LVcoDTrp\",\"LVcoCTrp\",\"LVcoTTrp\",\"LVcoTLim\",\"LVcoCLKS\",\"LVcoCLKR\",\"LVcoVOut\");
initValue=makeDynFloat(46*2.5,15,0.*50,0*50,0*25,0*20,50/2,50/2,128+50,128+60,0,0,0);
 for(j=1; j<=13; j++)
    {
	if(j<=2)
	  {
// swithcing on all LV Cards 
       icard=hv/4;
//       sprintf(datapoint1, \"SCTps:Crate0.LVCard_%d.%s:_original.._value\",icard,valset[j]);
//       dpSetWait(datapoint1, initValue[j]);
 	  }
// swithcing on all LV Channels 
 	else
      {
      sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.LV.%s:_original.._value\",i,valset[j] );
      dpSetWait(datapoint1, initValue[j]);
//  DebugN(\"i\", i ,\"hv\", hv,\"valset[j]\", valset[j], \"initValue\", initValue[j]);
      }
   }
      setValue(\"\", \"backCol\", \"Red\");
      DebugN(\" LV channel\", i);  
  
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
 }
  setValue(\"\", \"backCol\", \"{204,204,204}\");
}



// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate1.HV.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 26
"SendCard"
""
1 40 314 E E E 1 E 1 E N {255,255,255} E N {0,0,255} 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 ""
38 312 122 346
T 
1
LANG:1 9 SEND CARD
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int hv, icard, channel, i;

dpGet(\"SCTps:Item.HV:_original.._value\", hv); 
icard=hv/8;

for (i=icard*8;i<=icard*8+7;i++){

//DebugN(\"hv\", hv ,\"icard\", icard,\"i\", i);
channel=i+100;
dpSetWait(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\", channel);
delay(0,10);
//    dpGet(\"SCTps:Item.HV:_original.._value\", hv);
//   delay(500);  
//  hv=hv+1;
//DebugN(\"i\", i,\"channel\", channel); 
// dpSetWait(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\", hv);
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
 }
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate0.Elmb_0.CCco_Set}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 27
"ReadCard"
""
1 462 434 E E E 1 E 1 E N {255,255,255} E N {51,51,255} E E
 E E
26 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 ""
38 402 122 436
T 
1
LANG:1 9 READ CARD
"// SimpleCtrlScriptStart {invalid}

main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int hv, icard, channel, i;

dpGet(\"SCTps:Item.HV:_original.._value\", hv); 
icard=hv/8;

for (i=icard*8;i<=icard*8+7;i++){

//DebugN(\"hv\", hv ,\"icard\", icard,\"i\", i);
channel=i+100;
dpSetWait(\"SCTps:Crate0.Elmb_0.CCcmRead:_original.._value\", channel);
//    dpGet(\"SCTps:Item.HV:_original.._value\", hv);
//   delay(500);  
//  hv=hv+1;
//DebugN(\"i\", i,\"channel\", channel); 
// dpSetWait(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\", hv);
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
 }
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate0.Elmb_0.CCco_Set}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 28
"Button15"
""
1 120 314 E E E 1 E 1 E N {255,255,255} E N {255,153,51} E E
 E E
27 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 ""
118 312 202 346
T 
1
LANG:1 4 SEND
"// SimpleCtrlScriptStart {invalid}

main()
{
  EP_setDP();
}

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

dpGet(\"SCTps:Item.HV:_original.._value\", lv); 
icard=lv/4;

for (i=icard*4;i<=icard*4+3;i++){
 //sprintf(function, \"SET%d\",i);

 SET(i);
//DebugN(\"lv\", lv ,\"icard\", icard,\"i\", i);
dpGet(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\",set);
//DebugN(\"i\", i,\"ELMB set \",set); 
 //delay(10);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
 }
}

SET(int i)
{
//DebugN(\"try \",i);
delay(0,50);
dpSetWait(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\", i);
}


// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate0.Elmb_0.CCco_Set}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 29
"Button16"
""
1 120 404 E E E 1 E 1 E N {255,255,255} E N {255,153,51} E E
 E E
28 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 ""
118 402 202 436
T 
1
LANG:1 4 READ
"// SimpleCtrlScriptStart {invalid}

main()
{
  EP_setDP();
}

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

dpGet(\"SCTps:Item.HV:_original.._value\", lv); 
icard=lv/4;

for (i=icard*4;i<=icard*4+3;i++){

//DebugN(\"lv\", lv ,\"icard\", icard,\"i\", i);
channel=i;
dpSetWait(\"SCTps:Crate0.Elmb_0.CCcmRead:_original.._value\", channel);
delay(0,10);
//DebugN(\"i\", i,\"icard\", icard); 
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
 }
}


// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate0.Elmb_0.CCco_Set}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
14 30
"ChannelNb"
""
1 110 41 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
28 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,3,2,1,49,Courier New
0 ""
108 39 172 65
3 "s" 0 0 0 0 0 0 
E
"main()
{
 
  dpConnect(\"EP_textFieldInCB\",\"SCTps:Item.HV:_original.._value\");

}

EP_textFieldInCB(string dp, int iNewValue)
{
string sTmp;

dpGet(dp, iNewValue);
sprintf(sTmp,\"%d\",iNewValue);
setValue(\"\", \"text\", sTmp );
}
" 0

"// SimpleCtrlScriptStart {valid}
main()
{
  EP_textFieldOut();
}

EP_textFieldOut()
{
int iNewValue;
dyn_errClass err;
string sTmp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%d\", iNewValue);

  if( iNewValue != sTmp )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTps:Item.HV:_original.._value\", iNewValue);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTps:Item.HV}
// Config {:_original.._value}
// DPType {int}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

14 32
"LVslot"
""
1 220 91 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
29 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,3,2,1,49,Courier New
0 ""
108 69 172 95
3 "s" 0 0 0 0 0 0 
E
"main()
{
 
  dpConnect(\"EP_textFieldInCB\",\"SCTps:Item.HV:_original.._value\");

}

EP_textFieldInCB(string dp, int iNewValue)
{
string sTmp;
dyn_int lv;
int slot;

lv=makeDynInt(0,2,3,5,6,8,9,11,12,14,15,17);

dpGet(dp, iNewValue);
iNewValue=iNewValue/4+1;
slot=lv[iNewValue];
sprintf(sTmp,\"%d\",slot);
setValue(\"\", \"text\", sTmp );
} " 0

"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldOut();
}

EP_textFieldOut()
{
int iNewValue,channel,donot;
dyn_errClass err;
string sTmp;

  donot==0;
  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%d\", iNewValue);

  if( iNewValue != sTmp )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }


  if(iNewValue==0) channel=0;
  else if(iNewValue==2) channel=4;
  else if(iNewValue==3) channel=8;
  else if(iNewValue==5) channel=12;
  else if(iNewValue==6) channel=16;
  else if(iNewValue==8) channel=20;
  else if(iNewValue==9) channel=24;
  else if(iNewValue==11) channel=28;
  else if(iNewValue==12) channel=32;
  else if(iNewValue==14) channel=36;        
  else if(iNewValue==15) channel=40;
  else if(iNewValue==17) channel=44;
  else if(iNewValue>17) 
    {
     ChildPanelOnCentralModal(\"ErrorLVslot.pnl\",
      \"\",
      makeDynString(\"\"));  
      donot==1;
     }
  else 
    {
     ChildPanelOnCentralModal(\"ErrorLVslot1.pnl\",
      \"\",
      makeDynString(\"\"));       
      donot==1;
     } 

  if(donot==0)  dpSetWait(\"SCTps:Item.HV:_original.._value\", channel);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);

}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTps:Item.HV}
// Config {:_original.._value}
// DPType {int}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

14 35
"HVslot"
""
1 220 121 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
31 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,3,2,1,49,Courier New
0 ""
108 99 172 125
3 "s" 0 0 0 0 0 0 
E
"main()
{
 
  dpConnect(\"EP_textFieldInCB\",\"SCTps:Item.HV:_original.._value\");

}

EP_textFieldInCB(string dp, int iNewValue)
{
string sTmp;
dyn_int lv;
int slot;

lv=makeDynInt(1,4,7,10,13,16);

dpGet(dp, iNewValue);
iNewValue=iNewValue/8+1;
slot=lv[iNewValue];
sprintf(sTmp,\"%d\",slot);
setValue(\"\", \"text\", sTmp );
}" 0

"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldOut();
}

EP_textFieldOut()
{
int iNewValue,channel,donot;
dyn_errClass err;
string sTmp;

  donot=0;
  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%d\", iNewValue);

  if( iNewValue != sTmp )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  if(iNewValue==1) channel=0;
  else if(iNewValue==4) channel=8;
  else if(iNewValue==7) channel=16;
  else if(iNewValue==10) channel=24;
  else if(iNewValue==13) channel=32;
  else if(iNewValue==16) channel=40;
  else if(iNewValue>16) 
    {
     ChildPanelOnCentralModal(\"ErrorHVslot.pnl\",
      \"\",
      makeDynString(\"\"));  
      donot=1;
     }
  else 
    {
     ChildPanelOnCentralModal(\"ErrorHVslot1.pnl\",
      \"\",
      makeDynString(\"\"));       
      donot=1;
     } 
  if(donot==0) dpSetWait(\"SCTps:Item.HV:_original.._value\", channel);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTps:Item.HV}
// Config {:_original.._value}
// DPType {int}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

21 38
"SCrateNb"
""
1 180 11 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
34 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 107 -microsoft windows-Arial-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,3,2,1,34,Arial
0 ""
178 9 222 35
0
"// SimpleCtrlScriptStart {valid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

  if( dpSubStr( \"SCTps:Item.Crate:_online.._value\", DPSUB_DP_EL ) == \"\" )
  {
    setValue(\"\", \"color\", \"_dpdoesnotexist\");
    return;
  }

  dpConnect(\"EP_textFieldInCB\",
            \"SCTps:Item.Crate:_online.._value\");
  err = getLastError();
  if (dynlen(err) > 0)
    setValue(\"\", \"color\", \"_dpdoesnotexist\");

}


EP_textFieldInCB(string dp, int iNewValue)
{
  setValue(\"\", \"text\", dpValToString(dp, iNewValue, TRUE) );
}

EP_setInvalid()
{
dyn_errClass err;

  if( dpSubStr( \"SCTps:Item.Crate:_online.._invalid\", DPSUB_DP_EL ) == \"\" )
  {
    setValue(\"\", \"color\", \"_dpdoesnotexist\");
    return;
  }

  dpConnect(\"EP_setInvalidCB\",
            \"SCTps:Item.Crate:_online.._invalid\");
  err = getLastError();
  if (dynlen(err) > 0)
    setValue(\"\", \"color\", \"_dpdoesnotexist\");

}

EP_setInvalidCB(string dp, bool boInvalid)
{
  setValue(\"\", \"color\", (boInvalid ? \"_invalid\" : \"\"));
}

// SimpleCtrlScript {EP_textFieldIn}
// DP {SCTps:Item.Crate}
// DPConfig {:_online.._value}
// DPType {int}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTps:Item.Crate}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldOut();
}

EP_textFieldOut()
{
int iNewValue;
dyn_errClass err;
string sTmp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%d\", iNewValue);

  if( iNewValue != sTmp )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTps:Item.Crate:_original.._value\", iNewValue);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTps:Item.Crate}
// Config {:_original.._value}
// DPType {int}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

E

N 0 100 1 0 0 1
21 39
"sChannelNb"
""
1 180 41 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
35 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,3,2,1,49,Courier New
0 ""
178 39 222 65
0
"// SimpleCtrlScriptStart {valid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

  if( dpSubStr( \"SCTps:Item.HV:_online.._value\", DPSUB_DP_EL ) == \"\" )
  {
    setValue(\"\", \"color\", \"_dpdoesnotexist\");
    return;
  }

  dpConnect(\"EP_textFieldInCB\",
            \"SCTps:Item.HV:_online.._value\");
  err = getLastError();
  if (dynlen(err) > 0)
    setValue(\"\", \"color\", \"_dpdoesnotexist\");

}


EP_textFieldInCB(string dp, int iNewValue)
{
  setValue(\"\", \"text\", dpValToString(dp, iNewValue, TRUE) );
}

EP_setInvalid()
{
dyn_errClass err;

  if( dpSubStr( \"SCTps:Item.HV:_online.._invalid\", DPSUB_DP_EL ) == \"\" )
  {
    setValue(\"\", \"color\", \"_dpdoesnotexist\");
    return;
  }

  dpConnect(\"EP_setInvalidCB\",
            \"SCTps:Item.HV:_online.._invalid\");
  err = getLastError();
  if (dynlen(err) > 0)
    setValue(\"\", \"color\", \"_dpdoesnotexist\");

}

EP_setInvalidCB(string dp, bool boInvalid)
{
  setValue(\"\", \"color\", (boInvalid ? \"_invalid\" : \"\"));
}

// SimpleCtrlScript {EP_textFieldIn}
// DP {SCTps:Item.HV}
// DPConfig {:_online.._value}
// DPType {int}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTps:Item.HV}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

"// SimpleCtrlScriptStart {valid}
main()
{
  EP_textFieldOut();
}

EP_textFieldOut()
{
int iNewValue;
dyn_errClass err;
string sTmp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%d\", iNewValue);

  if( iNewValue != sTmp )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTps:Item.HV:_original.._value\", iNewValue);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTps:Item.HV}
// Config {:_original.._value}
// DPType {int}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

E

N 0 100 1 0 0 1
14 42
"CrateNb"
""
1 110 11 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
38 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,3,2,1,49,Courier New
0 ""
108 9 172 35
3 "s" 0 0 0 0 0 0 
E
"main()
{
 
  dpConnect(\"EP_textFieldInCB\",\"SCTps:Item.Crate:_original.._value\");

}

EP_textFieldInCB(string dp, int iNewValue)
{
string sTmp;

dpGet(dp, iNewValue);
sprintf(sTmp,\"%d\",iNewValue);
setValue(\"\", \"text\", sTmp );
}
" 0

"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldOut();
}

EP_textFieldOut()
{
int iNewValue;
dyn_errClass err;
string sTmp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%d\", iNewValue);

  if( iNewValue != sTmp )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTps:Item.Crate:_original.._value\", iNewValue);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTps:Item.HV}
// Config {:_original.._value}
// DPType {int}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

13 44
"Button1"
""
1 240 500 E E E 1 E 1 E N {255,255,255} E N {153,51,0} 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 ""
118 248 202 282
T 
1
LANG:1 7 RAMP LV
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
  EP_setDP1();
      setValue(\"\", \"backCol\", \"{204,204,204}\");
}

EP_setDP()
{
dyn_errClass err;
int hv,icard;
string datapoint1;
int i,j;
dyn_string valset; 
dyn_float initValue;


dpGet(\"SCTps:Item.HV:_original.._value\", hv);
icard=hv/4;

for (i=icard*4;i<=icard*4+3;i++){

valset=makeDynString(\"LVccTrip\",\"LVccMask\",\"LVco_Vcc\",\"LVco_Vdd\",\"LVcoVCSV\",\"LVcoPINV\",\"LVcoDTrp\",\"LVcoCTrp\",\"LVcoTTrp\",\"LVcoTLim\",\"LVcoCLKS\",\"LVcoCLKR\",\"LVcoVOut\");
initValue=makeDynFloat(46*2.5,15,3.5*50,4*50,4*25,6*20,50/2,50/2,128+50,128+60,0,0,1);
 for(j=1; j<=13; j++)
    {
	if(j<=2)
	  {
      }
 	else
      {
      sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.LV.%s:_original.._value\",i,valset[j] );
      dpSetWait(datapoint1, initValue[j]);
            //dpSet(datapoint1, initValue[j]);
//DebugN(\"i\", i ,\"hv\", hv,\"valset[j]\", valset[j], \"initValue[j]\", initValue[j]);
      }

   }
   
      setValue(\"\", \"backCol\", \"Red\");
      DebugN(\" LV channel\", i);  
  
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
 }
}


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

dpGet(\"SCTps:Item.HV:_original.._value\", lv); 
icard=lv/4;

for (i=icard*4;i<=icard*4+3;i++){
 //sprintf(function, \"SET%d\",i);

 SET(i);
//DebugN(\"lv\", lv ,\"icard\", icard,\"i\", i);
dpGet(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\",set);
//DebugN(\"i\", i,\"ELMB set \",set); 
 //delay(10);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
 }
}

SET(int i)
{
//DebugN(\"try \",i);
delay(0,50);
dpSetWait(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\", i);
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate0.Elmb_0.CCco_Set}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 46
"Button3"
""
1 40 251 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
40 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
38 249 122 283
T 
1
LANG:1 7 RAMP HV
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
  EP_setDP1();  
      setValue(\"\", \"backCol\", \"{204,204,204}\");
}

EP_setDP()
{
dyn_errClass err;
int i,icard;
const int max = 4;
string datapoint;
int hv;

//char *datapoint[max];
//[20]= {\"HVcaMask\", \"HVcoVolt\", \"HVcoITrp\",  \"HVcoRamp\"};
string datapoint1;

dpGet(\"SCTps:Item.HV:_original.._value\", hv);
icard=hv/8;

for (i=icard*8;i<=icard*8+7;i++){
  //sprintf(datapoint1, \"SCTps:Crate0.HVCard_%d.%s:_original.._value\",icard,\"HVccMask\" );
  //dpSetWait(datapoint1, 255);
  sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",i,\"HVcoVolt\" );
  dpSetWait(datapoint1, 100);
  sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",i,\"HVcoITrp\" );
  dpSetWait(datapoint1, 1100);
  sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",i,\"HVcoRamp\" );
  dpSetWait(datapoint1, 3);


      setValue(\"\", \"backCol\", \"Red\");
      DebugN(\" HV channel\", i);  
  
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
 }
}

EP_setDP1()
{
dyn_errClass err;
int hv, icard, channel, i;

dpGet(\"SCTps:Item.HV:_original.._value\", hv); 
icard=hv/8;

for (i=icard*8;i<=icard*8+7;i++){

//DebugN(\"hv\", hv ,\"icard\", icard,\"i\", i);
channel=i+100;
dpSetWait(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\", channel);
delay(0,10);
//    dpGet(\"SCTps:Item.HV:_original.._value\", hv);
//   delay(500);  
//  hv=hv+1;
//DebugN(\"i\", i,\"channel\", channel); 
// dpSetWait(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\", hv);
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
 }
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate1.HV.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 47
"Button2"
""
1 140 382 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
41 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
118 280 202 314
T 
1
LANG:1 6 OFF LV
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
  EP_setDP1();
      setValue(\"\", \"backCol\", \"{204,204,204}\");
}

EP_setDP()
{
dyn_errClass err;
int hv,icard;
const int max = 4;
//char *datapoint[max];
//[20]= {\"HVcaMask\", \"HVcoVolt\", \"HVcoITrp\",  \"HVcoRamp\"};
string datapoint1;
int i,j;
dyn_string valset; 
dyn_float initValue;

dpGet(\"SCTps:Item.HV:_original.._value\", hv);
icard=hv/4;

for (i=icard*4;i<=icard*4+3;i++){

dpGet(\"SCTps:Item.HV:_original.._value\", hv);
valset=makeDynString(\"LVccTrip\",\"LVccMask\",\"LVco_Vcc\",\"LVco_Vdd\",\"LVcoVCSV\",\"LVcoPINV\",\"LVcoDTrp\",\"LVcoCTrp\",\"LVcoTTrp\",\"LVcoTLim\",\"LVcoCLKS\",\"LVcoCLKR\",\"LVcoVOut\");
initValue=makeDynFloat(46*2.5,15,0.*50,0*50,0*25,0*20,50/2,50/2,128+50,128+60,0,0,0);
 for(j=1; j<=13; j++)
    {
	if(j<=2)
	  {
// swithcing on all LV Cards 
       icard=hv/4;
//       sprintf(datapoint1, \"SCTps:Crate0.LVCard_%d.%s:_original.._value\",icard,valset[j]);
//       dpSetWait(datapoint1, initValue[j]);
 	  }
// swithcing on all LV Channels 
 	else
      {
      sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.LV.%s:_original.._value\",i,valset[j] );
      dpSetWait(datapoint1, initValue[j]);
//  DebugN(\"i\", i ,\"hv\", hv,\"valset[j]\", valset[j], \"initValue\", initValue[j]);
      }
   }
      setValue(\"\", \"backCol\", \"Red\");
      DebugN(\" LV channel\", i);  
  
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
 }
}

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

dpGet(\"SCTps:Item.HV:_original.._value\", lv); 
icard=lv/4;

for (i=icard*4;i<=icard*4+3;i++){
 //sprintf(function, \"SET%d\",i);

 SET(i);
//DebugN(\"lv\", lv ,\"icard\", icard,\"i\", i);
dpGet(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\",set);
//DebugN(\"i\", i,\"ELMB set \",set); 
 //delay(10);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
 }
}

SET(int i)
{
//DebugN(\"try \",i);
delay(0,50);
dpSetWait(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\", i);
}


// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate1.HV.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 48
"Button4"
""
1 40 282 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
42 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
38 280 122 314
T 
1
LANG:1 6 OFF HV
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
  EP_setDP1();
  setValue(\"\", \"backCol\", \"{204,204,204}\");
}

EP_setDP()
{
dyn_errClass err;
int i,icard;
const int max = 4;
string datapoint;
int hv;

//char *datapoint[max];
//[20]= {\"HVcaMask\", \"HVcoVolt\", \"HVcoITrp\",  \"HVcoRamp\"};
string datapoint1;

dpGet(\"SCTps:Item.HV:_original.._value\", hv);
icard=hv/8;

for (i=icard*8;i<=icard*8+7;i++){
  sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",i,\"HVcoVolt\" );
  dpSetWait(datapoint1, 0);
  sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",i,\"HVcoITrp\" );
  dpSetWait(datapoint1, 1100);
  sprintf(datapoint1, \"SCTps:Crate0.Channel_%d.HV.%s:_original.._value\",i,\"HVcoRamp\" );
  dpSetWait(datapoint1, 3);
//sprintf(datapoint1, \"SCTps:Crate0.HVCard_%d.%s:_original.._value\",icard,\"HVccMask\" );
//dpSetWait(datapoint1, 0);


      setValue(\"\", \"backCol\", \"Red\");
      DebugN(\" HV channel\", i);  
  
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);       
 }
}

EP_setDP1()
{
dyn_errClass err;
int hv, icard, channel, i;

dpGet(\"SCTps:Item.HV:_original.._value\", hv); 
icard=hv/8;

for (i=icard*8;i<=icard*8+7;i++){

//DebugN(\"hv\", hv ,\"icard\", icard,\"i\", i);
channel=i+100;
dpSetWait(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\", channel);
delay(0,10);
//    dpGet(\"SCTps:Item.HV:_original.._value\", hv);
//   delay(500);  
//  hv=hv+1;
//DebugN(\"i\", i,\"channel\", channel); 
// dpSetWait(\"SCTps:Crate0.Elmb_0.CCco_Set:_original.._value\", hv);
 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
 }
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTps:Crate1.HV.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