Jump to content

Objects Slow code - how to debug?


Recommended Posts

I'm relatively new to LV and a beginner in OOP. I have a singleton class for routine overhead (writen by an experierenced developer) that randomly slows a timed loop down to a craw, running on a MS workstation. Without the obect the loop runs in less than 1 ms, with it I can randomly see 30-70ms.

How does one go about diagnosing such problems with GOOP objects?

Thanks- Jeff

Link to comment
How does one go about diagnosing such problems with GOOP objects?

You can start by uploading some code for us to look at smile.gif Also, is it GOOP or is it LVOOP (or a different flavor of OOP)? GOOP specifically refers to classes/methods written using the Endevo toolkit, LV-OOP is the built-in LabVIEW OO framework. It's important for us to know what we're dealing with to help you.

Link to comment

Hi Jeff

If you can upload the same code in 8.6, I can help you quicker, since I won't have access to LV-2009 until tonight :-)

Or. you can just port a screen shot of your "Stop Loop Query"

But here are some tips/question.

I guess the "Stop Loops" sets a flag in the attribute and the "Stop Loop Query" checks it?!

Reading from the attribute is normally a quick task, but if the size of the attribute is huge, it will taks some time.

You can check the attribute size, using the "Tools->Debuggers->Endevo Object Debugger..." option.

I would suggest that you check how often this "Stop Loop Query" is called in other loops, so you don't call it so often LabVIEW has to wait for access to it.

When I need a faster attribute access and I know it's a Singleton, I use one LabVIEW 2-Style Global

post-941-126281020838_thumb.png

If you have many caller to the "Stop Loop Query"-VI, you can change it's Priority to subroutine (VI Properties->Execution).

And when you use this VI on the block diagrams you can right click on it and select option: "Skip Subroutine Call if Busy"

I also use the Profiler to see how much time is spend in accessing the attributes of the class.

Cheers,

MIkael

Link to comment

Thanks for the suggestions.

Dose OOP pose systemic issues with regard to timing and speed? Are there timing issues with OOP when run on non-RT targets?

While I'm happy to live with functional globals the use of singleton classes without the need to pass references was attractive.

Thanks - Jeff

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.