I have an application where I need to count the time elapsed between a digital signal (logic control line going from low to high) and an analog output reaching a certain voltage level (let's say 2.5V). I am using the NI-6124 AI0+ (AI0- is GND) single ended. I am trying to configure the counter so that the start event is the logic signal (coming through a PFI1 line) and the stop is the threshold detection of the coparator connected to the AI0 input. I have been trying to configure analog triggering but most functions give me an error because the task that I create is for a counter. I am trying to use:
DAQmxSetAnlgEdgeRefTrigSrc to create the measurement. Do I have to have two separated tasks?
Any help or sample code would be appreciated.
Hello again: I had previously stated the wrong function I have used. I meant to write:
Yes, you need two different tasks. And about the VI that you were using, it’s for two digital signals, so probably that’s the reason of the error.
I recommend to use two tasks synchronized by the edge of the digital signal, you can find how to do that in Help->Find Examples-> Hardware Input and Output->DAQmx-> Synchronization….
Now there is other VI that probably will help you: https://decibel.ni.com/content/docs/DOC-4657
Thanks for the clarification on the two tasks. I do not have LabView, I am using LabWindows CVI. Do you have a code example that would perform what you describe?
The Find Examples in LabWindows/CVI is very similar to the Examples structure in LabVIEW. The examples Mike referenced can be found in the same location as project files in LabWindows/CVI. The examples under Synchronization and then Multi-Function describe how to set up tasks to run at the same time on the same card.
The triggering you mentioned sounds similar to the example file in Hardware Input and Output>>DAQmx>>Digital Measurements>>ReadDigChan-IntClk-DigRef. Hope this helps!