Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Pre-trigger data from two AI using Daqmx

I am trying to acquire pre and post trigger data from two analog inputs of a PCI-6251 DAQ board using DAQmx.  I have read some discussion on how this is possible with one analog input but errors occur when trying to collect data in this fashion from multiple analog inputs.  Is there any good way to get around this issue?  Any advice would be greatly appreciated.  Thank you in advance for any responses.
 
Stuart
0 Kudos
Message 1 of 10
(4,888 Views)
Hello Stuart,

Reference triggering works on the PCI-6251 with multiple channels to acquire pre and post trigger samples.  You have to keep all of the analog input channels in one DAQmx task and they will all share the same reference trigger.  There is a shipping example in LabVIEW that does reference triggering and can be configured for multiple channels.  It's called Acq&Graph Voltage-Int Clk-Dig Ref VI and can be opened through the Example Finder in LabVIEW under Tools >> Example Finder.  To configure the VI to read multiple channels use the string format: DevX/aiY:Z where X is the device number, Y is the channel to start scanning and Z is the channel to end scanning in the Physical Channel control.

Other good resources are Answers to Frequently Asked Questions about NI-DAQmx and Traditional NI-DAQ (Legacy) and Learn 10 Functions in NI-DAQmx and Solve 80% of Data Acquisition Applications

Let us know if you are still having trouble and we'll be glad to help you out.

Regards,
Micaela N
National Instruments
0 Kudos
Message 2 of 10
(4,866 Views)

Micaela,

Thank you for your response.  The solution was to simply paralell wire the pressure sensor output to AI0 and to the APFI input.  The main problem I was having was determining the proper pin assignment for the APFI input on my SCB-68 terminal board.  I was able to figure it out with some help from National Instruments Tech Support (Thanks, Josh!) by looking at the acual pinout of the 6251 board.  It turned out to be terminal 10 which was labeled something totally different on the SCB-68 reference label (AO Ext Ref I believe).  Anyway, now the system does exactly what I wanted.  Thanks again for your response.

 

Stuart   

 

0 Kudos
Message 3 of 10
(4,860 Views)

hello stauart,

I am new to use PCI-6251. I am having the problem as you had before. you give soluation as follow:

"The solution was to simply paralell wire the pressure sensor output to AI0 and to the APFI input.  The main problem I was having was determining the proper pin assignment for the APFI input on my SCB-68 terminal board. "

I need to ask:

1: I looked the 6251 specification in terminal, I did not find APF1 input, I only got terminal PF1.

2. I use BNC 2120 to conect the PCI card, do I need connect AI0 to APFI  using paralell wire?

3. I am enclosing a single channel programme, it works fine. The reference analog edge source is the same as the input physical channe.

would you give me any advice to how to work out multi channels. Manks

 

 

0 Kudos
Message 4 of 10
(4,718 Views)
Hello,

I will try and help answer your questions below.

1.  The 6251 only has a APFI0 pin and not a APFI1 pin.  Some of the 625x boards do have both but this board only had APFI0 so you should use it for your application.

2.  The main reason to connect your signal to the APFI pin is so you can use analog triggering to trigger off of the same signal.  If you have a different source you want to trigger off of then you don't need to route the connection.  But if you do want to trigger off of the same signal that you are acquiring then you will need to connect the signal to both the AI and APFI pins.

So to complete your program just make sure you are making the proper external connections.  If you have more questions on the APFI pins please look in the M-Series Users Manual.   If you have any more questions please let me know.

Have a good day,

Brian P.
Applications Engineer



0 Kudos
Message 5 of 10
(4,693 Views)
Hello Brian,
 
Thanks for your reply. I have spent some time in reading M-Series Users Manual, and study both PCI card and BNC 2120. I have noticed the BNC 2120 only access E asn S series, but My PCI-6251 is M-series. So there is no APFI0 pin in BNC-2120 connector
 
