02-14-2014 09:52 PM
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
02-17-2014 12:31 PM
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!
02-17-2014 05:45 PM
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
02-18-2014 09:29 AM
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!
02-18-2014 05:29 PM
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
02-19-2014 10:16 AM
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
02-19-2014 01:58 PM
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
02-19-2014 02:11 PM
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.
04-20-2014 09:04 PM
Hi Lea,
May I just ask if the waveform generated by the script triggered finite generation is coherent. thanks
04-28-2014 08:18 PM
Hello Azra26,
Can you elaborate on what you mean by coherent?