12-13-2012 01:53 AM
Hi,
I have a PXI system with a PXI-5124 scope. I've been trying to make a program to capture data from the scope as fast as possible. I have 2 channels of data I want to retrieve, triggered externally.
I've been looking through all the examples I can find, and most of the streaming data examples use a Software Trigger. For some reason, when I switch to an external trigger, the programs don't always work. Specifically, it seems that the Fetch Backlog and Points Done properties do not change inside my While loop that is attempting read the data. If I stop and restart the program, these values may be different than they were on the previous run, but they again do not change so long as the While loops keeps cranking away. If I switch back to a software trigger, these values change and behave as you might expect.
Another problem is that when I do get a criteria for doing a Multi Fetch Binary 16, chosen by traking Records Done and calculating how many samples should be in scope memory myself, I get an error saying that there is not enough memory. Given the records that are done with the actual record lengths desired, I should only be fetching 8 MB total (4 MB per channel). There doesn't seem to be any other information about why this error is occuring.
Anybody out there have any ideas? I can post my actual code tomorrow while at work; just trying to do some research on this tonight. It seems like there should be a simple solution that I am missing, which is why I thought posting a general question might lead somewhere.
Thanks.
12-13-2012 10:09 AM
Hi again,
Another aspect of this problem I thought of...should I try to time my fetches based on number of samples or number of records?
All of the streaming examples that use a software trigger and declare the number of samples to fetch each time don't care about a reference trigger as I do. Conversely, the length of my record doesn't always add up to some multiple of the memory in order to allow for a smooth and fast fetch of multiple records.
Is there a way to set a software trigger, as is done in examples, but then stream data relative to a separate external trigger?
Thanks again.
12-13-2012 06:51 PM
Hello armetca,
Posting your code would be very helpful.
What is the external trigger for? Start trigger or reference?
The reason the streaming examples are setting up a software reference trigger is because the reference trigger is to determine record length. With continuous acquisition (and the examples you're looking at) they configure the software ref trigger but never call it and just continually fetch, that way there isn't multiple records.
This example explains that concept a little bit: http://zone.ni.com/devzone/cda/epd/p/id/5273
If you want to use an external reference trigger, then you might try looking at the Multi Record Detch More Than Available Memory.vi example.
This state chart is awesome, hopefully it clears up what a reference trigger does.
http://zone.ni.com/reference/en-XX/help/370592N-01/digitizers/5122_state_model/
Thanks,
Joel C
National Instruments