From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems in triggering another card

Hi all,
 
I have both PXI-5922(Dev1) and PXI-6120(Dev2) inside the same chasis. My objective is to let PXI-6120 to trigger itself and also two channels of PXI-5922 simulataneously. I have used Edge trigger for the PXI-6120 and then transfer the trigger signal to PXI-5922 using the DAQ-MX Export signal Vi. I have assigned my ouput terminal to be: Dev2/PXI_Trig0 and that the trigger source for the PXI-5922 to be : RTSI 0. See attached vi. for details. Can I check if this is the correct way to do the triggering for my intended purpose?
 
Assuming my vi is correct, I have tried to input the same wave from the wave generator to the two cards. I have kept the sample rate and the no. of samples of the two cards to be the same also; hence i should be getting the same graph plotted for both cards. However when my sample rate for both cards are 1e4S/s, the 2 graphs give me totally different plots. (See Slide1 of ppt) Can anyone help me with this?  
 
The 2 graphs are identical only when I choose my sample rates to be1e5S/s. But another problem which surfaced is the serious delay in triggering. I have actually compared the first data points captured by both cards to determine the delay. There always seems  to be a delay and that the delay seems to be longer when I decrease the frequency of the input wave. (Slide2 - 1kHz input wave;Slide3- 500Hz input wave;Slide4 - 1Hz input wave). Why is there a dependence on the input frequency?
 
Thanks.
 
Regards,
lfw 
Download All
0 Kudos
Message 1 of 8
(2,946 Views)

Hello lfw,

There are a number of considerations when performing triggering and timing operations using PXI modules. If you want to confirm the proper procedure for implementing these functions you can view a document that discusses using PXI timing and triggering functionality here. Additionally, for tighter synchronization, I would recommend that you share the sample clock, as well as the trigger pulse, between the devices. This process is described in the document previously referenced, but it would allow you to ensure that your samples were occurring on the same time-base as well as at the same rate. You may need to add an niScope Configure Clock.vi to your block diagram, but it should provide better synchronization between devices.


I also wanted to follow up on some of the information you had posted in the attached documents. In the first slide of your PowerPoint presentation, where the two signals appear to be different, what is the frequency of your input signal? That is to say, which of the data appears to be correct? The PXI-6120 on top or the PXI-5922 below?


I hope this information is helpful. Let me know if there is anything else I can do.



Matt Anderson

Hardware Services Marketing Manager
National Instruments
Message 2 of 8
(2,919 Views)

Hi Matt,

Regarding your qns, the input wave is 1khz and the graph for the PXi-6120 is correct, the graph above is correct. I will try to see what I can improve on your suggestions. Thanks for the help.

Regards,

lfw

0 Kudos
Message 3 of 8
(2,915 Views)
Hello lfw,

I was examining your application and I had a few more questions I wanted to ask you about. It occurs to me that your PXI-5922 may not be triggering as you expect; if the digitizer is triggering independently from the S-Series device it may cause the signals from the two devices to appear different. This could account for the behavior seen in slides 2-4 of your presentation. To test this behavior, I would suggest that you remove the part of your code that exports the trigger on the RTSI lines and view the plots again. If the plots are the same, then we can say with some confidence that this behavior is being caused by incorrect triggering. If the PXI-5922 times out, then we'll know that the triggering is working and there is some other problem.

I would also suggest that you check on the actual sample rate for the PXI-5922. You have specificed the "min sample rate" in niScope Configure Horizontal Timing.vi, but that does not guaruntee that the device will sample at that rate. Rather, it means that the digitizer will sample at least that rate. To determine the actual sample rate you can use the Actual Sample Rate property from the niScope pallet. I have attached a screen shot which shows how you could include this in your existing VI. I hope this is helpful. Let me know if there is anything else I can do.



Matt Anderson

Hardware Services Marketing Manager
National Instruments
Message 4 of 8
(2,891 Views)

Hi Matt,

I have removed the export trigger vi from the code and the Scope is not triggered; hence i think that the triggering is working. And also, i discovered that the minimum sample rate for NI-5922 is 50KS/s. This may be the reason why there is a difference in the graphs plotted when i used a sample rate of 10Ks/s.

However I am still having trouble getting both the cards to be sychronised.  The main reason is that one card is using NI DAQ-mx and the other is using NI-Scope. I have trouble telling them to share the sample clock. The samples and documents which i found only described cases where both cards are using DAQ-mx. Can you advise me on the matter?

Regards,

lfw

0 Kudos
Message 5 of 8
(2,876 Views)
Hello lfw,

I was reviewing your code and I think I may have found a reason for the behavior you are seeing. If you look at the niScope Configure Horizontal Timing.vi in your Block Diagram, you will notice that there is a reference position input. The Context Help gives the following information about this input:

"reference position specifies the position of the Reference Event in the waveform record as a percentage of the record.

Default Value: 50%"

In your diagram, you have left this input unwired. Therefore, the VI will use the default value of 50% and will use the trigger from the PXI-6120 as the reference event. I believe this is causing the waveforms you demonstrated in your post. I have attached a screen shot of some code that should change this behavior. By changing the reference position to 0, the trigger should occur at the beginning of the waveform. You'll notice I have also set a value for the trigger slope input on niScope Configure Digital Trigger.vi. I have placed a constant "Positive" at this input because I wanted to be sure the trigger was occurring on the positive edge. I would recommend that you implement these changes and examine the behavior of your code then. Let me know how this works out for you.


Matt Anderson

Hardware Services Marketing Manager
National Instruments
0 Kudos
Message 6 of 8
(2,853 Views)

Hi Matt,

the reference position seems to be the problem. Thanks for the advice. However what exactly does the reference position means? So can i assume that the 2 cards are synchronised?

Thanks.

Regards,

Feiwen

0 Kudos
Message 7 of 8
(2,849 Views)
Hello Feiwen,

I don't know if I adequately explained why you were seeing the behavior you described, so let me try to clarify here. You can think of the PXI-5922 as a bench-top oscilloscope in this case. On most oscilloscopes, the trigger is configured so that the trigger event occurs in the middle of the screen. Normally this is adjustable, but for the most part you would want to view the start of your waveform in this manner. If you compare the waveforms you submitted you will notice that the middle of the bottom waveform (from the PXI-5922) should line up with the left-most sample of the top waveform (from the PXI-6120). The bottom waveform would be similar to viewing the incoming signal on a benchtop oscilloscope. If this is still unclear, you can reference a document that discusses pre-trigger and post-trigger samples with the NI-Scope driver here. Let me know if you have any more questions.


Matt Anderson

Hardware Services Marketing Manager
National Instruments
0 Kudos
Message 8 of 8
(2,844 Views)