Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting pfi trigger edge in Labiew

Hello, 

 

I am using a 5672 vector signal generator for my project. I want to start generating a signal for a specified amount of time when a pfi trigger edge occurs. There some examples

on how to synchronize signal generation with a hardware trigger, for example  Fgen Trigger.vi or RFSG Start Trigger - Hardare Source.vi, which is directly applicable to the 5672 generator. 

What I couldn't figure out is how to generate a signal for a specified amount of time and then abort. To start a timer, I have to detect an edge on the pfi input. How is that done in Labview?

 

 

0 Kudos
Message 1 of 8
(6,104 Views)

Hello,

 

Could you give a few more details about your application? Based on what you described, seems like the best method would be to just define a finite waveform that of a certain length and thus amount of time before the program runs and the trigger is received.

 

Please let me know if this helps or not. Thanks!

 

 

Cameron T
Applications Engineer
National Instruments
0 Kudos
Message 2 of 8
(6,088 Views)

Hi Cameron, 

 

There is an example called RFSG Finite Generation - Re-Triggered.vi . I think it presents something similar to what you are referring to. This doesn't work well for me because I have a relatively short sequence that keeps repeating many times. 

 

I'll describe first the initial version of my application before the trigger requirement. That could help clarify things. It's quite simple. I set up the PXIe - 5672 generator for arbitrary waveform generation and then write samples into the memory. I start generating the waveform using niRFSG Initiate.vi. A timer follows after that. It counts a certain number of miliseconds. When the timer is done, I stop the generation using niRFSG Abort.vi. This worked well. 

 

Now, I have to start generating when an edge occurs on PFI 0. The trigger signal I am working with is not very fast. In fact, it is the GPS one pulse per second signal. I set up the trigger using niRFSG Configure Start Trigger Digital Edge.vi and that works. I can see on a scope that the waveform is synchronized with a trigger edge. The delay is quite high - the waveform starts about 4 miliseconds after a trigger edge, but that is another issue I have to deal with later. The main problem for me now is that the timer doesn't do the job any more. With the trigger involved, the generation does not start immediately after niRFGS Initiate.vi.  It starts only when a trigger edge occurs. I don't know when that happens so I don't know when to start the timer. What I am wondering about is whether there is a way to detect a trigger edge on PFI 0 in Labview. That would tell me when to start the timer. It wouldn't have to be very accurate. I am only working with miliseconds resolution. 

 

Regards,

Ivan

 

0 Kudos
Message 3 of 8
(6,083 Views)

Does the duration period of generation change between runs? If the duration of generation does not change then please look at the RFSG Finite Generation - Re-Triggered.vi in the Example Finder. This can be found in the Example Finder (Help -> Find Examples) and by navigating to Hardware Input and Output -> Modular Instruments -> NI-RFSG -> Scripts. If you know the duration (T) and sample rate (SR) beforehand, then you can easily upload a waveform of the correct number of samples (N) such that N = T*SR. The number of samples uploaded may be subject to a minimum waveform quantum but the results would be more reliable than using software timing.

 

Product Support Engineer
National Instruments
0 Kudos
Message 4 of 8
(6,070 Views)

I saw the RFSG Finite Generation - Re-Triggered.vi example, I actually mentioned it in my previous message. The duration of signal generation changes between runs and I wouldn't want to go down that path for other reasons, unless I really had to. I don't need a great timing accuracy at this stage. I would be happy with a milisecond accuracy, which I should be able to get in Labview running on Windows. So I am still trying to find out how I can start a timer when an edge on PFI 0 occurs. I noticed a block called niRFSG Export Signal. I think I can use this to connect the PFI 0 input to one of the PXI trigger lines. What I don't know is whether I can monitor a PXI trigger line on an embedded PXI controller running Windows. I know it can be easily done on some targets. I have done it before on an FPGA target, but I am not sure about Windows. I am searching through the forum and I still haven't found a conclusive answer. 

0 Kudos
Message 5 of 8
(6,057 Views)

Hello,

 

Unfortunately, you will not be able to monitor the PXI Trigger Bus using the PXI controller. In addition to this, the NI RFSG driver does not allow you to register events in LabVIEW for events such as trigger edges. This means that you will not be able to know exactly when the trigger pulse comes in on the PFI line. 

 

However, there are two alternatives that you could pursue. The first would be to just define the length in time that the waveform will take. The other alternative would be to use a Timing and Synchronization card such as the PXI-6683 to register a time stamp in LabVIEW when it recieves a trigger. You would also set up card so that it would pass the trigger coming in on the front panel directly to the PXI Trigger Bus, which would allow you to trigger your VSG. As the Timing and Sync card would provide a time stamp and pass the trigger along the backplane, you would be able to start a timer based on the inital time stamp value. Although this is certainly a viable solution, you will need to procure a PXI-6683 if you do not already have one.

 

Regards,

Cameron T
Applications Engineer
National Instruments
0 Kudos
Message 6 of 8
(6,037 Views)

Thanks Cameron, your answer clearly outlined what are the available options. I've worked with a timing card before but I don't have one for this project so it looks like I'll have to change my approach and set the generation time based on the number of samples in the waveform. Is it possible to program the 5672 rf generator to repeat the same waveform for a certain number of times so that instead of T (generation time) = N (number of samples) * S (sample time) I can have T = M*N*S where M is some integer? 

0 Kudos
Message 7 of 8
(6,030 Views)

Hello,

 

I think the best way to accomplish what you are trying to do would be to utalize scripting. Using a script that is loaded to your Arb, you can specify that a named waveform repeat N number of times. Provided you know how the number of samples in your waveform corresponds to a certain amount of time, you can use the N numer of repeats to define the time that the signal is generated after the trigger is received.

 

I am including a resource below that discusses different scripting use cases. 

http://zone.ni.com/reference/en-XX/help/371025M-01/rfsg/scripting_use_cases/

 

You could write something like this in a script:

 

script YourScript
    wait until scripttrigger0

    repeat N
         generate wfm01
    end repeat
end script

 

I hope this helps.

 

Regards,

Cameron T
Applications Engineer
National Instruments
0 Kudos
Message 8 of 8
(6,015 Views)