03-02-2015 02:43 AM
DaIn wrote:I only wanted to be sure, that there is no faster way to do this operation in Labview.
Maybe you want to flatten the loop code to the main diagram to avoid the subVI call overhead. Make sure to disable debugging.
If you want to keep it as a subVI, at least inline it.
03-02-2015 02:44 AM
@Yamaeda wrote:
For a running sum, especially on a large array you'll only need to keep the previous sum and add the new number, no need to recalculate the previous values that'll be constant.
I think that's what the code shown in the first post is already doing. Right?
03-02-2015 02:57 AM
@altenbach wrote:
@Yamaeda wrote:
For a running sum, especially on a large array you'll only need to keep the previous sum and add the new number, no need to recalculate the previous values that'll be constant.
I think that's what the code shown in the first post is already doing. Right?
Yes, i just got the impression the complete array was calculated each time, not just additions.
/Y
03-02-2015 03:36 AM
I will need the function as a subVI.
Disabling debugging and inline the execution is a good hint. Thanks.
03-02-2015 06:20 AM
If you want this to be as fast as possible, why not do the running sum inside of the FPGA? The FPGA can do it in a single cycle and it will always be up to date with the last value read.
03-02-2015 07:58 AM
I need both data informations.
Once i need the deltas and on another place i need the the running sum.
And transfering both arrays from FPGA to the Host requires more time or more DMA channels.
So this is no option. But thanks for your reply.
03-02-2015 10:21 AM
Also remember that if this needs to be done very often, you could pipeline the execution such that multiple CPUs work on successive, overlapping problems, i.e. the next computation starts wile another CPU is still ading elements of the previous problem.
On a typical quad core processor, you could go up to 4x faster.