PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

Random Pulse DAQmx

I am trying to acuire a pulse, that I generate programmtically, through the 6123 DAQ card. I am having a problem capturing the pulse consistantly. I would like to know if there is a special sequence that needs to be followed in order to set up the DAQ card. My understanding is that I should be able to programmtically tell the DAQ card when to trigger (I have it set up to trigger on the rising edge of the pulse), how many samples to take, and at what rate and the DAQ card will wait until is senses the trigger and capture the data and put it in a buffer that I can retrieve later. The VI is set up in a sequence. I use the DAQ assistant to set up the DAQ card(which I assume tells it to wait until is sees the trigeer and then begin to capture the data and store it in the buffer). In my next sequence I send the command to activate the pulse and my last sequence I perform a read of that DAQ card to retrieve the data.

The problem is I sometimes do no get the data. It is not very comsistant. I am wondering if I am doing something wrong in setting up the DAQ card to capture the data.

 

0 Kudos
Message 1 of 6
(3,408 Views)

I forgot to mention that I am using Labview 8.2 with the Labview Real Time OS on a PXI chassis w/ NI-6123 DAQ devices.

The target.vi (On the PXI chassis) is setting up the DAQ device, sending the pulse and reading the data.

The host.vi (Laptop) is evaluating the data

0 Kudos
Message 2 of 6
(3,397 Views)

Hello BigDaddy1962,

 

In general, the DAQ Assistant configures your acquisition and waits for the trigger before it returns. What I suspect is that you are not leaving your first sequence to activate your trigger. This would cause you to miss the pulses as you described.

 

For an example of how to set up triggered acquisition I would recommend that you go to the NI Example Finder by opening LabVIEW and going to Help>>Find Examples … Once you are in the NI Example Finder you should be able to navigate to Hardware Input and Output>>DAQmx>>Analog Measurements>>Voltage. You should be able to find an example called ContAcq-ExtClk-DigStart. This example demonstrates the use of DAQmx sub-VIs to set up a digitally triggered Voltage acquisition. You should be able to leverage this example with the code you have already written.

 

For more information about triggering you can also examine the document entitled How Do I Use a Digital Trigger in LabVIEW to Start and Stop Acquiring Data?

 

I hope this information is helpful. Let me know if you have any additional questions.



Matt Anderson

Hardware Services Marketing Manager
National Instruments
0 Kudos
Message 3 of 6
(3,384 Views)

Matt,

Thanks for the response. After viewing the examples it appears that I am doing everything correctly, but am still unable to capture the pulses. My understanding of the DAQ (PXI-6123 S series) device is that I should be able to set the DAQ up to trigger on a certain channel (analog input), start the task and the DAQ card waits for that trigger(however long that takes) and then collects the data (based on how I set it up to collect the data, 50000 samples @50kHz)), and put the data in memory. At that point I can move on to do other task, i.e, send out the pulse and then after sending the pulse, retrieve the data from the DAQ.

I went away from the DAQ Asst. and tried setting up the DAQ card using the lower level API's. I have enclosed screen shots to show my sequence. My 3rd sequence is just a 1 second wait. I carried the task and error lines through the sequence to the read VI, but still no data to collect. The reason for the case statement is that I have 16 different pulses to capture on 16 different channels between 2 DAQ (PXI-6123) cards. I have been at this for a couple of weeks now and have tried a multitude of different approaches. Running out of ideas.

Thanks,

Jeff (AKA BigDaddy1962)

Download All
0 Kudos
Message 4 of 6
(3,381 Views)

Hey Jeff,

I looked over the images you posted and there are just a couple of things I wanted to point out that I thought might be a problem. In the 1st Sequence:

1. In the DAQmx Create Channel.vi you appear to have wired a pre-constructed task to the task in input. It looks like you have also wired a number of other inputs into the VI. It is not necessary to wire inputs to the DAQmx Create Channel.vi if those configurations are set in the task you have wired to task in.

2. You have wired /Dev1/ai/StartTrigger to the DAQmx Sample Clock.vi source. Generally this line is used for triggering and not timing. The source input to this VI is used as a sample clock for the task you have wired in to the task in. Technically, you could wire a signal to the pin assigned to /Dev1/ai/StartTrigger and use that as your clock signal, but it is not generally recommended.

3. You have wired Dev1/ai0 into the source input of the DAQmx Start Trigger.vi. However, you have also selected this signal as the physical channel input to your DAQmx Create Channel.vi. The DAQmx Start Trigger.vi is generally used to trigger an acquisition from an external source. If you are trying to trigger the acquisition to begin when the signal crosses a certain threshold, I would suggest that you use the Analog Window instance of the DAQmx Start Trigger.vi.

In the 4th Sequence:

1. You do not need to start the acquisition again after the DAQmx Read.vi. The DAQmx Start Task.vi sets and acquisition to begin based on the parameters set by the DAQmx Create Channel.vi, DAQmx Sample Clock.vi and DAQmx Start Trigger.vi. Once you start the task, all you need to do is read the data using the DAQmx Read.vi.

Additionally, I just wanted to clarify one of the steps you mentioned in the acquisition process. Fundamentally, you are correct in your understanding of the data acquisition process. However, one difference is that the DAQ card is actually acquiring data at all times, but only transfers the data to the computer memory based on the trigger. This is slightly different than the process you described, but is important to note because it allows for the acquisition of pre-trigger samples. This is not necessarily related to your current application, but is something that may be good to know in the future.

I hope some of this information was helpful, please let me know if there is anything else I can do to help.



Matt Anderson

Hardware Services Marketing Manager
National Instruments
0 Kudos
Message 5 of 6
(3,367 Views)

Matt,

Thanks,

I took care of those issues and finally resolved my problem. It appeared to be related to the task definition and the fact that I am creating a task everytime I set up the DAQ. I am actually looking at 16 different pulses on 16 different channels on 2 DAQ cards. The issue appeared to be related to the need for a clearing of the current task in order to get ready for the next. I put a device reset after each aquisition and that appears to have solved my problem.

Thanks again for the help.

Jeff C.

0 Kudos
Message 6 of 6
(3,365 Views)