LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Reference trigger in a for loop

I am using NI PXI and RFSA library. My question is:

 

Are there any examples of how to use reference trigger in a for loop?

 

I want my application to make several measurements during a certain period of time ( 1 second). These measurements are triggered when the input signal  reaches desired value. After a short measuring session I want my app to stop fetching samples from RFSA and wait for another trigger to begin the session again. All is done in a for loop.

 

Should I stop the session using Abort.vi every time I want to wait for another trigger? I mananged to make my app work only using such chain of VI's:

 

RFSA config -> niRFSA Configure Trigger -> niRFSA Initiate-> niRFSA Fetch IQ -> niRFSA Abort  -|->  niRFSA Initiate ... and again fetch and abort

 

I think thats not the correct way to do that, however thats all I managed to create using examples in LabVIEW. I appreciate any kind of help.

0 Kudos
Message 1 of 5
(3,017 Views)

Dear Przemysł,

 

welcome to NI Forums! I believe what you are looking for is a multi-record acquisition, which is meant exactly for capturing events/triggers that happen close to one another. You'll find a god example to get you started in Find Examples... > HW Input and Output > Modular Instruments > RFSA > Getting Started, or check out the function documentation here

 

Kind regards:

Andrew Valko
National Instruments Hungary
0 Kudos
Message 2 of 5
(2,971 Views)

ValkoA, thank you very much for fast response.

 

I am already using the niRFSA Configure Number of Records VI. It is set to 3000 samples. What I'm trying to accomplish here is to have a VI that:

 

1. Waits for a trigger ( when IQ power reaches certain level).

2. Reads 3000 samples from the RFSA buffer (I am doing this by using the mentioned niRFSA Configure Number of Records VI and of course the Fetch IQ VI.)

3. Waits for next trigger to appear.

4. Reads again 3000 samples and so on...

 

This is done in a while loop. The problem is that the trigger activates the fetching only at first iteration. If I want to fetch again I have to use the abort VI to stop the acquisition. Then the configure trigger again and initialize again. It looks something like this:

 

loopedTrigger.png

 

  Please elnight me, couse I feel that I'm missing something very basic here 🙂

 

Br

0 Kudos
Message 3 of 5
(2,894 Views)

Ok, once again in a simpler form.

 

I am using niRFSA Configure IQ Power Edge Ref Trigger.  niRFSA Configure Number of Records VI is set to 3000 samples.

My app acquires the IQ data from RFSA. The process goes like this: 
1. Wait for the trigger.
2. Trigger occured, read 3000 samples from RFSA buffer (FetchIQ).
3. Back to step 1.

 

Everything works fine, but something bothers me. In order to have the measurement triggered again I have to stop the measuring session by using the Abort vi. If I don't use Abort, the FetchIQ does not returny any data at all in the next iteration. So the process look actually like this:

1. niRFSA Configure Trigger
2. niRFSA Initiate
3. niRFSA Fetch IQ
4. niRFSA Abort
5. return to step 2.

 

I think it does not make any sense. By aborting the session I'm creating a possilibity that I'll lose some of the signal, before the session is Initiated again.

Is there a better way to perform such measurements?

Best regards

Przemysł

0 Kudos
Message 4 of 5
(2,856 Views)

Is there a better way to perform such measurements?

 

Yes,  configure the device to acquire multiple records using "niRFSA Configure Number of Records.vi"  set  "infinate records" true and records will just keep coming untill the task is aborted.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 5
(2,842 Views)