main()
{
	string systemName;
	//this is setParameters command (set any parameter in SCTdcs02 power supply project)
	systemName = getSystemName();
	dpConnect("setParameters",systemName + "setParameters.trigger:_online.._value");
}

void setParameters(string dpeTrigger, bool trigger)
{
	string systemName;
	string paramStr;
	dyn_string param_split;
	string dpe_path;
	float dpe_value;
	int response, size, item;
	
	systemName = getSystemName();
	//command executed on trigger value TRUE
	if(trigger)
		{
		  response=0;
		  //get the parameters of the command: parameter path and value. remember that the format of 
		  //parameters is depPath1|depValue1|depPath2|depValue2|depPath3|depValue3...etc.
		  dpGet(systemName + "setParameters.parameters:_online.._value", paramStr);
		  param_split = strsplit(paramStr,"|");
		  
		  size = dynlen(param_split);

		  for(item=1; item<=size; item++)
		      {
 		  		sscanf(param_split[item],"%s",dpe_path);
 		  		item = item + 1;
 		  		sscanf(param_split[item],"%f",dpe_value);

  		  		//set the parameter at the requested value
		  		response=dpSetWait(systemName + dpe_path + ":_original.._value",dpe_value);
		 	  }
		  //check the response, this is analysed in DDC (see SCTDDCCommander class)
		  if(response!=0) response = 0-response;
    
   		  dpSet(systemName + "setParameters.response:_original.._value",response,
         		systemName + "setParameters.trigger:_original.._value",!trigger);
		}
}



