main()
{
   dpConnect("setOpening","SCTps:setOpening.trigger:_online.._value");

}

void setOpening(string dpeTrigger, bool state)
{
string paramStr;
dyn_string param;
//string dp_path;
float value;
int i;
bool bit;
string port;
int response;
 DebugN("====================0");
if(state)
{
  response=0;
  dpGet("SCTps:setOpening.parameters:_online.._value", paramStr);
  param=strsplit(paramStr,"|");
  DebugN("====================1");
  //sscanf(param[1],"%s",dp_path);
  sscanf(param[1],"%f",value);
 DebugN("param[1]=");
 DebugN(param[1]);
  //value=2;
  //SCTdcs01:Limi01.FatL
 DebugN("====================2");
  response=dpSetWait("SCTps:Crate0.DDC.DCS_STATES:_original.._value",value);
      if(response!=0)
         response=0-response;
 DebugN(value);
 DebugN("====================3");
   dpSet("SCTps:setOpening.response:_original.._value",response,
         "SCTps:setOpening.trigger:_original.._value",!state);
 DebugN("====================4");
 }
}

