Switch Hardware and Software

cancel
Showing results for 
Search instead for 
Did you mean: 

How to synchronize the AI start and the Scan List Trigger (DAQmx Switch)

Solved!
Go to solution

Hello, 

 

I want to measure N samples at the AI0 of the NI-PXI 4461 board. The measurement starts on a rising edge of a digital trigger supplied to the PFI0 of the same board. The measurement is configured to have N/2 pretrigged samples. Up to that point everything is under control...

 

Using a NI-PXI 2567 board, the signal applied to the input (AI0) of the 4461 is switched between one signal V1 and one signal V2. I would like to synchronize the switch between the two signals with the trigger signal applied to the PFI0 input of the 4461 board. In such a way to get N/2 samples of V1 and N/2 samples of V2. The synchronisation of 1 to 5 ms would be enough!

 

My question is how to synchronize the start of the pretrigged AI acquisition of the 4461 with the switch command given by the 2567 board ?

 

I thank you in advance for your help...

 

P.S: the configuration of the system is:

- LabView 8.5

- PXI-1044 chassis

- PXI-4461 on slot 2

- PXI-2567 on slot 4

0 Kudos
Message 1 of 6
(10,039 Views)

Hi Ov_metas,

 

The NI PXI-2567 can switch between V1 and V2 upon receiving a trigger.  Configure a scan list for hardware-timed switching (without software delay).  The first scan list entry connects V1.  The second entry disconnects V1 (by default) and connects V2.  Initiating the scan connects V1, so only one trigger is required.

 

Option 1 

I believe if you have an AI task for the NI PXI-4461, then you can set the Ref trigger = PFI0 and use the export signal VI to export the Ref trigger to the PXI backplane (e.g. PXITrig0).  Program PXITrig0 to be the NI PXI-2567's input trigger.  Start the AI task, wait enough time for the pretrigger samples to be acquired, and send the trigger on PFI0.  The NI PXI-4461 should begin acquiring post-trigger samples at roughly the same time as the NI PXI-2567 switches between V1 and V2.

 

Option 2

Instead of PFI0, you can input the trigger to the NI PXI-2567's front panel.  In the same manner as Option 1, export the input trigger to the PXI backplane (PXITrig0).  Program PXITrig0 to be the NI PXI-4461's Ref trigger.

 

Option 3

Use another PXI module (such as a Synchronization and Timing board) to accept the incoming trigger and export it to the PXI backplane.  Program PXITrig0 to be both the NI PXI-4461's Ref trigger and NI PXI-2567's input trigger.

 

Hope this helps!

 

Chad Erickson

Switch Product Support Engineer

NI - USA

Message Edited by Chad PSE on 01-26-2009 01:38 PM
0 Kudos
Message 2 of 6
(10,015 Views)

Hi Chad,

 

Thanks for your message. The Option 1 is what I am trying to do with no success! Please find the vi I am using in attachment.

I am applying a 50 Hz sinwave to V1 and a short to V2 and the problem is that the measured signal is only V1 whatever the pretrigger parameter I am using!??

Do you have any idea about what is wrong in my vi?

 

Thanks,

 

Frédéric

0 Kudos
Message 3 of 6
(10,002 Views)

Hi Chad,

 

The vi I posted yesterday has many of errors, so forget it. 

The new vi in attachment is a corrected version and should work correctly.

However, I do not obtain what I am expecting.  

Indeed, I am trying to do the following:

- The AI task of the PXI-4461 board is configured to acquire Ns samples with Np pretrigger samples.

- The reference digital edge comes from the PFI0 input of the PXI-4461.

- The reference trigger is exported to the PXI_Trig0 line on the backplane.

- The PXI_Trig0 signal is then used as the source for the advance trigger of the PXI-2567 board.

- The AdvCmplEvent signal (just after the switch has been activated) is exported to the TrigOut of the PXI-2567 board. 

 

