RobotStudio event

Virtual FP don’t shotdown

Hi,

I am working with RS 5.09.2189.166 and RAB 5.09 doing FlexPendant application.

I add RapidDataBindingSource to my project and bind one RAPID PERS num variable to one TpsLabel. Its OK and the binding works - No problem there.

But after previous action the Virtual FlexPendant won't shutdown propelly. The graphical window disappears, but FlexPendant.exe don't shutdown but hangs around in Task Manager's processes.

This naturally prevent to update/copy rebuilded TpsViewxxx.dll and .gtpu.dll files to controller folder (I guess VFP locks these files). Also VFP don't pop up/appears after F5 in RS.

I have to manually end FlexPendant.exe process from the Task Manager to test new build of my application.

If I remove the databinding and delete RapidDataBindingSource object from my project, the VFP start to work just fine as usually.

I will continue my project with subscribing to ValueChange event and forget databindings- anyhow it will suit me better in this case anyhow.

Have anybody ideas why databinding mess VFP shutdown? Should the databingings dispose somehow before closing my application?

Mika

Comments

  • Yes, you must dispose signal and rapid databinding controls manually, either in the dispose or uninstall methods....  It points this out in the manual as well.  As a matter of fact its the same thing with any rapiddata or other rbt control interface type objects... if it has a "dispose" method, then make sure you use it.   There's an entire section on the issues with  garbage collection in the manual.    Basically, NOT doing this is a memory leak, and then windows will not terminate the process......  

    Mike Kegley
  • Hi

    From time to time I've been struggling with this dispose feature also, so is there any way to see which objects are not disposed correctly? For example is there some nice feature in VisualStudio which could tell me while debugging that these objects are not disposed yet?

     

    -Osku-

  • Sorry man, I do it the ol' fashion hard way... debug it until you can get the virtual control to shut down properly....  and yes it is a pain.  My main mode of operation is to put all my ABB items that I know will need disposed of into an arraylist(c#).... during the install method... (one list for each type of object)then loop through each list disposing every item(object) in the list during the uninstall method .    If you can remember to always code the add to the list at the same time you declare the abb object, you'll save some headache in the end...

    Personally, I think ABB should take care of this,  I think it would make their product more productive for app developers... cause I spend a LOT of time "bookkeeping" all those objects that have to get disposed.  After all is it .Net...  it's not like I'm coding in C++ or C.

    I hope someone replys with a good answer to your question about a tool.... an easy to use tool....    cause I'll use it.

     

     

    kegley1822007-9-6 17:44:0
    Mike Kegley
  • Hi again,

    I am still having this problem now with value change event.

    I create variable in class level. In class constructor I initialize it and read the value. In Activate and Deactivate events I subscribe/unsubscribe to/from eventhadler. In dispose event I dispose all relevant ABB objects.

    So if I subscribe to ValueChanged event like:


    _rdToolCupsGrp1.ValueChanged += new DataValueChangedEventHandler(_rdToolCupsGrp1_ValueChanged);

    I start to have problems that VFP won't shut down, but if I don't subscribe to event VFP will shut down propelly.

    Any ideas how I can find the problem. I have check many times that I dispose all variables and I have try several different places where I subscribe/unsuscribe to/from event.

    An other thing. Why the TpsLabel control don't have the TextChange event? How can I notified when the value change like through databinding?

    Mika

  • Maybe remove the event handler just before you stop your program

    _rdToolCupsGrp1.ValueChanged -= new DataValueChangedEventHandler(_rdToolCupsGrp1_ValueChanged);

     

  • I have try that in:

    1. Deactivate event

    2. Uninstall event

    3. just before dispose the object

    Any of previous didn't help.