LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Speeding up execution

I am looking for the same double floating point precision and range that a hypothetical [0,360] dice would give. 

0 Kudos
Message 11 of 31
(945 Views)

I agree with Ravens Fan.  If the precision of your simuation is so good that you can detect the extremely tiny deviations from uniformity (if there are any), you probably have a lot of other things to worry about first.

 

Lynn

0 Kudos
Message 12 of 31
(944 Views)

Ravens Fan:

Is the difference between 'iteration duration' indicator on the output node in a timed structure and 'Elapsed Time VI'  just that the former gives only the time to execute the code within the structure, while the latter gives the total time spent before transferring to the next iteration?

 

0 Kudos
Message 13 of 31
(936 Views)

For the Iteration duration, it is the time it took for the last iteration of that timed loop to execute.

 

I don't see any Elapsed Time Express VI in your VI.  But if you had it, it will give the time since the Express either was originally executed or since it was last reset.

0 Kudos
Message 14 of 31
(934 Views)

So if I had a timed loop with a single elementary operation but made to wait for 3 seconds before the next iteration, the iteration indicator would show close to 0, while the elapsed time would show 3, assuming it is reset after time target. Correct?

0 Kudos
Message 15 of 31
(931 Views)

Is the wait because of the period of the timed loop, or because you put a 3 second wait statement in there?

 

Try coding it up and see what you can figure out.Smiley Wink

0 Kudos
Message 16 of 31
(929 Views)

Well I did, and that's what I got ( the 3 seconds was the loop time period). But I raised the question because when I use them in my vi, the iter. indicator shows around 0.5~0.6 seconds every time while the elapsed time constantly alternates between ~0.5 and 1 second. I don't know why because the period is actually much smaller than that , around 0.5-1 millisec, meaning the loop constantly finishes late. So there is no apparent reason for elapsed time to show 1 sec.

0 Kudos
Message 17 of 31
(927 Views)

There must be something in your while loop (or a combination of things happening in series) that is taking about 1/2 second.  Delete or disable sections of code that you think may take some time and see if the loop iteration time drops.  Use the Tick Count function and some flat sequence structures to see what may be taking longer.

 

As Lynn had said, look at the Matlab node.

 

Also I'm wondering, why do you have a value wired into the dT of the timed loop that comes from a feedback node that comes from the value that goes into the Coherence Time indicator?

0 Kudos
Message 18 of 31
(921 Views)

Oh the intention was to generate a new coherence time every time and make the loop run only for that time. But I have since realized that loopback won't solve the purpose because the current iteration would then run on the prev iteration's coherence time. So it has to be taken out. 

0 Kudos
Message 19 of 31
(919 Views)

That will set the period of the loop.  But it won't change it from iteration to iteration.  It would change it from one run of the VI to the next time you restart your VI.

 

If you want to change it from iteration to iteration, you need to wire it inside the loop to the nodes on the right inside of the loop.  But remember, that just changes the loop rate, it's not going to change how long it takes for a given iteration to actually take.

0 Kudos
Message 20 of 31
(916 Views)