02-14-2007 09:27 AM
02-14-2007 09:45 AM
Please post the code!
The Selects do not execute until both imputs are satisfied.
In the image you posted, this means that the work required for both select inputs as to be done even though you only want the one of the results.
By moving the code into a case, you can control which set of operations are done.
02-14-2007 09:50 AM
02-14-2007 10:06 AM
02-14-2007 10:10 AM
02-14-2007 10:13 AM
02-14-2007 10:32 AM
Wow! Thank you guys.
Some excellent responses!
I knew I forgot to mention something. The "= empty string" was the only way to detect the end of the file, as the file size varies (as well as contents).
I wish I could post the actual code... Maybe I can post a subset, especially after trying out what was proposed. 🙂
For the "Selects", they both deal with their own arrays. I am implementing a change later in the code where I may be able to get away from the bottom one altogether. I really don't need two arrays representing nearly the same thing.. (original code had nth arrays!! 😮 )
I'm going to investigate what Shane & Norbert proposed.
Question: The string you describe should "display" 16 bit and then /n and the next 16 bit?
Yes, something like that.. each line consists of qty 16: "1", "0", and "X" all seperated by spaces. These are created by another computer program.
a) Remove the typecast by changing the numeric constant to representation U8.
This change (constant of 48) to a U8 only improved the duration by 0.5 second. However, still a good practice, which I need to remember! 😉
b) Replace While loop with a For loop. N is the length of the string. Therefore, you wouldn't have dynamic memory reallocs.
I agree... The problem is that I do not know how many lines there are ahead of the loop. How would I count the no. of \n 's?
OK... I read this suggestion again.. You would loop for the number of ASCII characters within the file.. WOW that's a lot!!
25000 (lines) * ( 16 (bits) + 15 (spaces) ) = 775,000 iterations
Of course, I could remove all whitespace first.. 25000 * 16 = 400,000.
You mean that it would go fatser with 400,000 iterations of a For Loop than 25,000 iterations of a While Loop? 😮
02-14-2007 10:36 AM
It may be interesting to see a speed comparison, but how well do the shipping digital VIs work? There is the DWDT Spreadsheet String to Digital, which will give you a nice digital waveform including the Xs. Depending on your code further on it may be easier to use DWDTs anyway.
I glanced into the VI and I think you could speed it up some as well. It may be a nice excersize.
02-14-2007 10:58 AM
Another thing I forgot is that I am using LV7.1..
What Digital VI's?? Did this exist for LV7.1 (DWDT Spreadsheet String to Digital)?
I was thinking of doing something in line with Tomi's suggestion..
BTW, so far, there is a 25% improvement. Another 25% and I will be happy! 🙂
02-14-2007 11:33 AM