LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pre-trigger data from four AI using Daqmx

Hello everyone,
 
I have an PCI-6251 card  connecting BNC-2120 recently. I am using Labview 8.2. I have used design a programme by using Reference analog edge trigger function, the trigger source is the the same as the input channel in a single channel. the reason I choose reference analog edge trigger function is I only need to acquire a pulse produced average one second (random). the reference analog edge trigger function can allow me to acquire the trigger level, pretrigger number and sample number, I can record the pulse.
 
However, I need four analog input channels doing the same function, the pulse from sensor is generated randomly. I also need to count how many pulse generated through each channel during the experiment. is there any good way to do this kind work. Any advice would be greatly appreciated.  Thank you in advance for any responses. 
 
Lyn

0 Kudos
Message 1 of 12
(4,224 Views)
Hi Lyn,
 
Thanks for posting your query on the National Instruments forums. Can you kindly post or attach your VI to this discussion forum board so that i can take a closer look at what your code currently does and to then help you further? I'm wondering if you are aware that LV is shipped with many example VI's that you can use to help you get started. I was thinking something like "count digital events.vi" from example finder in LabVIEW might be along the lines of what you are after? To check out VI's in example finder go to > help > find examples to then be presented with the NI Example finder window. I'm assuming you are working with DAQmx VI's in LabVIEW? I can't seem to find "Reference analog edge trigger function" on my palettes, are you refering to a terminal of a particular VI? You can find out the name of the VI or function on the block diagram by right clicking it > visible items > label.
 
I hope this helps!
 
Kind Regards,
 
Kirtesh Mistry
Applications Engineer
National Instruments UK & Ireland.
0 Kudos
Message 2 of 12
(4,213 Views)

Hello Kirtesh,

Thanks for your reply, I am enclosing the VI which I used to acquire data from a single channel.

I have read from examples, have not worked the mult channels.

0 Kudos
Message 3 of 12
(4,201 Views)

Hello Kirtesh,

I have tried by using APFI0 as the trigger source, give dev1/ai0:1 as physical input channel and run, the programme did not give me error code. ( if I give Dev1/ai0:1 as trigger source, the error is as follow:

Device supports an analog channel as the source of an analog reference trigger only when it is the only channel in the task.

Remove all of the channels currently in the task except the channel that will be used as the analog trigger source, or change the analog trigger source to a terminal.)

However another problem come out, I use BNC-2120 to connect PCI-6251, the BNC-2120 documentation say it can connect to E series, s Series. I checked the BNC-2120, there is no APFI0 terminal. When my supervisor asked the NI technical team, he was told it was ok by using BNC 2120 to connect PCI-6251. 

Kind regard

Lyn

0 Kudos
Message 4 of 12
(4,198 Views)


Lyn

I have taken over this query from Kirtesh and have analysed your problem by setting up the same system here in our Lab. Unfortunately the problem you are encountering is specific to the BNC-2120 device you are using. The device does not have an APFI0 output as you observed, this prevents you from using a second analogue input channel as a triggering device. Unfortunately, the device does not support this function and as such, the pin is 'not attached' (I have attached the pin schematic to this post). You are however, able to use a single Analog Input channel but it must be the signal which you wish to aquire.

The BNC-2120 is a suitable device to work with your PCI-6251, however you have unfortunately discovered a limitation of the BNC device. You could potentially hardwire the triggerring input to the device pin, but this will require you to modify the BNC-2120 internally. This is a method we here at NI do not reccomend . Alternatively, you could use an SCB-68 screw terminal block which includes n APFI pin. If you wish to enquire this device, or about a possible exchange, please contact our sales department on 01635 523545  who will be happy to help you.

I'm sorry we could not provide a more straightforward solution to your problem.

Best wishes and thankyou for contacting NI.

Rob




Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
0 Kudos
Message 5 of 12
(4,191 Views)
Hello Rob,
 
Thank you very much for your message.
 
I have read BNC-2121 documentation, it has APFI0 pin. I every had a word with my supervisor, he agreed we could change the BNC connector, My question is if we change to use other connector which has APFI0 pin, is it able to do the work as I described before?
 
Kind regards
 
Lyn
0 Kudos
Message 6 of 12
(4,183 Views)
Sorry, forget to say another query.
 
If I still use BNC2120, do I have another way to acquire data from multi channel as I want?
 
Regards
Lyn
0 Kudos
Message 7 of 12
(4,183 Views)


Lyn

Although you may be able to use the BNC 2121, I do not reccomend it. The device is a counter specific accessory and does not include any Analog IO. You may be able to work around this but would probably run into similar problems as with the 2120. you could perhaps use the 2111 which includes 8 Analog IO and an APFIO channel too. However, the device does not include as many other features as the 2120 such as thermocouple inputs, digital IO and quadrature encoders. Therefore if you were contemplating an exchange, in the long run it might not be the best idea. The 2111 is also a single ended reference device unlike the 2120 which can accept floating signals. I have included a schematic of the 2111 in this email and the following link will give you all the information on the BNC accessories your Mseries DAQ card can use.

http://sine.ni.com/nips/cds/view/p/lang/en/nid/201731

With respect to whether you might still be able to use the 2120, I believe the answer may be yes. I have been working all morning on developing some code which might be able to achiveve this and it turns out the answer may be quite simple. After experimenting with a lot of code I found the easiest method would be to use some of the express VI's located in the LabVIEW function pallette. I have attached a simple VI which takes the input of 2 channels and outputs the signal from a reference point on one of the signals. Have a play and see if you can adapt it for your needs, I hope this will provide a simple and effective solution.

Best wishes, I really hope this helps.

Rob


Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
Download All
0 Kudos
Message 8 of 12
(4,172 Views)

Hello Rob,

I am really apperciate what you have done for me.

I have used your sample vi to acauire data from two input channels, I connected my sensor to ai0 and a very low frequency frequency sine wave to ai1. but the signal is not as the same which I acquire by signal channel. I am enclosing the property of the trigger and gate function and a single channel results by using the Daqmx. From these two picture, I guess you can see the difference.

My idea job is PCI-6251 will connect 4 or 8 individual sensor to acquir pulses, these pulses are similar but they arrive to PCI-6251 in different time. The best result is I can get every pulse data as the same I am enclosing one, idealy. is it possible to do it?

Kind regards

Lyn

 

0 Kudos
Message 9 of 12
(4,170 Views)


Hi Lyn

I'm not exactly sure what you're trying to achieve, I didn't fully understand your last reply. If you could post back with a few more details it would be very grateful.

Many thanks

Rob

 




Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
0 Kudos
Message 10 of 12
(4,161 Views)