V 10
1
LANG:1 8 (NoName)
PANEL,394 236 345 140 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 4
"Button1"
""
1 50 40 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 ""
48 38 302 102
T 
1
LANG:1 16 Create Addresses
"//Function CreateAddress()
main()
{
string dpeName, OPCItemName, intDpeType, loc;
int i;

  setValue(\"\",\"foreCol\",\"Red\");


  for(i=0; i<48; i++){
	sprintf( loc, \"SCTmops1:Crate00.Channel%02d.\", i );

	DebugN(\" Setting IV Addresses for Channel  = \", i);

	sprintf( OPCItemName, \"Crate00_IVchStrt_SendChan%d\", i );
	dpeName = loc + \"IVCurve.HV_Start.Send\";
	OPCAddress(dpeName, \"Comm\", OPCItemName, \"UINT16\");
		
	sprintf( OPCItemName, \"Crate00_IVchStep_SendChan%d\", i );
	dpeName = loc + \"IVCurve.HV_Step.Send\";
	OPCAddress(dpeName, \"Comm\", OPCItemName, \"UINT16\");
		
	sprintf( OPCItemName, \"Crate00_IVchStop_SendChan%d\", i );
	dpeName = loc + \"IVCurve.HV_Stop.Send\";
	OPCAddress(dpeName, \"Comm\", OPCItemName, \"UINT32\");
	
	sprintf( OPCItemName, \"Crate00_IVchVend_SendChan%d\", i );
	dpeName = loc + \"IVCurve.HV_End.Send\";
	OPCAddress(dpeName, \"Comm\", OPCItemName, \"UINT32\");
	
	sprintf( OPCItemName, \"Crate00_IVchImax_SendChan%d\", i );
	dpeName = loc + \"IVCurve.Curr_Max.Send\";
	OPCAddress(dpeName, \"Comm\", OPCItemName, \"UINT16\");
		
	sprintf( OPCItemName, \"Crate00_IVchIwar_SendChan%d\", i );
	dpeName = loc + \"IVCurve.Curr_Warn.Send\";
	OPCAddress(dpeName, \"Comm\", OPCItemName, \"UINT16\");

	sprintf( OPCItemName, \"Crate00_IVchStat_RecvChan%d\", i );
	dpeName = loc + \"IVCurve.Status.Recv\";
	OPCAddress(dpeName, \"Moni\", OPCItemName, \"DEFAULT\");
	
	sprintf( OPCItemName, \"Crate00_IVchWait_SendChan%d\", i );
	dpeName = loc + \"IVCurve.TimeWait.Send\";
	OPCAddress(dpeName, \"Comm\", OPCItemName,  \"UINT16\");
	}

  setValue(\"\",\"foreCol\",\"\");
}


OPCAddress(string dpeName, string OPCGroup, string OPCItemName, string dpeType )
{
string reference;
int direction, intDpeType;

//Values for intDpeType:
	switch(dpeType){
		case \"BOOL\"		: intDpeType = 486;    break; // Bool
		case \"DEFAULT\"	: intDpeType = 0;	   break;
		case \"FLOAT32\"	: intDpeType = 484;    break; // 32 bit float
		case \"FLOAT64\"	: intDpeType = 485;    break; // 64 bit float
		case \"INT16\"	: intDpeType = 481;    break; // 16 bit integer signed
		case \"INT32\"	: intDpeType = 482;    break; // 32 bit integer signed
		case \"STRING\"	: intDpeType = 487;    break; // String
		case \"UCHAR\"	: intDpeType = 483;    break; // Character unsigned
		case \"UINT16\"	: intDpeType = 488;    break; // 16-Bit Integer unsigned
		case \"UINT32\"	: intDpeType = 489;    break; // 32-Bit Integer signed*/
		case \"UNDEFINED\":;
		default			: intDpeType = 480;    break; // Undefined
		}
  
/* */
	if(OPCGroup == \"Comm\") direction = DPATTR_ADDR_MODE_OUTPUT_SINGLE;		//output for single queries
	else if(OPCGroup == \"Moni\") direction = DPATTR_ADDR_MODE_INPUT_SPONT;	//input for spontaneous data


	reference = \"CANopen$\" + OPCGroup + \"$\" + \"Bus00.Crate00.\" +  OPCItemName; 

   dpSetWait(dpeName + \":_distrib.._type\", DPCONFIG_DISTRIBUTION_INFO, //driver allocation
             dpeName + \":_distrib.._driver\", 1);               //allocated driver: driver number 1

   dpSetWait(dpeName + \":_address.._type\", DPCONFIG_PERIPH_ADDR_MAIN,  // general peripheral address
             dpeName + \":_address.._reference\", reference,
             dpeName + \":_address.._datatype\" , intDpeType,
             dpeName + \":_address.._mode\"     , direction,
             dpeName + \":_address.._drv_ident\", \"OPCCLIENT\");
} 
" 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