High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

PXI 5124 Configure Edge Trigger

Hello

 

I'm working with 2 PXI-5124. They are currently working under Immediate trigger conditions. One of them is configured as Master and the other as slave acquiring simultaneously through the total 4 channels availables.

 

In order to optimize the amount of data that I retrieve (avoid collecting data when the signal of interest is not present), I want to make use of the trigger input. I've found more than enough the use of and Edge Trigger, since I just need to know the moment when my signal of interest starts (of course I have a separate system that detects this exact moment, the system that will provide the trigger signal).

 

After this introduction, I'd post my problem: I'm trying to configure the trigger through the command niScope_ConfigureTriggerEdge. After writing it like this:

 

niScope_ConfigureTriggerEdge( adc_session[session_index], NISCOPE_VAL_EXTERNAL, 1, NISCOPE_VAL_POSITIVE, NISCOPE_VAL_AC, 65e-6, 0)

 

I get the error:

 

Fetch error 0. Error BFFA4018 at (incomprehensible symbols). Possible Reasons: The requested data has been overwritten in memory so it is no longer available for fetching. Status Code: -200004

 

A little explanation about the parameters: adc_session is configured in previous lines and it works just well with niScope_ConfigureTriggerImmediate. I want the trigger to be external (obviously), to have around 1 volt of threshold, with a positive slope and coupled to AC (which I'm not quite sure but I reasoned that this should be right after trying NISCOPE Soft Front Panel and seeing that it worked just as I wanted). Now, about the last two parameters, I found that you should configure just one of them, so, I decided to specify that once a trigger signal is detected the digitizer should wait 65us to look for the following one (although right now, I'd be happy if I'd achive just 1 acquisition, not several).

 

Now, I don't understand why I'm getting this error. In theory, Immediate and Edge triggering should be equal, differing in the time in which they start the acquisition, right? By the way, I checked if I was configuring the Edge trigger incorrectly like this:

 

fprintf( stderr, "configuration returns %d\n", niScope_ConfigureTriggerEdge( adc_session[session_index], NISCOPE_VAL_EXTERNAL, 1, NISCOPE_VAL_POSITIVE, NISCOPE_VAL_AC, 65e-6, 0) )

 

but in the command window I get "configuration returns 0", which I think it means that the command (niScope_ConfigureTriggerEdge) is correctly written and actually configuring the trigger as edge, right?

 

Is my method right about what I'm trying to do? Should I check somewhere else concerning to this error? Most of all, why immediate trigger works but edge trigger doesn't because, as I said, to my understanding they are basically the same?

 

Thanks

 

JuanCa

0 Kudos
Message 1 of 5
(6,301 Views)

For the record, we have a successful acquisition for the first card but the error appears when it tries to switch to the second one, when he tries to fetch the data from the RAM for the second card. However, analyzing the results for the first card, it doesn't seem to pay much attention to the trigger signal :S It looks like it is randomly starting to acquire. 

0 Kudos
Message 2 of 5
(6,297 Views)

Hello Juan,

 

Are you using T-Clk to configure these cards? In that case, are you making sure to only specify the configuration of the trigger edge on the master (first) device and leave the slave to default (immediate) trigger? Also, are you doing a single acquisition or are you trying to perform a multi-record acquisition (specifying multiple records)?

 

The error you are actually getting is an overwrite error, meaning that you are sampling data faster than you can fetch it off the board, which shouldn't really have anything to do with triggering (if anything, using an external trigger rather than immediate would slow down the acquisition of data). How many samples are you acquiring in each record and how are you fetching them off (ie- are you fetching all the samples at once, how many records are you fetching at a time if multi-record, etc.)? What are you doing with the data once it gets fetched off the board? Are you placing it in some sort of queue or are you processing it before fetching again?

 

It may help to be able to see the full code for how you are configuring the digitizers, as it will shed more light on why you might potentially be getting an overwrite error.

 

Regards,

Daniel S.
National Instruments
0 Kudos
Message 3 of 5
(6,256 Views)

Hi Daniel


Thanks for your reply and excuse me for my absence these weeks. We've been doing some tests and I wanted to post something when we were sure that our methods were not working. Answering to your questions:

 

Yes, we are using T-Clk and yes, we are specifying the external trigger just for the Master.  We are reviewing what you call "records". The thing is that the code was written by one of our ex-coworkers. What we are doing now is, first understand what he did and then adapt it to what we want. He had it configured to work with the immediate trigger and we're now trying the external triggering function. So, coming back to the record thing, I am going to explain you what he does and see if that answer your question. He fetches data from RAM in packages of 33554432 samples. Afterwards, he appends this data to a previously initialized .wav file. I'm not actually sure if that is what you call "multi-record acquisition" but that is what the code is currently doing. He has indeed a couple of variable that take care of that "record" issue but we have not modified not even touched them yet to do what we've done till now. 

 

I understand that the error is overwrite-kind. But, what's the difference between immediate and external triggering once the trigger has been detected. I mean, changing immediate to edge shouldn't just affect the starting point of the acquisition? In my mind, the rest of the acquisition should behave in the same way, shouldn't it?

 

Well, continuing with your questions ... We are acquiring a total of 268434462 samples. As I said before, once the data is fetched from RAM, it's immediately appended to a .wav file so there is no intermediate processing. Once the total amount of samples is reached, all the sessions are closed and the acquisition ends. 

 

The full code is way too long to post here, but we'll prepare a shorter version wiping out non crucial functions and then we'll show you to see if you can get something from it. 

 

Thank you very much for your help. 

I'll be waiting your reply.

 

JuanCa.

0 Kudos
Message 4 of 5
(6,162 Views)



Dear all;

 

My problem is similar than you, jcrodriguez40;

 

I have  two  PXI 5124 for take an acquisition at 40 Msamples/s and I need some help. I'm not sure if it's possible to do a MultiRecord Acquisition with a triggering. I want to configure a Trigger Edge for the star trigger, and with the same signal use a reference trigger to acquire a several samples. We are going to acquire data during the trigger pulse. The period of the pulse (EXTERNAL TRIGGER) is around 70 us and always change,a little bit. I would acquire 4 total channels, 2 per PXI 5124.

 

 

 

Trigger/Synchronous signal (EXTERNAL)                   ________________________`````````_______________`````````_______________`````````________  _

Start the acquisition (Start Trigger)                             ________________________`````````````````````````````````````````````````````````````````````````````````````````````  ``

Acquisition   (only in hi-level EXTERNAL)                    ________________________`````````_______________`````````_______________`````````________  _

 

I have a Visual C++ code to acquire with an immediate trigger configuration and I'm working with Visual C++. I need to configure and program this sinchronism acquisition as soon as possible.

 

Is it possible to configure this synchronous acquisition?

Anyone can give me example code or related literature to begin this project?

 

I have read a lot of documents of NISCOPE functions and I understand the configuration parameters of the trigger but I need to know how to build this complex configuration and programming this acquisition ( wich configuration functions have to define, witch mechanism to make a test,etc..)

 

Thanks so much.

 

Best regards

0 Kudos
Message 5 of 5
(6,011 Views)