V 10
1
LANG:1 2 HV
PANEL,460 362 222 157 N {236,233,216} 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
6 43
"Border1"
""
1 10 150 E E E 1 E 1 E N {0,0,0} E N {236,233,216} E E
 E E
39 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 150
2 1
"Text1"
""
1 18 40 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 20 42 66 57
0 2 0 "s" 0 0 0 192 0 0  20 42
 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 8 Shut Off
2 46
"Text6"
""
1 125 40 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E E
42 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
"// SimpleCtrlScriptStart {invalid}

// Revised PWP 20.07.2004
// - Will ramp down up to 88 crates, if the relevant datapoints exist
// - Actions are logged to the info bar and to the local table

main()
{
  EP_textFieldIn();
}

EP_textFieldIn()
{
dyn_errClass err;

  if( dpSubStr( \"Monitoring.Crate_Ramp_Off:_original\", DPSUB_DP_EL ) == \"\" )
  {
    setValue(\"\", \"color\", \"_dpdoesnotexist\");
    return;
  }

//dpconnect to environmental project datapoint
  dpConnect(\"EP_textFieldInCB\", \"Fatl.Numb:_original.._value\");

  err = getLastError();
  if (dynlen(err) > 0){
      setValue(\"\", \"color\", \"_dpdoesnotexist\");
   }

}


EP_textFieldInCB(string dp1, int code)
{
   string message;
   
   // sending back confirmation to environmental, necessary for Acknowledgement
   dpSet(\"Fatl.Indx:_original.._value\",code);

   if ( code>0 ) {
 	 sprintf(message, \"Alarm (code %d)\",code);
 	 EP_logger(message);
 	 
	 setValue( \"\", \"text\", \"RAMPDOWN\" );
	 setValue( \"\", \"backCol\", \"alarmKamUnq\" );
	 EP_childPanelOn();
	 EP_sendPDO();
   }
	
   if ( code==0 ) {
      EP_logger(\"All Clear\");
      
      setValue( \"\", \"text\", \"OK\" );
      setValue( \"\", \"backCol\", \"Green\" );
   }
}


EP_childPanelOn()
{
 ChildPanelOnCentralModal(\"subpanels\\\\Environmental_Error.pnl\",
      \"Environmental Error\",
      makeDynString(\"\"));
}


EP_sendPDO()
{
   dyn_errClass err;
   int crate, n_off,channel;
   string datapoint, message;

   n_off = 0;
   
   for(crate=0;crate<=88;crate++) {
      sprintf(datapoint,\"Crate%02d.Controller.CCch_Set.Send:_original.._value\",crate);
      if(dpExists(datapoint)){
 //       channel = 255| (( 0 & 0x00ff )<<8); // all channels OFF
        channel=255;
	      dpSetWait(datapoint,channel);
        n_off++;
      }
   }
   
   sprintf(message, \"Rampdown %d crates\", n_off);
   EP_logger(message);
   
   err = getLastError();
   if (dynlen(err) > 0) {
	  errorDialog(err);
   }
}

EP_logger(string message){

   int row,col;
   time t;
   string tim;
  
   t=getCurrentTime();
   tim=formatTime(\"%H:%M:%S\", t);
   
   getValue(\"Table1\", \"currentCell\", row, col);
   setValue(\"Table1\", \"appendLine\", row, \"#1\", tim, \"#2\",message);
   
   dpSet(\"Info.Name:_original.._value\", \"Environmental Alarm: \"+message);
}
// SimpleCtrlScript {EP_textFieldIn}
// DP {Monitoring.Crate_Ramp_Off}
// DPConfig {:_original.._value}
// DPType {bool}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
" 0
 E 0 1 1 0 1 E U  1 E 127 42 193 58
1 2 0 "s" 0 0 0 64 0 0  127 42
 1
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 ""
1
LANG:1 5 Text4
2 50
"Text2"
""
1 67 19 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
45 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 69 21 150 36
0 2 0 "s" 0 0 0 192 0 0  69 21
 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 13 Environmental
25 49
"Table1"
""
1 11 70 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
44 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 118 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,0,0,0,0,Courier New
0 ""
9 68 212 147
E E 0 0 1 2 1 "#1" 0 1 0 "s" 1
LANG:1 2 #1
E1
LANG:1 0 
 80 "#2" 0 1 0 "s" 1
LANG:1 2 #2
E1
LANG:1 0 
 200 25 25 "" 1 1
LANG:1 2 #1
8 18 1
LANG:1 118 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,0,0,0,0,Courier New
0 ""
0 1 1 0 0
1 0
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