V 10
1
LANG:1 8 (NoName)
PANEL,258 100 744 549 N "_3DFace" 0
EEE E E 1 -1 -1 0  210 150
"" 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
13 0
"Button1"
""
1 210 150 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E E
1 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-140-100-100-*-*-iso8859-1|-16,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
208 148 552 222
T 
1
LANG:1 22 Create DataPoint Types
"main()
{
  dyn_dyn_int dpType;
  dyn_dyn_string dpName;
  dyn_string dpAllTypes;
  
  //define the datapoint structure and types: IVCurve
  dpName[1] = makeDynString(\"IVCurve\", \"\", \"\");                 dpType[1] = makeDynInt(DPEL_STRUCT);
  dpName[2] = makeDynString(\"\", \"Crate\", \"ps_stat_send\", \"\");    dpType[2] = makeDynInt(0, DPEL_TYPEREF);
  dpName[3] = makeDynString(\"\", \"Channel\", \"ps_stat_send\", \"\");  dpType[3] = makeDynInt(0, DPEL_TYPEREF);
  dpName[4] = makeDynString(\"\", \"HV_Start\", \"ps_data_send\", \"\"); dpType[4] = makeDynInt(0, DPEL_TYPEREF);
  dpName[5] = makeDynString(\"\", \"HV_Step\", \"ps_data_send\", \"\");  dpType[5] = makeDynInt(0, DPEL_TYPEREF);
  dpName[6] = makeDynString(\"\", \"HV_Stop\", \"ps_data_send\", \"\");  dpType[6] = makeDynInt(0, DPEL_TYPEREF);
  dpName[7] = makeDynString(\"\", \"HV_End\", \"ps_data_send\", \"\");   dpType[7] = makeDynInt(0, DPEL_TYPEREF);
  dpName[8] = makeDynString(\"\", \"Curr_Max\", \"ps_data_send\", \"\"); dpType[8] = makeDynInt(0, DPEL_TYPEREF);
  dpName[9] = makeDynString(\"\", \"TimeWait\", \"ps_stat_send\", \"\"); dpType[9] = makeDynInt(0, DPEL_TYPEREF);
  dpName[10] = makeDynString(\"\", \"StartIVCurve\", \"ps_stat_send\", \"\"); 
  dpType[10] = makeDynInt(0, DPEL_TYPEREF);
  dpName[11] = makeDynString(\"\", \"Status\", \"ps_stat_recv\", \"\");  dpType[11] = makeDynInt(0, DPEL_TYPEREF);
  dpName[12] = makeDynString(\"\", \"StartTime\", \"\");               dpType[12] = makeDynInt(0, DPEL_TIME);
  
  //remove the type if exist
  if(dpTypeExists(dpName[1][1]))
  	{
  		deleteDpType(dpName[1][1]);
  	}
  
  //create the above defined type
  dpTypeCreate(dpName, dpType);

  //clear the arrays
  dynClear(dpName);
  dynClear(dpType);

  //create a datapoint of the above defined type
  dpCreate(\"IVCurve\", \"IVCurve\");
  
  //define the datapoint structure and types: DCS_IVCurve
  dpName[1] = makeDynString(\"DCS_IVCurve\", \"\");      dpType[1] = makeDynInt(DPEL_STRUCT);
  dpName[2] = makeDynString(\"\", \"Name01\", \"\");       dpType[2] = makeDynInt(0, DPEL_STRING);
  dpName[3] = makeDynString(\"\", \"Name02\", \"\");       dpType[3] = makeDynInt(0, DPEL_STRING);
  dpName[4] = makeDynString(\"\", \"Name03\", \"\");       dpType[4] = makeDynInt(0, DPEL_STRING);
  dpName[5] = makeDynString(\"\", \"Name04\", \"\");       dpType[5] = makeDynInt(0, DPEL_STRING);
  dpName[6] = makeDynString(\"\", \"Name05\", \"\");       dpType[6] = makeDynInt(0, DPEL_STRING);
  dpName[7] = makeDynString(\"\", \"Name06\", \"\");       dpType[7] = makeDynInt(0, DPEL_STRING);
  dpName[8] = makeDynString(\"\", \"Name07\", \"\");       dpType[8] = makeDynInt(0, DPEL_STRING);
  dpName[9] = makeDynString(\"\", \"Name08\", \"\");       dpType[9] = makeDynInt(0, DPEL_STRING);

  
  //remove the type if exist
  if(dpTypeExists(dpName[1][1]))
  	{
  		deleteDpType(dpName[1][1]);
  	}
  
  //create the above defined type
  dpTypeCreate(dpName, dpType);

  //clear the arrays
  dynClear(dpName);
  dynClear(dpType);

  //create a datapoint of the above defined type
  dpCreate(\"IVCurve01\", \"DCS_IVCurve\");
  
  //create the DdcCommand: requestIVCurve (if it does not exist)
  if(!dpExists(\"requestIVCurve\", \"DdcCommand\"))
  	{
  		dpCreate(\"requestIVCurve\", \"DdcCommand\");
  	}
}

//this subroutine check the existence of a given type
bool dpTypeExists(string dpType)
{
  int index;
  dyn_string dpAllTypes;
  
  //get all types
  dpAllTypes = dpTypes();
  
  //check the existence of the given type 
  for(index=1; index<=dynlen(dpAllTypes); index++)
  	{
  		if(dpAllTypes[index] == dpType) return 1;
  	}
  
  return 0;
}

//this subroutine deletes a given type. to do so, it deletes all the datapoint of this type
//then delete the type
deleteDpType(string dpType)
{
  int index;
  dyn_string dpAllNames;
  
  //get all datapoint of the given type
  dpAllNames = dpNames(\"*\", dpType);
  
  //delete all the datapoint of the given type
  for(index=1; index<=dynlen(dpAllNames); index++)
  	{
  		dpDelete(dpAllNames[index]);
  	}
  
  //delete the type
  dpTypeDelete(dpType);
}" 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