キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Replace Array Elements using Replace array subset Function Causing higher CPU % Usage..

解決済み
解決策を見る

Hello Every one

I am trying to plot intensity graph using Predefined array size 2500*400 with Replace Array Subset function.

Replacing every elements in array one by one..

but as soon as i run my code my CPU usage goes to 95% some time 100 %

that causing delay \skipping plotting  data in intensity graph.

is there any other option for Replace array subset function..i think that causing my CPU usage to 95%

2500*400=1000000 Element (Replacing every element in array one by one)

0 件の賞賛
メッセージ1/8
5,759件の閲覧回数

We are more interested in the block diagram than in the front panel. Can you attach the actual VI?

 

It also depends how you are replacing the elements in the existing array. Do you keep the array in a shift register (correct) or ping-pong it (read/write) it via local variables (bad!) or value property nodes (even worse!)

 

Why don't you replace all at once? The front panel runs in the UI thread, so it is normal that it does not visibly update with every point. There should be no "skipping", though. What do you mean by that?

 

I am sure you are aware that your intensity graph has fewer pixels than your array (at least horizontally), so not all values can be shown anyway.

 

Most likely, most of your CPU is used to for the UI, not the replace operation. What is your loop rate? Do you use any unusual priority settings? Do you use any unusual "advanced" settings for the graph indicator?

0 件の賞賛
メッセージ2/8
5,754件の閲覧回数

Thanks for Reply

Actual plotting is done by value change event of two counters 

1=Scan Axis Counter 

2=Index Axis Counter

its unable to post original code here but similar task vi snippet i can post here .

CPU is Intel Core 2 Duo 2.9 GHz

Ram 4 GB 

Similar code works for small scale 

e.g 1500*100 Array size CPU usage is normal for this condition 20-25 %

but not for 2500*400

0 件の賞賛
メッセージ3/8
5,739件の閲覧回数
解決策
受理者 AtulS

Use defer panel updates methods to stop updating the graph for every value added.


"Should be" isn't "Is" -Jay
メッセージ4/8
5,736件の閲覧回数

Get rid of all the local variables and the upper loop. Thread the initialized array across all loops via shift registers in the lower code and replace/display in the innermost loop.

0 件の賞賛
メッセージ5/8
5,732件の閲覧回数
解決策
受理者 AtulS

You have classic race conditions, because there is no synchronization between your two loops. All you need is the following (no stacked sequences! no local variables!)

 

 

Update2D.png

メッセージ6/8
5,726件の閲覧回数

Thanks   and 

0 件の賞賛
メッセージ7/8
5,666件の閲覧回数

I would strongly recommend against deferring panel updates. That is pointless here! You might still want to e.g. update the indicators showing the current coordinates, for example. Graph updates are already asynchronous by default.

 

If you only want to update the graph occasionally, place its terminal inside a case structure that only goes TRUE every n'th iteration (make sure it updates on the last iteration). If you only want to update whenever a row has been completed, place the graph terminal one loop out (after the innermost loop). If you only want to update the graph once the entire data is finished, place if after the two inner loops.

0 件の賞賛
メッセージ8/8
5,658件の閲覧回数