V 10
1
LANG:1 8 (NoName)
PANEL,437 119 345 161 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 3
"CreaterAddresses"
""
1 50 50 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 48 302 112
T 
1
LANG:1 16 Create Addresses
"//Function CreateAddress_EventClick()
main()
{
string dpeName, OPCItemName;
string direction, opcServerName, OPCGroup, intDpeType;
int driverNum, i;
	
  setValue(\"\",\"foreCol\",\"Red\");

  opcServerName = \"CANopen\";
  driverNum = 1;
	
  for(i=0; i<48; i++) {
  
	DebugN(\" Setting IV Addresses for Channel  = \", i);

	intDpeType = 488; /******* 32-Bit Integer signed *******/

	/********** GROUP COMM ********************************************************************/
	direction = \"out\";
	OPCGroup = \"Comm\";

	sprintf( OPCItemName, \"Crate00_IVchVend_SendChan%d\", i );
	sprintf( dpeName, \"SCTmops1:Crate00.Channel%02d.IVCurve.HV_End.Send\", i );
	OPCAddress(dpeName, opcServerName, OPCGroup, OPCItemName, direction, driverNum,intDpeType);

	sprintf( OPCItemName, \"Crate00_IVchStop_SendChan%d\", i );
	sprintf( dpeName, \"SCTmops1:Crate00.Channel%02d.IVCurve.HV_Stop.Send\", i );
	OPCAddress(dpeName, opcServerName, OPCGroup, OPCItemName, direction, driverNum,intDpeType);
		
	sprintf( OPCItemName, \"Crate00_IVchImax_SendChan%d\", i );
	sprintf( dpeName, \"SCTmops1:Crate00.Channel%02d.IVCurve.Curr_Max.Send\", i );
	OPCAddress(dpeName, opcServerName, OPCGroup, OPCItemName, direction, driverNum,intDpeType);
		
	sprintf( OPCItemName, \"Crate00_IVchIwar_SendChan%d\", i );
	sprintf( dpeName, \"SCTmops1:Crate00.Channel%02d.IVCurve.Curr_Warn.Send\", i );
	OPCAddress(dpeName, opcServerName, OPCGroup, OPCItemName, direction, driverNum,intDpeType);
	
		
	sprintf( OPCItemName, \"Crate00_IVchStrt_SendChan%d\", i );
	sprintf( dpeName, \"SCTmops1:Crate00.Channel%02d.IVCurve.HV_Start.Send\", i );
	OPCAddress(dpeName, opcServerName, OPCGroup, OPCItemName, direction, driverNum,intDpeType);
			
	intDpeType = 0; /******* 16-Bit Integer unsigned *******/

	sprintf( OPCItemName, \"Crate00_IVchStep_SendChan%d\", i );
	sprintf( dpeName, \"SCTmops1:Crate00.Channel%02d.IVCurve.HV_Step.Send\", i );
	OPCAddress(dpeName, opcServerName, OPCGroup, OPCItemName, direction, driverNum,intDpeType);
		
	sprintf( OPCItemName, \"Crate00_IVchWait_SendChan%d\", i );
	sprintf( dpeName, \"SCTmops1:Crate00.Channel%02d.IVCurve.TimeWait.Send\", i );
	OPCAddress(dpeName, opcServerName, OPCGroup, OPCItemName, direction, driverNum,intDpeType);

	
	/********** GROUP MONI  ********************************************************************/
	OPCGroup = \"Moni\";
	direction = \"in\";
	
	sprintf( OPCItemName, \"Crate00_IVchStat_RecvChan%d\", i );
	sprintf( dpeName, \"SCTmops1:Crate00.Channel%02d.IVCurve.Status.Recv\", i );
	OPCAddress(dpeName, opcServerName, OPCGroup, OPCItemName, direction, driverNum,intDpeType);
	}

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


OPCAddress(string dpeName, string opcServerName, string OPCGroup, string OPCItemName,
		 string direction, int driverNum, string intDpeType )
{
string reference;
int intDirection;
/*Values for intDpeType:
  UNDEFINED 480 Undefined
  INT16 	481 16 bit integer signed
  INT32 	482 32 bit integer signed
  UCHAR 	483 Character unsigned
  FLOAT32 	484 32 bit float
  FLOAT64 	485 64 bit float
  BOOL 		486 Bool
  STRING 	487 String
  UINT16 	488 16-Bit Integer unsigned
  UINT32  	489 32-Bit Integer signed*/
  
/* */
     if(direction == \"OUT\" || direction == \"out\" || direction == \"Out\")
   { intDirection = DPATTR_ADDR_MODE_OUTPUT_SINGLE; //output for single queries
   } else if(direction == \"IN\" || direction == \"in\" || direction == \"In\")
   { intDirection = DPATTR_ADDR_MODE_INPUT_SPONT;   //input for spontaneous data
   }

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

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

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