09-02-2008 07:59 AM
I am trying to use a PCI-5122 card in a Windows XP PC/LabView set up to receive input from a Sodium Iodide detector to create a Multichannel Analyzer for Gamma ray spectrometry. It runs for a second or so then gives an error:
Error - 1074118632
niScope Fetch Cluster.vi:1
Driver Status: (Hex OxBFFA4018)
Data has been overwritten in memory and ....
Status Code -200004
What does this mean, and what can I do about it? It appears that there is a lack of synchronization between the card and computer and somebody's (probably the computer) memory is getting filled and overwritten?
The Error Code vi says something like text unavailable and tells me nothing new.
Thanks
Gammarays
09-03-2008 06:11 PM
Hi Gammarays,
It sounds like too many records are being recorded before you fetch them from memory. Could you explain what type of acquisition you're performing (I assume fetching multiple-record acquisitions). Are you doing any post-processing that is slowing you down? Are you working from one of the examples? If you could attach your VI or some screenshots it would be helpful.
09-04-2008 10:33 AM
Mike, Thanks for your reply. I'm sure you are correct, but I don't know how to tell when or how many things are being recorded and/or fetched. Since my post I have found that by playing around with the Min Sample and the Number of Samples I can get the vi to run varying lengths of time before the error. But I'm just groping. I have attached a couple of screen shots of what things look like after the error occurs and I've also attached the vi. It's ragged and klugy because it started out as a pulse height spectrometer for another card, and at this point it simply graphs the input from the new card. Eventually I want to reinstate it as a pulse height analyzer.
So any clarifications you can provide, or references where I can get more info would be an enormous help.
Thanks
Gammarays
09-07-2008 11:19 PM
Hi Gammarays,
You're performing a continuous acquisition. You might have adapted it from the Fetch Forever example. You get the error because you aren't reading the samples in the circular buffer before they are overwritten. Many scope applications acquire records with reference to a trigger. Do you in fact need the continuous acquisition or does it make more sense for your application to continuously acquire?
With regards to "playing around with the Min Sample and the Number of Samples", you should expect to see fewer problems if you set your number of samples to fetch to a higher number. Since the timeout is set to 0, if fewer samples are present than specified in "Number of Samples" they will be immediately fetched. This should correct any problems related to the acquisition. If you are still experiencing problems, it may be due to any processing you're performing on the acquired data. I'd recommend offloading the processing to another loop. I've edited the VI you attached to show how this can be done with a producer/consumer loop. Since we were seeing some issues already, I limited the size of the queue and set a timeout on the enqueue element. I also added an indicator to display whether you ever timeout (this would indicate that your processing loop is lagging behind and it can't keep up with the acquisition speed).
09-11-2008 08:42 AM
Mike
Thanks Much.
I've set your producer/consumer vi, and it seems to work nicely. Our sales rep mentioned it earlier, but I was uncertain how to do it. Over the next few days I'll see if I can't modify it into the Multichannel Analyzer I need.
Dave
09-12-2008 11:34 AM
Hi Dave,
I'm glad to hear it's working better. Another point to consider as you move forward is your acquisition rate. When performing the fetch forever implementation, you will have to consider the PCI data transfer rate. You can assume a realistic PCI transfer rate between 90-100 MB/s. Since the PCI-5122 uses 2 bytes/sample, the maximum sustainable continuous acquisition rate would be ~50 MSamples/sec. This is all assuming that the bus transfer speed is the limiting factor and not processing in your program. Good luck!