LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Very large array cause the program to slow down

Dear Sir or Madam,
I am writting an array of data to my AO board to generate analog signal with LabView.Because the time resloution is high(200usec),and the whole time is long(~100sec),the data array becomes very large (8 X 5*10^5) (8 chanels),and the delay time between starting runing and the signal really output is long(~20sec).
I wonder when some vi (ex.build array.vi..) is dealing with large array,it delays the speed of running because the number of loops I am using is independent of array size.
How could I overcome this problem?
Is adding some RAM helpful?

Thank you for your kind help!!
0 Kudos
Message 1 of 3
(3,342 Views)
More RAM may help.

Let me suggest an approach that will help you decide.

First, if your OP SYS allows you to monitor your memory usage, do that.

Otherwise you can do a few checks. These checks are based on the property that virtaul memory is a lot slower than physical memory and that the OP sys will use physical memory before going to virtual.

1) Set your buffer size to something small like just 1 seconds worth after a fresh re-boot (just to make sure memory is cleaned up).

2) check the performance.

3) Double your buffer size and re-check performance.

4) Repat the above steps and note how performance changes as the buffer is increased.

If only physical memory is being used for all of your testing, the time should be fairly linear with the buffe
r size.

If Virtual memory kicks in, the time vs buffer size should increase non-linearly when you cross from physical to virtual memory. The difference will probably be on the order of 10 between the two types.

Once you find the threshold that mandates virtaul memory, stop and convince yourself that you can make it run good below that threshold and runs bad above that level.

If all of this checks out, more memory will probaly help.

If you find that the time is linear with buffer size and no clear threshold demarks good performance from bad, more memory may not make a difference.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 3
(3,342 Views)
> I am writting an array of data to my AO board to generate analog
> signal with LabView.Because the time resloution is high(200usec),and
> the whole time is long(~100sec),the data array becomes very large (8 X
> 5*10^5) (8 chanels),and the delay time between starting runing and the
> signal really output is long(~20sec).
> I wonder when some vi (ex.build array.vi..) is dealing with large
> array,it delays the speed of running because the number of loops I am
> using is independent of array size.
> How could I overcome this problem?
> Is adding some RAM helpful?
>

If your disk is chattering away, then adding RAM is the best, cheapest
solution -- about 60 dollars for 512M. On the otherhand, this isn't
tons of data. Temporarily delete the
latter portion of the program
where you send it to the AO board. Just generate the data and send it
into the bit bucket and see how long that takes. If you are using
globals or locals and terminals to show the data, this will take tons of
time compared to sending it down wires. Speed up this DAQ-FREE version
of the diagram, then put the DAQ back.

Another thing to do is to use the profiler. It really doesn't work that
well when you don't have much hierarchy, since its data is taken at the
subVI level, but it might give you some info.

Greg McKaskle
Message 3 of 3
(3,342 Views)