LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there anything faster than "Simulate Signal.vi" ?

I've made a VI for controlling a laser scanner. This scanner outputs a voltage signal each for the X and Z co-ordinates and an up/dn count for the Y. While making the interface and testing, I noticed it ran quite slow as I was unable to get an acquisition rate much better than 300Hz. I have a DAQCard-6036E which is a 200kS/s card, and I was requesting 20 samples at a rate of 100kS/s, which without any overhead would be 5000Hz. Once I add in my interpolation routine and a couple others, the rate drops to a crawl at 50Hz or less.

As I'm without the hardware for a week or so, I substituted the DAQ Assistant VI's (which I was using to input the X,Y,Z signals from the DAQ card) with three "Simulate Signal" VI's, and set them for sine and square wave signals of varying frequencies and amplitudes to simulate the approximate motion of the scanner. It ran -extremely- slowly, at only 12 to 13Hz, so I ran the profiler and found that the main offenders were these 3 Simulate Signal VI's.

After blowing it open and trying to trim it down some, and after doing alot of searching around the forum, I made this little VI to test changes. With my system right now, I can get a rate of about 3000Hz out of this, while the maximum rate (100,000 / 20) would be 5000Hz. Is there a simpler method to get a faster result using lower level VI's? I hope to apply the same logic by replacing the DAQ Assistant VI's. None of the parameters are changed during runtime.
0 Kudos
Message 1 of 4
(2,541 Views)
Here is my sample VI
0 Kudos
Message 2 of 4
(2,537 Views)
The Sine pattern.vi executes in microseconds while the Simulate4 signal and its subVI take milliseconds. Also updating indicators inside the loop slows things way down because of screen update times. If you want speed do not put any indicators or controls inside the loop if you can avoid it.

Lynn
0 Kudos
Message 3 of 4
(2,523 Views)
You did not include your "Cool Timer" in your example, but looking at your diagram it seems to me you want to enter a Formula 1 race using a 18-wheeler truck. 😉

With each iteration you just want a single value of the sine function (Adding offsets and amplitudes is just simple math, etc.).
The attached VI (LabVIEW 7.0) shows the speeds you can get after dropping all that extra baggage.
0 Kudos
Message 4 of 4
(2,518 Views)