LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timed loop period ceased working

I am trying to sample from a can card every milisecond, i have the period set as such, but the time spent in the loop/number of iteration says that the period is something around .2 miliseconds. why is this so? my program is attached.
0 Kudos
Message 1 of 15
(3,264 Views)
Hi cld8812,

do you really think we can work through your block diagram???

First for CAN: Is your device (and bus system) able to respond within 1ms?

2nd for your vi:
There are some problems in it:
- You should never stop a vi by using the "Stop" function - because there's a while loop running endless... Wire the stop condition to the while loop terminal and you can get rid of that function...
- You use much to much local variables! Replace them by shift registers! And use those indicator terminals - atleast you can remove one local for each indicatorSmiley Wink
- What about left-to-right wiring? Having block diagrams only the size of a screen? Using flat instead of stacked sequences?


Message Edited by GerdW on 06-27-2008 03:52 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 15
(3,255 Views)


@cld8812 wrote:
I am trying to sample from a can card every milisecond, i have the period set as such, but the time spent in the loop/number of iteration says that the period is something around .2 miliseconds. why is this so? my program is attached.


Reading the bold statements, i understand that the timed loop is running 5 times faster than it should. Is that correct???

If not, please refactor your code following Gerds suggestions. To add some points regarding performance/readability:
- If the analysis from the acquired signals takes too long, split up acquisition and analysis using another VI architecture.
- Try to avoid variables and sequence structures.
- Don't show all available data from nodes in the timed loop but show only the used ones.
- Your "Benchmark" does not benchmark the timed loop, but the timed loop including several array manipulations.
- Use "unbundle by name" instead of "unbundle" when using clusters.
... (many more)

hope this helps,
Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 15
(3,247 Views)
your correct, it is running 5 times faster than it should.
0 Kudos
Message 4 of 15
(3,243 Views)
Ok, how many "missed iterations" do you count?
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 15
(3,240 Views)
none
0 Kudos
Message 6 of 15
(3,238 Views)
How many iterations will the timed loop make for each "benchmark"? Is it a quite constant value?
Please move subtract and division for your benchmark in the second sequenceframe which takes the timestamp after the timed loop. does it make any difference?

Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 7 of 15
(3,229 Views)
movieing makes no difference, and it seems to be 145000-and 150000 iterations
0 Kudos
Message 8 of 15
(3,224 Views)
So, the timing difference your benchmark should reveal is about 30s for 150000 iterations. Is that correct?

Is the application running under windows?
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 9 of 15
(3,222 Views)
20.5 seconds, and its in windows under time critical priority.
0 Kudos
Message 10 of 15
(3,220 Views)