LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

slow execution of a event structure(Calling VI)

The VI i created is gettin slow after execution of a particular set of event in an event structure(Calling VI).Is it because of improper use of shift register?

I have attatched the VIs...Please run GUIdev and suggest solutions.Its really gettin on my nerves.

0 Kudos
Message 1 of 9
(4,756 Views)

Hi Sankar,

 

I gone through your VI. There is nothing there to slowdown the VI's execution. And also it didn't got slowdown in my PC. But for your information the GUIdev.vi will not come out of the outter while loop. Because, you have given the timeout value of -1 (infinity) for your event structure. So it will always be in the event structure, if no event occurs. So there is no chance for getting functionality of the stop button which stops the outter while loop. So better always use a time out value of 100 ms to your event structure.

 

MRK (CLAD)

0 Kudos
Message 2 of 9
(4,748 Views)

sankar227,

The VI you attached ('GUIdev.vi') is missing the 'LoadAndRun.vi' sub VI.  The other top level VI (GUI_dev.vi) is broken.  Can you please attach a complete set of VIs?

 

Chris M 

0 Kudos
Message 3 of 9
(4,745 Views)

Chris

I have send the VIs again..plz chk it..

0 Kudos
Message 4 of 9
(4,741 Views)

Hi MRK

 

i have chgd the time as u had suggested.But can u chk if after u click on the sliding buttons for a few times whether the movement of the sliding buttons slows down????

 

thanks

 

Sankar

0 Kudos
Message 5 of 9
(4,731 Views)

Yes, some subVIs are missing. Still, you probably should start out with a few simple tutorials because most of your code makes no sense.

 

SubVI#.vi: All subVIs have a single "CPU burner" loop that tries to consume ALL CPU while spinning millions of times per second. Running any of these will make the computer sluggish. Any polling loop needs a small wait statement!

 

GUIdev.vi: Contains a lof of questionable and unecessary code.

  • Why are you bundling and then immediately unbundling all these pictures?
  • You have many overlapping objects on the front panel. Not good for performance.
  • Use an array of paths and index the desired element instead of reading via value property nodes.
  • There is no event for the stop button.
  • You don't need the timeout event.
  • Lots of near duplicate event cases. Once instance of each is enough, simply use control references.
  • Lots of duplicate code for the pictures and paths. Use an array of names, autoindex it on a FOR loop, and use only one copy of the code fragment.
  • You seem to insert a VI at every iteration of the loop. Is this really necessary?

 

Can you explain in a bit more detail what you are actually trying to achieve with all this? Thanks! :

0 Kudos
Message 6 of 9
(4,728 Views)
Hi altenbach

 
Thanks for finding ways to optimize the code...but i have a few doubts.
CPU burner:I took care of the cpu burner condition.I jst called those for trying out t main VI.I will be replacing those VI with developed ones.
 
    * Why are you bundling and then immediately unbundling all these pictures?
     Ans:chgd it

    * You have many overlapping objects on the front panel. Not good for performance.
     Ans:I am making a GUI so i thk i have no other choice but to overlap them.Also is there ny way to remove the frame from the picture box.I have just minimized and kept it.

    * Use an array of paths and index the desired element instead of reading via value property nodes.
     Ans: Can u site an eg for it..i dnt hav tht level of experience

    * There is no event for the stop button.
       Ans:Is it necessary?I will be modifying it in the future.

    * You don't need the timeout event.
       Ans: Modified it

    * Lots of near duplicate event cases. Once instance of each is enough, simply use control references.
       Ans:Each event case is either for moving out,moving in or clicking of the sliding button.How do i use a control referece for it?

    * Lots of duplicate code for the pictures and paths. Use an array of names, autoindex it on a FOR loop, and use only one copy of the code fragment.
      Ans:Please site an example so i can follow suite.

    * You seem to insert a VI at every iteration of the loop. Is this really necessary?
     Ans:Actually i wanted to insert a Vi only on the mouse down event, and continue running the same VI even if other mouse events take place.But i cant thk of a logic to avoid thm.But i really need a solution for tht.
 

Can you explain in a bit more detail what you are actually trying to achieve with all this? Thanks! :
My Vi as u can see is a GUI for downloading data from a hard disk and viewing and modifying the video and audio data.I will be interfacing the video and audio part later on as it is still being developed by my frnds.
Also the problem of inserting a VI at every iteration is goig to pose a problem in the future as i want  to load each VI only for mouse clicks and let it run for all other instances.

Please help me out

regards

Sankar
0 Kudos
Message 7 of 9
(4,710 Views)

Well, here's a quick draft showing some of the ideas (LabVIEW 8.6.1). There are probably bugs. Modify as needed. Lots of things can still be simplified.

 

Your small FOR loops only make sense if you want some animation. In this case, you would need a delay inside the loop.

Message 8 of 9
(4,694 Views)

Hi altenbach

 

totally awesome.....tht was a superb code...i still have to make out hw u did all tht stuff...now i knw whom i hav to bug wen i face more probs....Smiley Happy

 

Sankar

0 Kudos
Message 9 of 9
(4,686 Views)