07-24-2014 09:53 PM
in for loop, each execution will output string and display it on front panel by value property.
But after upgrade to LabVIEW 2012, the execution time doubled on Chinese XP OS, I really want to know this difference between LabVIEW 2011 & LabVIEW 2012, pls advice.
07-24-2014 11:08 PM
How big are the strings?
Why are you writing to a value property instead of the terminal?
How do you measure the speed?
Can you show us some simplified code that shows the problem?
07-24-2014 11:29 PM
How big are the strings?
Eli: some step output large size string that is about 165kB, and the size of string from all steps is 614kB;
Why are you writing to a value property instead of the terminal?
Eli: as you can see in below figure, I also need set the scrollposistion;
How do you measure the speed?
Eli: in parallel with the for loop, I have another while loop to record the execution time till the for loop finished;
Can you show us some simplified code that shows the problem?
Eli: refer below pic.
thx!
07-25-2014 12:16 AM
the picture does not show.
How can you measure execution time from a parallel loop. That does not make any sense.
07-25-2014 12:32 AM - edited 07-25-2014 12:39 AM
Put it in .zip file this time.
I have tried to write string to terminal directly instead of value property, no improvement.
07-25-2014 02:36 AM - edited 07-25-2014 02:40 AM
This is no way to measure the execution time. Your parallel while loop spins as fast as the computer allows, consuming all CPU it can get in the process, and starving everything else. Your code is highly flawed!
In addition, get date/time in seconds is also a relatively expensive function, not to mention all these local variables! Your benchmark is completely meaningless! All it does is slow down your regular code, nothing else. How do you know in what order things start? Where is the "start time" initilized (where is the terminal?!)
A proper benchmark uses a three-frame flat sequence with to high resolution relative seconds timers, on in each outer frame and the code to be benchmarked in the inner frame. (here is an example). The difference between the two timers is the exection time of the inner code in seconds. Make sure to only have wires in the benchmarking code. All controls and indicators belong outside the sequence. Also make sure that no other code can run in parallel to the sequence.
Use this and you'll be surprise how fast your code actually runs.
Then you should also disabele debugging.
Please attach your actual code (including the subVI) so we can see what else you are doing wrong.
07-25-2014 02:59 AM - edited 07-25-2014 03:03 AM
This is no way to measure the execution time. Your parallel while loop spins as fast as the computer allows, consuming all CPU it can get in the process, and starving everything else. Your code is highly flawed!
Eli: actually I add 10milliseconds delay inside both for and while loop.
In addition, get date/time in seconds is also a relatively expensive function, not to mention all these local variables! Your benchmark is completely meaningless! All it does is slow down your regular code, nothing else. How do you know in what order things start? Where is the "start time" initilized (where is the terminal?!)
Eli: I am using the states machine, and set the "start time" during the program initialization, then calculate "test time"in next case (running block).
A proper benchmark uses a three-frame flat sequence with to high resolution relative seconds timers, on in each outer frame and the code to be benchmarked in the inner frame. (here is an example). The difference between the two timers is the exection time of the inner code in seconds. Make sure to only have wires in the benchmarking code. All controls and indicators belong outside the sequence. Also make sure that no other code can run in parallel to the sequence.
Use this and you'll be surprise how fast your code actually runs.
Then you should also disabele debugging.
Please attach your actual code (including the subVI) so we can see what else you are doing wrong.
Eli: if possible, give me your mail address, then I can sent more actual code to you separately.
07-28-2014 10:36 PM
to avoid this problem came to nothing, resend it here.
07-28-2014 11:09 PM
@ELI2011 wrote:
to avoid this problem came to nothing, resend it here.
What does this mean?
07-28-2014 11:26 PM
I still want to know the reason why LabVIEW 2012 has this difference from LabVIEW 2011, that if write large size string to front panel indicator in for loop, it has long execution time.
I have three way to bypass this issue:
a. remove commands which will cause large size string output;
b. change OS language to English from Chinese;
c. move to Win 7 OS PC;
but the different is there...