01-14-2009 10:12 PM
Hi Guys,
I am a Labview 8.5 user, and am fairly new to the program. My project is to create a multichannel analyzer using Labview, interfacing with a digital oscilloscope.
I have achieved this but the trouble is that the histogram is very slow.
What i have done is acquired the waveform from the oscilloscope and performed an amplitude measurement on the waveform, i have then created a histogram that bins all these voltage measurements. All three of these steps have been placed in the same while loop.
It behaves properly it just seems as though the iterations for the loop run a lot slower than they should.
Would anyone have any suggestions on how i could make it run faster?
Thanks in advance.
01-15-2009 12:25 AM
Hi there
There's an almost endless number of possible reasons why your loop seems to be too slow.
First of all: Check the specification of your oscilloscope to see what is technically possible.
Make sure to initialize your hardware only once, right befor you enter the loop and close the hardware only once, right after the loop.
You may want to search the driver database at ni.com for an existing LabVIEW driver of your oscilloscope.
And after all: Post some code (zipped) for us, than we can have a closer look (like i said, there are lots of possible reasons)
01-15-2009 01:14 AM
joel17 wrote:Would anyone have any suggestions on how i could make it run faster?
Sure, if you show us your code we might be able to suggest improvements.. 😄
01-20-2009 06:30 PM
Hello again,
Sorry for the late reply. I may have found a solution to my problem, but now i dont think my VI is performing as it should.
I changed my type of measurement from an amplitude measurement to a peak detect and now the histogram updates much faster, although the spectrum i obtain is not what it should be. I have attatched both my original and updated code.
Any assistance would be greatly appreciated.
Thanks for you patience.
Joel
01-22-2009
12:31 AM
- last edited on
04-27-2025
10:23 PM
by
Content Cleaner
Hi Joel,
Looks like you have done a lot of work for this VI. You say your spectrum (I assume your histogram) is incorrect; what exactly is wrong with it? Did it produce results that you agreed with before you made your changes? In order to help debug your code, I strongly suggest using subVIs to clean up your block diagrams. Take a look at the LabVIEW help found here: https://www.ni.com/docs/en-US/bundle/labview/page/creating-subvis-from-sections-of-a-vi.html. Ae you still concerned with your loop times, because there is a lot to be said on how to alter your code to impove performance.
01-26-2009 04:19 PM
Hi Joshua,
You are correct in assuming i meant my histogram. In the 'histogram part original.zip' VI the histogram that i obtain is one that I expect. It is an energy spectrum from a Sodium 22 radiation source. The other VI does not obtain the correct spectrum but behaves a lot quicker. I believe it is the original VI that i must work on in order to make it run faster. Thankyou for the link, I will check it out now to try and clean the VI up as you suggest.
Thanks for your reply,
Joel
01-28-2009 12:05 AM - edited 01-28-2009 12:06 AM
01-28-2009
12:11 AM
- last edited on
04-27-2025
10:23 PM
by
Content Cleaner
Since I can't stress the basics enough...the How can I Learn LabVIEW page has great tutorials on the basics of dataflow programming and the File I/O VIs amoung other things. Since you seem to have done a lot already, you are probably OK, but it never hurts to show the link off to others: http://www.ni.com/academic/lv_training/how_learn_lv.htm .
01-28-2009 05:10 PM
Thanks for the suggestions. I will give them a go and hopefully the speed of the iterations increases. I am still fairly new to LabView so the link was very helpful. All your help has been greatly appreciated.
Joel
01-28-2009 09:27 PM
Hello again,
I spent my day today trying your suggestions and although they did make the loop run a bit faster unfortunately it was not to the extent that I need. It is currently taking the VI about an hour to obtain a statistically sufficient spectrum when I need to take about 5 minutes.
The instrument I am reading from is a Tektronix MSO 4104 Mixed Signal Oscilloscope and i have downloaded the driver from the link below...
http://sine.ni.com/apps/utf8/niid_web_display.model_page?p_model_id=11631
I think the problem may be the amplitude measurement I am using. Is there any way to make the measurement quicker? I tried placing the amplitude measurement in a for loop within the stacked sequence, although this just increased the number of counts for the same measurement in the histogram rather than making more measurements.
Thanks again
Joel