Thank you very much, Ando-san, Hajime-san.<div><br><div>I had to invert the condition to !CORBA::is_nil(ec) to make it work.</div><div>Hope I am not doing anything wrong.  I don't exactly get the meaning of CORBA::is_null(obj), however the document says it checks if the obj is nil.</div>

<div><br></div><div>Regards</div><div>Hong</div><div><div><br><div class="gmail_quote">2012/1/31 Ando Noriaki <span dir="ltr"><<a href="mailto:n-ando@aist.go.jp">n-ando@aist.go.jp</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hello,<br>
<br>
This is an example code in C++.<br>
<br>
 ReturnCode_t RTObject_impl::onExecute(RTC::UniqueId ec_id)<br>
 {<br>
     : // you code<br>
  if (gotoInactiveState)<br>
    {<br>
      RTC::ExecutionContext_var ec = get_context(ec_id);<br>
      if (CORBA::is_nil(ec))<br>
       {<br>
          ec->deactivate_component(::RTC::RTObject::_duplicate(getObjRef()));<br>
       }<br>
    }<br>
     : // your code<br>
   return RTC::RTC_OK;<br>
 }<br>
<br>
 In the next execution tick, onDeactivated() will be called and<br>
RTC will be in the INACTIVE state.<br>
<br>
>From OpenRTM-aist-1.1.0, getExecutionContext(), deactivate(),<br>
activate() and reset() functions are introduced in DataflowComponentBase.<br>
<br>
Best regards,<br>
<font color="#888888">Noriaki ANDO<br>
</font><div><div></div><div class="h5"><br>
2012年1月31日17:38  <<a href="mailto:owh@ieee.org">owh@ieee.org</a>>:<br>
> Hi, How can I deactivate RT-component from within the program? For example,<br>
> from onExecute, or from other method. An illustrative case is that a user<br>
> input toggled a bool variable, which is being checked in onExecute to decide<br>
> if to deactivate (NOT exit) the component. Hope to get some help. Thanks.<br>
> Hong<br>
><br>
> _______________________________________________<br>
> openrtm-users mailing list<br>
> <a href="mailto:openrtm-users@openrtm.org">openrtm-users@openrtm.org</a><br>
> <a href="http://www.openrtm.org/mailman/listinfo/openrtm-users" target="_blank">http://www.openrtm.org/mailman/listinfo/openrtm-users</a><br>
_______________________________________________<br>
openrtm-users mailing list<br>
<a href="mailto:openrtm-users@openrtm.org">openrtm-users@openrtm.org</a><br>
<a href="http://www.openrtm.org/mailman/listinfo/openrtm-users" target="_blank">http://www.openrtm.org/mailman/listinfo/openrtm-users</a><br>
</div></div></blockquote></div><br></div></div></div>