Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use the pulse train from a 6602 to trigger an niFGEN and niSCOPE on each rising edge of the pulse train?

Hello,

Here is my application: I need to use a 6602 counter/timer to generate a pulse train of certain frequency and duty cycle. On each rising edge of this pulse train, I need to output an arbitrary waveform on Ch. 0 of an niFGEN (5422) AND acquire data from CH. 0 of an niSCOPE (5124). I also need to synchronize the niFGEN and the niSCOPE to the same clock used for the pulse train (6602/ctr0). This process needs to continue until the user stops the system.

I can generate the pulse train using the 6602 just fine using ctr0, but the pulse train shows up on OUT0 by default. When setting up the niFGEN and niSCOPE to trigger on rising/positive slope edge, OUT0 is not an option for either device as a source for the digital rising edge (pulse train). The main options for both are PFI0-3 and RTSI lines.

Questions:
1.) Is there a way that I can direct the pulse train to a location (such as an RTSI line) where BOTH the niFGEN and the niSCOPE can use it as a start trigger for each rising edge? I noticed in MAX that a route can be made between ctr0's internal output and a trigger line and others. If this is a solution, could you please explain how to accomplish this?

2.) Once I configure the niFGEN and niSCOPE to be triggered on a digital rising edge, how can I effectively have this happen for every rising edge from the pulse train? In other words, can I just initiate the FGEN outside of the while loop and it will generate a waveform for each rising edge it sees at the source until the while loop is exitted?

3.) Is setting a reference clock for the niFGEN and the niSCOPE the same thing as synchronizing both devices using the same clock that generated the pulse train? It is not clear to me the difference, and why it would necessarily be useful.

Images of my current front panel and block diagram are attached. If you would rather have the actual VI's just let me know. Any help and/or explanation on this is greatly appreciated. Thanks in advance.
Download All
0 Kudos
Message 1 of 7
(4,159 Views)
I found out that using the DAQmx Connect Terminal.vi  that I was able to connect PFI36 (default OUT terminal for ctr0 of the 6602) to PXI_Trigger_0.

Is PXI_Trigger_0 the same terminal as RTSI0? Thanks.
0 Kudos
Message 2 of 7
(4,145 Views)

Hello Cgifford,

 

Welcome to National Instruments Forums.

To output your signal to the PFI lines, you can use external connectios between OUT0 and PFI lines. You can also use the backplane to do so by routing into the same RTSI line.

1)

On the SCOPE and FGEN, the name of the terminals are actually “PXI Trigger Line x/RTSIx” but on the 6602 you might need to route the signal using the property:

 

You can also use the DAQmx route signal which perform the same opperation.

2)

This will depend on the frequency of your pulse train. If this is lower than about 10 ms, then you can probably place this on a loop and start and stop the acquisition every time. If the frequency is higher than this, you will have to use:

-       Scripting on the FGEN side (read more)

-       MultiRecord Fetch (more information in the scope help file section “Acquisition Functions Reading versus Fetching”).

 


3)

The short answer is yes. The longer one might depend on how tight you need the synchronization to be (us, ns, ps). For very tight synchronization, you should look into here.

Message Edited by Yardov on 06-18-2007 03:14 PM

Gerardo O.
RF SW Engineering R&D
National Instruments
0 Kudos
Message 3 of 7
(4,143 Views)
Thank you for your reply, Yardov.

I have my described problem working, except the sawtooth waveform I want to produce once per trigger (stepped triggering of an arbitrary waveform) is not outputting correctly. Rather than generating a full sawtooth, it is generating the last half of a sawtooth followed by the first half of the next one.

I know this is the wrong forum (I am using an niFGEN 5422 to generate the sawtooth waveform), but I need fast help on this problem. Is there a way to shift the phase of the sawtooth waveform so that I get a full sawtooth rather than having the transition from high to low in the middle of the waveform?

Any help on this is greatly appreciated. Thank you for your comments.
0 Kudos
Message 4 of 7
(4,139 Views)
Update: The default sawtooth waveform was 180 out of phase from what I needed. So I used a function generator to achieve the result I needed. Thanks.
Message 5 of 7
(4,129 Views)
Hi Cgifford,

Just for the records here is the thread you started on the other forums.
I do think that your trigger its being received late for some reason. Looks like you solve it already but I would try to look at those triggers in a scope to make sure they are on time.

Best and thanks for sharing the solution,
Gerardo O.
RF SW Engineering R&D
National Instruments
0 Kudos
Message 6 of 7
(4,095 Views)
It appears that I originally forgot to tell the niScope to fetch relative to the Trigger. This was causing my delay. Adding this fixed everything, and now the triggers (and devices) are synched up just fine. Thanks again for your time and help, it is greatly appreciated.

Chris G.
0 Kudos
Message 7 of 7
(4,091 Views)