Jump to content

Right mousebutton menu speeds up program


Recommended Posts

Hi,

At the moment I'm developing a program for data acquisition from a digital scope. It consists of a dll provided by the scope manufacturer, and a graph which displays it. The VI runs a loop and gets its data through the DLL from the scope.

When running the program it uses a 3-10% cpu power (on winxp) but when I use the right mouse button on one of the controls in the VI the cpu usage goes up to ~50% and the data acquisition speeds up a lot. How can i make the program to run always this fast? as speed is rather crucial for this project.

Or if it aint possible, what is the reason the right click speeds up everything.

Thanks

Link to comment

Hello Hoeloeloe,

An increase in CPU usage does not necessarily mean that the program is running faster. Most likely, right clicking on a control is causing other events to occur which require more CPU power. Also, you might want to clock the time it takes for one iteration of the loop to complete. Have that display somewhere on the screen and watch the speed (in ms) while it runs and while you right click on a control. I'm sure that the speed will decrease or stay the same.

It might also help to see a sample of your code...

Link to comment

QUOTE(LV-Vikingr @ Mar 8 2007, 05:17 PM)

Hello Hoeloeloe,

An increase in CPU usage does not necessarily mean that the program is running faster. Most likely, right clicking on a control is causing other events to occur which require more CPU power. Also, you might want to clock the time it takes for one iteration of the loop to complete. Have that display somewhere on the screen and watch the speed (in ms) while it runs and while you right click on a control. I'm sure that the speed will decrease or stay the same.

It might also help to see a sample of your code...

First of all, thanks for replying.

Ok I added a millisecond counter. When normally running the program it says it takes about 60-100 ms for one loop. When pressing the right mouse button on the graph or a control the counter goes down to 2-5 ms for one loop. So something happens for sure

QUOTE

Without any actual knowledge of your code, it sounds as if you are sampling in the same VI that graphs the data? If this is the case, it means that your data acquisition is taking place in the same thread as the UI, and is therefore affected by events like the Mouse clicks/window dragging etc.

Youre right. I will have a look into the producer/consumer for displaying the data. But the same thing happens even when the graphs are removed from the VI

EDIT:

After restarting Labview the problem is gone for some time. So maybe it occurs only during development.

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.