07-16-2008 10:35 PM - edited 07-16-2008 10:42 PM
07-16-2008 10:42 PM
07-16-2008 10:48 PM
Hi,
Thanks for the reply.
Attached are my LV program and the block diagram of what I am trying to do right now. I am still working on the sofware part. For ease of finding, I have highlight the block diagram in yellow.
Thanks.
07-16-2008 11:23 PM - edited 07-16-2008 11:25 PM
I ran this on a fairly old machine and got about 8800 iterations.
I would recommend that you rewrite your VI so that the values are calculated using LabVIEW primitive math functions rather than using the Formula node. I believe the Formula node is probably an order of magnitude slower.
You can probably simplify the code a bit. The only difference between left and right cases is the choice of either addition or subtraction in the first line. You could merge the two cases. Just carry a boolean, or an integer of +1 or -1 in a shift register that you can multiply to the second half of that formula and add to the first half.
Also, if you can figure out how many samples you will be generating ahead of time, initialize an array of at least that large and use replace array subset in the loop rather than autoindexing at the tunnel. This may save processor time as the arrays grow and are moved around in memory at the auto indexing tunnels.
Are these calculations that have to be done on a continual basis to feed the waveform generator? Or will they be done once at the beginning, or occasionally during operation? Is it really critical that hundreds of thousands of elements of an array are generated in less than a second?
07-16-2008 11:55 PM
07-16-2008 11:58 PM
07-17-2008 11:58 PM
07-18-2008 12:16 AM
Hi all,
Or maybe can anyone kindly take a look at my program and advice me if the time I got is the time taken to generate 781250 samples?
07-18-2008 05:16 AM
Hi all
I had modify my program and the max amount of sample I could generate in 1 sec is only about 1168431
. I still can't generate about 8000000 samples /sec even I also had place the indicator outside the while loop. My program is as attached, please give me some advice.
Thanks.
Zhi Hong
07-18-2008 11:54 PM