What I am observing is the following:

- I am acquiring Ns=2000 samples at a sampling frequency of 20 kHz (measuring time = 100 ms). The pretrigger samples being Np=1000.

- Using an oscilloscope, I am monitoring both signals, PFI0 of the PXI-4461 board and TrigOut of the PXI-2567 board.

- Both signals should appear approximately at the same time (except a small delay for the switch).

- As shown on the pdf file, the delay is not small. It is about 53 ms!?

- I changed the pretrigger samples Np to 1990 and the delay between the two pulses decrease to about 3.3 ms!

- I changed the pretrigger sample Np to 10 and the delay increased to about 103 ms! 

 

It seems to me that the trigger signal send to the PXI_Trig0 by the PXI-4461 board corresponds to the end of the AI acquisition and NOT to the transition time between the pre-trigged and post-trigged samples!?

  

What am I doing wrong?

 

Best regards,

 

Frédéric

 
Message Edited by Ov_metas on 01-28-2009 09:13 AM
Download All
0 Kudos
Message 4 of 6
(9,976 Views)
Solution
Accepted by topic author Ov_metas

Hi Frederic,

 

I came back to this recently and used the following examples to execute the desired synchronization.

 

PXI-4461: Acq&Graph Voltage-Int Clk-Dig Start&Ref.vi

Samples per Channel = 1000

Rate (Hz) = 10000.00

Start Trigger Source = /[DAQmx Device Name]/PXI_Trig0

Start Edge = Falling

Reference Trigger Source = /DAQmx Device Name]/PXI_Trig0

Reference Edge = Falling

Pre-Trigger Samples = Variable (100, 500, 900)

 

PXI-2567: Switch Scaning-SW Trigger.vi

Advance Complete Output Terminal = /[DAQmx Device Name]/PXI_Trig0

Scan List = /[DAQmx Device Name]/ch0->com0;

Scan List = /[DAQmx Device Name]/ch1->com1;

 

Hardware Configuration:

The PXI-2567 controls an external relay that switches between voltages of 5 V on ch0 and 0 V on ch1.

The PXI-4461 connects to the COM of the external relay and therefore reads 5 V when ch0 is connected; 0 V when ch1 is connected.

 

Procedure: The aforementioned examples are used in the following procedure.

1. Run PXI-4461 VI.  A start trigger (falling edge) is required to begin the acquisition of pre-trigger samples.

2. Run PXI-2567 VI.  When ch0 is initially (and immediately) connected to com0, a trigger is sent on PXI_Trig0.  The PXI-4461 will begin acquiring pre-trigger samples.

3. Button-click "Next Connection" on the PXI-2567 VI's front panel.  This sends a software input trigger to the PXI-2567 and transitions the scan list to ch1->com1.  Once the PXI-2567 has settled (debounced), an advanced complete trigger is sent on PXI_Trig0 to the PXI-4461.  The PXI-4461 will begin acquiring post-trigger samples.

 

Note: Instead of the software input trigger, an external input trigger can be used (i.e. PXI_Trig1).

 

 

Results:

>> Pre-Trigger Samples = 100

 

Delay is caused by external relay actuation time. 

 

100.JPG

 

>> Pre-Trigger Samples = 500

 

Delay is caused by external relay actuation time. 

 

500.JPG

 

>> Pre-Trigger Samples = 900

 

Delay is caused by external relay actuation time. 

 

900.JPG

 

I hope the attached VIs and the above explanation assists you and/or other customers that have this issue.

 

Best regards,

 

Chad Erickson

Switch Product Support Engineer

NI - USA

Message Edited by Chad PSE on 10-06-2009 05:26 PM
0 Kudos
Message 5 of 6
(9,322 Views)

Dear Chad,

 

I want back to my "old" problem through your solution. I thank you a lot because it is now working!

 

Best regards,

 

Frédéric

0 Kudos
Message 6 of 6
(7,919 Views)