10-04-2010 03:08 AM
There are many things you do every iteration which only needs to be done once, and thus should be placed outside the loop completely.
- The read file is already mentioned
- The initializations of the graphs.
(- simulation?)
- Calculation for simulation
- Why do you build 3 arrays in the top left loop when you only use 2?
- The loop subtraction thingy is the same as wiring both arrays to a subtract.
I have a strong feeling the file read comsumes teh biggest portion of the time, move that outside the loop to start with.
/Y
10-04-2010 03:57 AM
My latest VI is attached. Read/Write spreadsheet as well Build table VI has been replaced with shift registers. As you can see, the speed didn't improve at all.
Yamaeda, the array subtraction in loop is for a reason. You can notice that a Select condition has been wired to the 'N' terminal of for loop.
Awais
10-04-2010 04:05 AM
Hello,
another thing is that you refreshx scale of yx graph each iteration that take a while
may be you could refresh 1 tiem out of 10 for example
or use defer option
another way could be to create a diplay loop with producer consumer design
Regards
Tinnitus
10-04-2010 04:16 AM - edited 10-04-2010 04:17 AM
Just for a test put this block outside the loop you will see the loop running faster
Regards
Tinnitus
10-05-2010 03:00 AM
I just tested moving the Graph property settings to outside the loop so it only initializes once, and the loop time changed from ~50 to 1 ! ms.
/Y
10-05-2010 03:20 AM
Btw, your select case -> loop with subtraction = Arrays wired to a subtraction. Try it. 😉
Your phase filtering is abit strange, you compare to (-)310 but the booleans are named >360 and similar. Though, i'm not quite sure what you're after in that calculation. You should be able to condense it through a case structure and/or Quotient/remainder calc though.
/Y
10-05-2010 03:34 AM
"Graph property settings outside the loop so it only initializes once"
Yes, it was a suggestion only to highlight there is something to do with this block
now it stay to know how to manage it...
Regards
Tinnitus
10-07-2010 11:33 AM - edited 10-07-2010 11:33 AM
Tinnitus,
Yes, I placed the graph property node outside the loop and my VI runs perfectly. I am getting 50 results in one second just like an ideal case.
Than you very much for pointing this out.
Thank you everyone for great suggestions.
Kudos for Everybody
Awais