V 10
1
LANG:1 8 (NoName)
PANEL,470 99 244 200 N "_3DFace" 0
EEE E E 1 -1 -1 0  40 100
"" 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 17
"Border1"
""
1 10 150 E E E 1 E 1 E N {0,0,0} E N {204,204,255} E E
 E E
17 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 30
"Text2"
""
1 22 57 E E E 1 E 1 E N {0,0,0} E N {204,204,255} 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  1 E 90 59 222 104
0 2 0 "s" 0 0 0 193 0 0  90 59
 3
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 14 IV parameters 
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 24 ( Cr|Ch|Srt|Stp|Step|End
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 20 |Cwar|Cmax|TimeWait)
13 24
"Button4"
""
1 32 27 E E E 1 E 1 E N "_3DText" E N "_3DFace" 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 ""
30 25 104 59
T 
1
LANG:1 10 TRIGGER IV
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

// SimpleCtrlScriptEnd {EP_toggleDP}

EP_setDP()
{
dyn_errClass err;
bool state;

  dpGet(\"requestIVCurve.trigger:_original.._value\", state);
  if (state==1) {
     dpSetWait(\"requestIVCurve.trigger:_original.._value\", 0);
     DebugN(\"IV curve trigger set by DAQ 0\");
     }
  else {
     dpSetWait(\"requestIVCurve.trigger:_original.._value\", 1);
     DebugN(\"IV curve triggered by DAQ 1\");
     }
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCT_SCS_PS_20:ChangeState.trigger}
// Config1 {:_original.._value}
// Type1 {bool}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
14 28
"TextField1"
""
1 20 108 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
27 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 ""
18 106 182 132
3 "s" 0 0 0 0 0 0 
E
"// SimpleCtrlScriptStart {valid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

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

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

}


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

EP_setInvalid()
{
dyn_errClass err;

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

  dpConnect(\"EP_setInvalidCB\",
            \"requestIVCurve.parameters:_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 {requestIVCurve.parameters}
// DPConfig {:_online.._value}
// DPType {string}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {requestIVCurve.parameters}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

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

EP_textFieldOut()
{
string sNewValue;
dyn_errClass err;

  getValue(\"\", \"text\", sNewValue);
  dpSetWait(\"requestIVCurve.parameters:_original.._value\", sNewValue);
  DebugN(sNewValue);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {ChangeState.parameters}
// Config {:_original.._value}
// DPType {string}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

13 31
"Button1"
""
1 112 27 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E E
30 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 ""
110 25 184 59
T 
1
LANG:1 7 STOP IV
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

// SimpleCtrlScriptEnd {EP_toggleDP}

EP_setDP()
{
dyn_errClass err;
bool state;
string parameters,allChannels,datapoint;
int Twait,channel,crate,status;
float Vstart,Vstop,Vstep,Vend,Imax,Iwarn; 
dyn_string para_split;
 	
          string systemName = getSystemName();
          dpGet(systemName+\"requestIVCurve.parameters:_online.._value\", parameters);
		  para_split=strsplit(parameters,\"|\");
          
          //the format of parameters send by DDC (DAQ) is the following: Crate|Channel|HV_Start|HV_Stop|HV_Step|HV_End|Curr_Max|TimeWait
		  sscanf(para_split[1],\"%d\", crate);
		  sscanf(para_split[2],\"%s\", allChannels);
 		  sscanf(para_split[3],\"%f\", Vstart);
		  sscanf(para_split[4],\"%f\", Vstop);
		  sscanf(para_split[5],\"%f\", Vstep);
		  sscanf(para_split[6],\"%f\", Vend);
		  sscanf(para_split[7],\"%f\", Imax);
		  sscanf(para_split[8],\"%f\", Iwarn);
		  sscanf(para_split[9],\"%d\", Twait);

		  if(allChannels == \"ALL\")
			{
				//IV curve for all channels
	 	  		channel = 255;
			}
	  	  else
			{
	   			sscanf(allChannels,\"%d\", channel);
	   			
			}

		  //DebugN(\"sParameters\", crate, allChannels, Vstart, Vstop, Vstep, Vend, Imax, Iwarn , Twait);
		  //INTERRUPT the IV curve : set the second byte to 2
              channel = channel+64 | (( 2 & 0x00ff )<<8);
              sprintf(datapoint, \"Crate%02d.Controller.CCchRead.Send:_original.._value\", crate);
              dpSetWait(datapoint , channel);
          dpSet(\"Info.Name:_original.._value\", \"IV scan has been interrupted!\");
   		  dpSet(\"IVfile.Stat:_original.._value\",1);
   		  delay(0,4);
   		  dpSet(\"IVfile.Stat:_original.._value\",0);
   		  DebugN(\"IV curve interrupted\");
	
//   		  dpDisconnect(\"writeIVCurveInfo\",status);

}

// SimpleCtrlScript {EP_setDP}
// DP1 {ChangeState.trigger}
// Config1 {:_original.._value}
// Type1 {bool}
// 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