PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

RFSG trigger

I tried using the RFSG CVI example for Start Trigger Hardware Source. When running on a PXI-5673, the pulses keep going forerver even if the trigger is no longer there (Hardware trigger is removed).

 

I'm trying to do something similar and it would be great to have an example that is syncrhonized with an external hardware tigger.

 

Also, how can a delay be added in between pulses, so when a trigger is received there is a delay, then some pulses sent, then stops until another trigger happens (and this sequence repeats).

 

Thanks

0 Kudos
Message 1 of 10
(7,309 Views)

Hi Deco2014!

 

The reason why you continue generating after the first trigger pulse is that this example uses a start trigger. This means that as soon as you detect a digital edge, your RFSG will start generating. 

 

What you are describing sounds a little more like retriggerable finite generation. This means that every time you get a trigger, you will generate a certain amount of samples. If this is what you are trying to do, I would look at the example called RFSG Finite Generation-Re-Triggered. 

 

Let me know whether or not this helps!

0 Kudos
Message 2 of 10
(7,288 Views)

Hi Leah,

 

Thanks for your reply and for the clarification. I found the RFSG Finite Generation-Re-Triggered example in Labview but could you please point me to the CVI (C) example ? or the .NET equivalent example?

 

Thanks for your help!

 

Deco

0 Kudos
Message 3 of 10
(7,283 Views)

Hi Deco,

 

I'm glad this was helpful! I have been poking around and trying to find a CVI or .NET equivalent to the LabVIEW example, but I'm not having much luck, either with the shipping examples or on the NI community.

 

However, I think that a good starting place to look is the script trigger-Hardware source, since you can set up a finite retriggerable generation using scripting. Just keep in mind that you will want to use a script that generates a triggered finite generation. Here is a document outlining some common scripting use cases: http://zone.ni.com/reference/en-XX/help/371025K-01/rfsg/scripting_use_cases/

 

In the LabVIEW example, they use the following script:

 

script triggerFiniteGeneration
        repeat forever
              repeat until scriptTrigger0
                      generate allZeroes
              end repeat
                      generate triggeredWaveform
              end repeat
end script

 

In this case the script tells the device to output a tone during the wait command. In order to see the effects of the trigger, it will generate a minimum sized waveform of all zeroes

until the trigger recieved. The default script indicates to generate the waveform once (since there is not a "repeat" clause around the "generate" statement). So that every time it receives a trigger, it will generate the triggeredWaveform.

 

Keep in mind that triggeredWaveform is defined using the Write Waveform function

 

Hopefully this helps point you in the right direction!

 

 

0 Kudos
Message 4 of 10
(7,275 Views)

Hi Leah,

 

Thanks for the information. I will take a look at the script option. Do you know of a way to add a delay after the trigger ? For instance I want to add a delay of 100 us between the trigger and the generation of the waveform. Is there anything in the script that can be added to accomplish this? or an ivi or rfsg API ? A minimum sized waveform of all zeroes could be generated but that may not be our preferred solution.

 

Could you please advice?

 

Thanks,

 

Deco

0 Kudos
Message 5 of 10
(7,265 Views)

Hi Deco,

 

I believe that the only way to implement a trigger delay for RFSG is using scripting by using the 'wait' function. Once again, I found a LV example that does this, but not a CVI example, but this could easily be implemented in CVI. 

 

The script they used in this example is:

 

script triggerDelayExample
      repeat forever
              wait until scriptTrigger0
              wait %samples%
              generate signalWaveform
      end repeat
end script

 

Trigger delay resolution is dependent on the 'Actual IQ Rate' of the PXI-567x and the Waveform Quantum (see help). For PXI-5671s with an Actual IQ Rate<= 8.333 MS/sec, the Waveform Quantum is 2. For PXI-5671s with an IQ Rate> 8.333 MS/sec and PXI-5670s (always), the Waveform Quantum is 4.


Waveform Quantum * (1/Actual IQ Rate) = Trigger Delay resolution (s).

 

Let me know whether this helps!

 

Leah

0 Kudos
Message 6 of 10
(7,254 Views)

Hi Leah,

 

Thanks for your help. Getting closer. What would %samples% be ? I added int32 samples = 500 to my code but script did not work (did not recognize samples). Could you clarify how %samples% is meant to be used.

 

Thanks,


Deco

0 Kudos
Message 7 of 10
(7,249 Views)

Hi Deco,

 

More detailed scripting instructions are included in the RFSG help file under programming>>Scripting instructions. Take a look there, and let me know whether or not you are able to find what you are looking for. I think that this page might be helpful. 

 

rfsg scripting.PNG

 

0 Kudos
Message 8 of 10
(7,247 Views)

Hi Lea,

 

May I just ask if the waveform generated by the script triggered finite generation is coherent. thanks

0 Kudos
Message 9 of 10
(7,047 Views)

Hello Azra26,

Can you elaborate on what you mean by coherent?

Wan L
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 10 of 10
(6,996 Views)