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.

High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

How to modify Pxie-5170R "Multirecord Acquisition" sample project by adding one more PXI trigger line?

Solved!
Go to solution

RequirementIndependently given two external digital triggers to the oscilloscope card, I should be able to acquire 2 analog input channels data.

                         1st PFI line trigger --> 1st channel

                         2nd PFI line trigger--> 2nd channel

         Set of parameters given to each channel also differs (like pre-trigger, post trigger samples, Vpp, no. of records etc., ).

Simultaneously, the triggered data that is acquired in DRAM need to be fetched on host side. At present I can make that sample project to work with one PFI trigger.

I am currently working  to replicate the (FPGA) code one more time with different bus instance and add one more trigger line to it. Also on host side I am trying to create and configure the respective task for it .

I want to know will it work or Is there any better way to go with.

Thank you!!

 

To look into previous discussion

http://forums.ni.com/t5/High-Speed-Digitizers/PXIe-5171R-External-Trigger-Using-NI-Scope/td-p/357412...

 

0 Kudos
Message 1 of 7
(5,568 Views)
Solution
Accepted by topic author vmanoj

What exactly do you mean by "different bus instance"?

You should not need to create two instances of the FIFO Register Bus, but you could take the approach of creating two instances of Multirecord Acquisition.  You will need to create additional DMA FIFOs in the project for the second instance of Multirecord Acquisition.

In total, the DMA FIFOs for your project should be:

reg.host instruction fifo 0

acq.status fifo 0

acq.status fifo 1

acq.fetch fifo 0

acq.fetch fifo 1

 

On the FPGA, you can drop down a new Create Resources.vi for Multirecord Acquisition, and connect a constant '1' to the instance input, along with the FIFO resources associated with acq.status fifo 1 and acq.fetch fifo 1.

( See http://zone.ni.com/reference/en-XX/help/374500A-01/oscopes/idl_mracq_fpga/ )

On the host, you will have to open an additional session to Multirecord Acquisition, and pass a constant '1' to the instance input as well.

( See http://zone.ni.com/reference/en-XX/help/374500A-01/oscopes/idl_mracq_host/ )

Also, on the FPGA, you must register the second instance of Multirecord Acquisition with the Instruction Framework using Add Subsystems.vi.

(See http://zone.ni.com/reference/en-XX/help/372614J-01/target5devicehelp/idl_instfwk_fpga/ )

 

 

Message 2 of 7
(5,533 Views)

Your suggestions really helped a lot.

Here I want to mention my doubt in the host part of the code. 

In my case I am using Multi Record Fetch(Host).vi and I want to modify it in such a way that it should run continuously by responding to trigger inputs.

My problem is>>

If we make a loop across Fetch Multiple Record.vi, then I am encountering a timeout issue. 

To explain clearly, If no trigger input is provided, in this case it will wait for that timeout value and it is will throw a timeout error.

To solve that I am clearing that error and recreating the task one more time by placing all the VIs in the for loop(except open session.vi).

There is one more problem again with this....My initial trigger given to it is used and it is giving me wrong set of data (i.e., previous set of measurement data). I am not sure whether is it because of not clearing Target side FIFO. And also this issue is go on repeating after every timeout.

 

My question is.. 1. What is the problem that is causing it?

Thanking for sparing time in this!!Smiley Happy

 

 

 

0 Kudos
Message 3 of 7
(5,519 Views)

For your timeout problem, you might want to try using Get Acquisition Status on the Multirecord Acquisition Host API.  I think you could check records done to determine if you need to call fetch to copy a new record to the host.

 

When calling fetch, you might need to specify a record number?

 

I can think of two different approaches you could take here:

You could use multiple records with the Multirecord Acquisition engine so that it advances to a new record when the previous completes, and the new record starts with each new PFI trigger.  All records would remain in DRAM on the device.  You need to be sure that enough records have been configured on the call to the Configure Acquisition host VI.

 

Or, you can use single-record acquisition, and you need to include calls to 'Abort' and 'Initiate' inside your loop.  You could call Get Acquisition Status, and if it reports that there is an available record then fetch the data, abort the acquisition, and initiate a new acquisition.

0 Kudos
Message 4 of 7
(5,515 Views)

In last reply you suggested me to create one more session on host side and to change the instance input to 1. But I am not able to find any instance to change.

 

Thank you again!!

0 Kudos
Message 5 of 7
(5,502 Views)

On the host side instances are provided by context array read vi( present in  Read HW traits vi). From that How is it possible to get the instances of Fetch and status FIFO for second instance?

I am new to OOPS concept !!

Will be helpful if u put it in many words.

0 Kudos
Message 6 of 7
(5,496 Views)

I was referring to this VI

opensession.png

 

The instance input is not required, which means if there is nothing wired to it, then it defaults to 0.

That is how the Open Session call is written in the sample project by default.

singleopeninstance0.png

 

 

You need to do this:

doubleopen.png

0 Kudos
Message 7 of 7
(5,489 Views)