RobotStudio event

FP SDK 5.14 executionStatusChanged subscription


Hello,
I try to use the "classical" scheme of the subsrciption using, which works with any other type of subscriptions e.g. subscription on the signal, rapiddata, programPointer or any controller state changing. But it doesn't work with executionStatus. Please take a look at the following code:

public void SubscribeOnExecute()
{
    getRapid().ExecutionStatusChanged += executionStatusChanged;
}

private void executionStatusChanged(object sender, ExecutionStatusChangedEventArgs e)
{
       GTPUMessageBox.Show(this, null, "Status=" + e.NewStatus);
       executionStatusChangeUI(e.NewStatus.Equals(ExecutionState.Started));
}

  private void executionStatusChangeUI(bool isRunning)
        {
            // InvokeRequired required compares the thread ID of the
            // calling thread to the thread ID of the creating thread.
            // If these threads are different, it returns true.
           
            if (this.InvokeRequired)
            {
                var rc = new executionStatusChangedCallback(executionStatusChangeUI);
                this.Invoke(rc, new object[] { isRunning });
            }else
            {
             if (isRunning)
             {
                 disableUI();
             }
             else
             {
                 enableUI();
             }
            }
        }
....
getRapid() returns m_Controller.Rapid.

Unfortunetally it doesn't work. Is someone has the succesfull experience with the executionStatusChanged  subscription ?

Thank you, 
Anton



SAV2012-10-22 08:47:55
Anton Shchepelin,
Russia, Chelyabinsk,
The Research and Production Company "Alpha-Intech",
http://alphajet.ru/

Comments




  • The same situation with PC SDK.  How to use the executionStatus event ? Any ideas will be appreciate! Thank you...SAV2012-10-27 11:27:02
    Anton Shchepelin,
    Russia, Chelyabinsk,
    The Research and Production Company "Alpha-Intech",
    http://alphajet.ru/
  • I have found the way how to avoid it. I create System Output (Rapid execution) and connect it with a virtual signal, then I subscribe on its changing..
    Anton Shchepelin,
    Russia, Chelyabinsk,
    The Research and Production Company "Alpha-Intech",
    http://alphajet.ru/