My supervisor ever asked the NI technical team before he purchased BNC 2120, he was told it was ok by using it. However from the documentation of the BNC 2120, there is no APFI0 pin.
 
I am still confused in some area. My work is I will acquire data from the four or eight individual sensor. From the theory, these sensor will generator similar pulses but not as the same time randomly, I need to record pulses data as much as possible and ignore the noise. so I need to use threshold level to acquire pulse to get a number of bothe pre-trigger and post-trigger.
 
The above vi I attached, If I only use signal channel, give the trigger source name is the same as the Physical input channel (such as Dev1/ai0), it worked fine. In multi-channels, I have tried to use "APFI0" as the trigger source and set the physical input multichannel such as Dev1/ai0:3 and run, the programme did not give the error code. However, In BNC 2120, the is not APFI0 pin. I have studied all the trigger function, I think Reference analog edge is the one function do this kind of work. would you give me further suggestion for this?
 
kind regards
Lyn
0 Kudos
Message 6 of 10
(4,682 Views)
Hello Lyn,

It sounds like you are wanting to use a separate reference trigger for each individual AI channel because of the timing differences between your channels.  This functionality is not possible with your board.  You can specify one reference trigger for a group of channels but not a separate trigger for each channel. 

One thing you might consider is performing post analysis to just keep the data you need.  To do this just start acquiring on all of the channels at the same time (This is basically what the card is doing when you set up a reference trigger, the data from the cards buffer is not returned until a trigger is received).  Once you are done with your acquisition you can look at the individual waveforms and keep just the data that is above a certain threshold.  This should yield the same results as reference triggers for each channel but you will be doing it after the acquisition has ended instead.  This will also help solve the problem of not being able to use the APFI pin from the BNC 2120 because you will no longer need that pin.  The BNC 2120 will work for most applications on an M-Series board.  The APFI pin is less frequently used so it can be easily overlooked.  But you should still be able to get most of the functionality out of the BNC 2120.

Have a good day,

Brian P.
Applications Engineer
0 Kudos
Message 7 of 10
(4,663 Views)
The root of the problem is that an M Series device is restricted to acquiring only one channel when performing an analog reference trigger where the source of the trigger is an AI channel.  When using an analog PFI line as the source of the trigger, this same restriction doesn't apply and you can sample as many channels as desired.  While the BNC-2120 will work for most applications utilizing an M Series device, it doesn't provide direct access to the APFI pins.  If you need access to these pins and still want to use the 2120, your only option is to create a custom cable which provides a breakout to the APFI pin in addition to the connector for the 2120.  Alternatively, you can return the 2120 and use a BNC-2110.  The AO EXTREF output on the 2110 connects to APFI0 on an M Series device.  The only other option I can see is to continuously acquire and process the data on the fly or post process it later.  Hopefully some of these options will work for you.
0 Kudos
Message 8 of 10
(4,624 Views)
Hello,
 
Thanks for your help.
My experiment start soon, I am run out of time to change connector. if it is to continuously acquire and process the data on the fly or post process it later in a high sample rate, it will use a lot of cpu time. The best soulation is I am going to try by using PFI line as the trigger source.
 
I t is on the national holiday, I can't try to use the equipment. From reading the M series user manual, PFI is the external digital trigger source for PCI-6251, if I am right, what kind of signal should I connect the PFI line?
 

 
0 Kudos
Message 9 of 10
(4,604 Views)
A digital TTL signal should be used on the PFI line.  You can specify a rising or falling edge of the digital signal to trigger the acquisition.  The levels of the digital signal are fixed and cannot be changed.  Any voltage less than 0.8 V will register as a low and anything higher than 2.2 V will register as a high.  A transition from below 0.8 V to above 2.2 V can cause a trigger if you specified a rising edge trigger.

Let me know if you have any additional questions.

Regards,

Neil S.
Applications Engineer
National Instruments
0 Kudos
Message 10 of 10
(4,592 Views)