LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

performance

Hi ,
 
I created a basic picture control program that allows the user to change the size of a sphere by placing the cyclinder in a do while loop.But the problem is that the performance is very poor. it takes along time to stop the program. is the a better way to do this operation.
 
thanks
0 Kudos
Message 1 of 10
(4,742 Views)
Hi JimJones

I am mulling through something like this myself.  I am not sure if I have addressed it completely yet though, so these are really just ideas.

Basically, I think it is the longer the VI runs, the more references that get created (and when you click Stop, Labview has to go and close them all).  The trick then is finding how to close them (or, not open them all in the first place!).

I noticed in the Examples that the references of the Geometry object were explicitly closed after the "Set Geometry" method was called, so grab the throughput of the Geometry terminal and wire it to a Close Reference function.

They also put their Create Object functions outside of loops.  So, either put it before the loop and just pass the reference into the while loop, or, only create it on the first loop iteration.
0 Kudos
Message 2 of 10
(4,730 Views)

Place an indicator on the iteration terminal of your while loop and you see immediately what's happening:

You are not changing the size of your object, but you are constantly creating (!) new objeects (mostly identical) at a rate of thousands per second.

So:

  1. Create your object once (e.g. outside the loop or on demand), then modify its properties.
  2. Use an event structure so the loop only spins if one of the input controls change. There is no need to recalculate everything with the same values.
Message 3 of 10
(4,723 Views)
hi altenbach
 
I have been trying to set the properties up but with no success. i can not seem to get the case structure to execute when the controls change. i have attached the vi, the case structure is within the loop. I would like to know how to set the properties up.
 
thanks
 jim 
0 Kudos
Message 4 of 10
(4,627 Views)
Here is a possible solution.
The difficulty is that, as shown by the red dot on the input wire, the reference type is changed when the Set Geometry node is used (at least on my macintosh, I did not verified on a PC). So you need to typecast the reference back to cylinder. I don't like that...
Chilly Charly    (aka CC)
Message 5 of 10
(4,608 Views)
Hi CC,
 
The example you showed worked well, but when the stop button is pressed an error meassage comes up.
 
1.How could the error message be sorted out
2. How could multiple objects be updated by the user
 
thanks
0 Kudos
Message 6 of 10
(4,562 Views)


@JimJones wrote:
1.How could the error message be sorted out
2. How could multiple objects be updated by the user

  1. In the stop event, wire the "Scene Cylinder Refnum" across so the ."set geometry" method receives a valid input.
  2. Do you want to act on one of multiple objects, or do you want to apply the same transforms to multiple objects with each input change? In either case, you basically just expand on the existing code, adding more objects and event cases.

As an alternative to (1), you could also place all code after the event structure in the FALSE case of a case structure, then wire the stop boolean to the case selector. This way the code is skipped if stop is pressed.

Message Edited by altenbach on 11-21-2006 11:22 AM

0 Kudos
Message 7 of 10
(4,541 Views)

Hi Altenbach

I am having a few problems on how to connect the output from the event case to the picture scene for the second shape. I have added all the events to the case structure but how would the second shape be added to the picture scene, so that both shapes can bb changed by the user. thank for you help.

 

Jim 

 

0 Kudos
Message 8 of 10
(4,474 Views)
Jim,

you should resave your VI, because you removed the block diagram. This makes the VI smaller but useless for development/testing purposes.

Now if I look at charlie's VI. what you should do is keep a memory with all the geometries. Store the ouput of the set-geometry in an array that is kept in memory by a shift register with the references. Now the trick is to know which geometry the user is editing...

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 9 of 10
(4,452 Views)
Hi,
 
I think i should expain the problem better? I understand on how to add one shape to the picture scene, but how do you add another shape to the picture scene. the user should be able to change both shapes size and colour by pressing the buttons. The event case has been set up but i am not sure how to link the out from the event case to the scene display because now there are two shapes. i hope this explains the problem alot better.
 
thank you
 
jim
0 Kudos
Message 10 of 10
(4,424 Views)