LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does my application slow down?



altenbach wrote:

What is with all the globals. Is this program part of a bigger system? Most of the globals are not used anywhere. Are they used elsewhere?


The program is not bigger than that, the file I attached is all the program. I have to remove the globals not used anymore (they were in a previous version).

I'll bring those modifications to my program and see if it works better.

Thanks a lot.

0 Kudos
Message 11 of 27
(3,392 Views)
I now use U16 instead of DBL in my program, I deleted the globals not used and initilized shift registers' length but I don't see any significant changes.
 
Could it be an other reason of my application slowing down?
0 Kudos
Message 12 of 27
(3,376 Views)

Please show us your new code. 🙂 Are you absolutely sure the array sizes in the shift registers no longer change?

0 Kudos
Message 13 of 27
(3,370 Views)
Here's a quick draft how you would initialize the shift register arrays at a fixed size and then use replace array element to fill with data.
 
Notice that when you omit all these unecessary sequence frames, many operations (e.g. setting axis multiplier, array initialisation, string concatenation, BT open, etc) can already take place while waiting for the start button to be pressed. 🙂
 
(One thing remains to be decided: Do you want to use the time for program start, acquisition start, or acquisition end. Simply place the time function is a small flat sequence frame and wire a suitable wire with the right data dependency to the edge of it. ;))
 
 

Message Edited by altenbach on 02-26-2007 10:45 AM

0 Kudos
Message 14 of 27
(3,365 Views)
Here's the new application, cleaned. There is just one thing I don't like. When data are displayed the X-axis is sample number and not the time.
0 Kudos
Message 15 of 27
(3,348 Views)
Hi roberto,

well, it's cleaned up a bit, but still not perfect...

1) Just writing a number in the index field of array constants doesn't initialize them, they are still empty arrays! Use some proper initialization, there's a special function in the array palette...
2) You still use 'build array' to collect your data for the graphs, so you still will have the penalty of growing arrays and slow execution after a while.
3) Your graphs are only displaying y-data, because you feed them in that fashion. Have a look at the examples to see how to provide x AND y-data for an XY-graph!
4) When you want to have U16 values from your bluetooth you should also convert them (using typecasting) this way. You did provide an I16 to the typecasting requiring more typeconversion afterwards (see those red dots all over your diagram).

Message Edited by GerdW on 02-27-2007 04:40 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 16 of 27
(3,333 Views)

roberto.venetz wrote:
Here's the new application, cleaned. There is just one thing I don't like. When data are displayed the X-axis is sample number and not the time.

My modification above solves this by writing 0.09 to the "x-axis:multiplier" of all graphs. Since you have uniform x-spacing, you definitely don't need an xy-graph as Gerd suggested earlier).

Have you looked at all at my example (LDF_mainMOD2.vi) modifications that I provided above? There are extensive diagram comments in yellow that should be ablt to guide you. If anything is not clear, please ask. Good luck! 🙂

I'm pretty sure you could simplify my version even more: get rid of the inner FOR loop, read 6 bytes at once, and typecase to an array of U16, for example.

One thing is not clear to me: You get three different values (value, volume, speed) in sequence with the same command. Isn't there a danger of a "Phase shift" and things could get scrambled in a worst-case scenario?

0 Kudos
Message 17 of 27
(3,327 Views)

I've looked at your file and it help me a lot, thanks.

Writing 0.09 to the "x-axis:multiplier" of all graphs is not supported in application for PDA, I'll take a look how I can solve that.

Your absolutely rigth about a "Phase shift" danger but I solved that with a good process managment. I performed some tests and it's all rigth.

I'll continue to work on this application and you'll find more message very soon.

0 Kudos
Message 18 of 27
(3,320 Views)
Sorry, I don't have the PDA module, but I am surprised that that property is not available. Can you set it manually by going to the x-axis properties?
 
Since they are fixed by a diagram constant, it's not even worth writing these properties even once.
0 Kudos
Message 19 of 27
(3,316 Views)
I'm surprised too. I don't know with which LabVIEW version you wrote the program but I'll try to set this property with the 8.20... Sometimes that's the problem.
0 Kudos
Message 20 of 27
(3,274 Views)