SCTDET_ps1_install()
{
   if(dpConnect("cbSCTDET_ps1_valueChanged",
      "ps1.state:_online.._value"
     ) == -1 )
      DebugN("Bad dpConnect state");
   if(dpConnect("cbSCTDET_ps1_doCommand",false,
     "SCTDET|ps1.fsm.sendCommand:_online.._value"
     ) == -1 )
      DebugN("Bad dpConnect command");
   fwDU_setDefaultParameters("SCTDET","ps1");
   myDu_initialize("SCTDET","ps1");
}

cbSCTDET_ps1_valueChanged(
      string dp1, int x1   )
{
   string state, oldstate, busy;
   myDu_valueChanged("SCTDET","ps1",
      x1, state );
   dpGet("SCTDET|ps1.fsm.currentState:_online.._value", oldstate,
         "SCTDET|ps1.fsm.executingAction:_online.._value", busy);
   if ((state != oldstate) || (busy != ""))
      fwDU_setState("SCTDET","ps1",state);
}

cbSCTDET_ps1_doCommand(string dp, string command)
{
   myDu_doCommand("SCTDET","ps1",command);
}

SCTDET_ps2_install()
{
   if(dpConnect("cbSCTDET_ps2_valueChanged",
      "ps2.state:_online.._value"
     ) == -1 )
      DebugN("Bad dpConnect state");
   if(dpConnect("cbSCTDET_ps2_doCommand",false,
     "SCTDET|ps2.fsm.sendCommand:_online.._value"
     ) == -1 )
      DebugN("Bad dpConnect command");
   fwDU_setDefaultParameters("SCTDET","ps2");
   myDu_initialize("SCTDET","ps2");
}

cbSCTDET_ps2_valueChanged(
      string dp1, int x1   )
{
   string state, oldstate, busy;
   myDu_valueChanged("SCTDET","ps2",
      x1, state );
   dpGet("SCTDET|ps2.fsm.currentState:_online.._value", oldstate,
         "SCTDET|ps2.fsm.executingAction:_online.._value", busy);
   if ((state != oldstate) || (busy != ""))
      fwDU_setState("SCTDET","ps2",state);
}

cbSCTDET_ps2_doCommand(string dp, string command)
{
   myDu_doCommand("SCTDET","ps2",command);
}

