LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String concatenation and vi speed

Solved!
Go to solution

I am trying to convert waveform data in .tdms into ASCII file in a particular format in order to be read by another software. The vi which I have written (attached) is able to do the job but at a very slow pace. In takes the vi approximately 20 minutes to complete a one second data (22050 samples). This us too slow as I am planning to work with waveform data at 1.5 million samples (takes 16 hours). I think the problem is attributed to the string concatination. Does anyone has any suggestion as how I can improve on this vi performance in terms of its speed. Thanks. 

 

Running Labview 2011 on a window 7 laptop (i5 2.50GHz with 8G RAM)

0 Kudos
Message 1 of 11
(3,691 Views)
Solution
Accepted by topic author Crawling

Sorry about this question.  I had it solved after removing the 'wait until the next ms multiple' vi from the loop iteration. 

0 Kudos
Message 2 of 11
(3,687 Views)

For some additional optomizations you can get a boost by using autoindexing tunnels and do your string concatinizations in one fell swoop (Yes, Concatinate String works just fine on arrays)

Strcat.png

 


"Should be" isn't "Is" -Jay
Message 3 of 11
(3,681 Views)

@Crawling wrote:

I had it solved after removing the 'wait until the next ms multiple' vi from the loop iteration. 


Jeff already pointed out some more optimizations, but here are a few more things that are wrong with your VI:

 

  • Your shift register is uninitialized, meaning that its contents grow with each run and eventually you will run out of memory.
  • Even with 1.5M samples, it will only a few seconds, so the progress bar is not really needed.
  • If you like simpler code, you could do something as follows (it is very slightly slower that Jeff's but probably worth it for easier code maintenance and diagram real estate.) 🙂

 

 

(I left the CR at the beginning like in your code, jeff move ot to the end of each segment. Not sure what you really want)

 

Message 4 of 11
(3,647 Views)
That is scary. does parallelism effect speed?

My code slightly faster than Christians? That has to be a compiler optimization bug. But, I'll cherish the moment.

"Should be" isn't "Is" -Jay
Message 5 of 11
(3,634 Views)

Dear Jeff,

 

Thanks for the input.  By the way what is the vi connecting between the interleave 1-D array and concatenated string.  I do not recongize the symbol.  I believe it is to convert the 1D string array to string. The closest I could get in my search is byte array to string which is incorrect.

0 Kudos
Message 6 of 11
(3,622 Views)

It is Concatenate, on the string palette.  It works on arrays.

 

Jeff posted a snippet, so you can drag that image to a block diagram.  Then use context help to hover over the functions you are not familiar with.

0 Kudos
Message 7 of 11
(3,620 Views)
Actually Bill, that's "Interleave arrays". One of those resizable array functions that need a bit more press in core 1.


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 11
(3,590 Views)

He was asking between Interleave Arrays and Concatenated string which I assumed he meant was the indicator terminal snce that is what the indicator was labelled.

 

Concatenate is between the Interleave Arrays and the terminal.

0 Kudos
Message 9 of 11
(3,571 Views)

Silly mobile version.... Needs an inline viewer for images.   I appologize Bill, you are correct.


"Should be" isn't "Is" -Jay
Message 10 of 11
(3,565 Views)