Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx example of digital trigger for analog input?

I have a 6024E and am programming in VB.NET. I am looking for a DAQmx example of writing a digital output which will trigger analog input. Thanks.
0 Kudos
Message 1 of 6
(5,338 Views)
Hello,


I do not know of an already written example. However, this should not be too difficult of a task. There is a shipping example �ContAcqVoltageExtClk_DigStart.sln�, that is in the following folder

C:\Program Files\National Instruments\MeasurementStudio70\DotNET\Examples\DAQmx\Analog In\Measure Voltage\ContAcqVoltageExtClk_DigStart\Vb

For digital I/O, there is also the following example �WriteDigChan.sln�, which can be found in the following folder

C:\Program Files\National Instruments\MeasurementStudio70\DotNET\Examples\DAQmx\Digital\Generate Values\WriteDigChan\Vb

These two examples will allow you to output on a digital line, and then you can use a wire to route the digital output to the trigger line. In this case, you would want to start
the first example, and then start the second example.

On a different note, why are looking to do this? If you let us know about your application, we may be help to help you find a better solution.


Best regards,

Justin T.
National Instruments
0 Kudos
Message 2 of 6
(5,338 Views)
I'm using a digital output (DO) to turn on a circuit and I want to measure an analog signal input (AI) in the circuit. I don't want to start measuring the AI until the DO starts the circuit. I have code to drive the DOs and code to read the AIs. I need guidance understanding how to configure the trigger that starts the AI. I'll check out Analog In example. Thanks.
0 Kudos
Message 3 of 6
(5,337 Views)
Hello,

It looks to me like you really only need to use a digital trigger when configuring your analog input. This way you can start the analog input in software whenever you want, but it will not actually start taking samples until the digital line goes high. Note that the digital line will have to be routed to the digital trigger input.

The call in the example program that steps up the digital trigger is the following:
analogInTask.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger(triggerSourceTextBox.Text, triggerEdge)

Look into this a little more and let us know if you have any further questions.

Best regards,

Justin T.
National Instruments
0 Kudos
Message 4 of 6
(5,337 Views)
I looked at that example and now would like you to confirm that I must wire DIOn to PFI0 and leave the default ("/Dev1/PFI0") in the Trigger Source combobox. Thanks!!

Can you point me to the place in the documentation that explains how PFI7 can be used as an argument to ConfigureSampleClock? PFI7 is described as STARTSCAN in the pinout diagram. Thanks.
0 Kudos
Message 5 of 6
(5,336 Views)
Hello,

You could choose to wire DIOn to PFIy, as long as you specify �/Dev1/PFIy� in the Trigger Source Combobox.

Also, the NI-DAQmx Help File contains information on Sample Clocks. You can find the NI-DAQmx Help file in the following location.

C:\Program Files\National Instruments\NI-DAQ\Docs\daqhelp.chm

For an example that uses an external clock, look in the following location.

C:\Program Files\National Instruments\MeasurementStudio70\DotNET\Examples\DAQmx\Analog In\Measure Voltage\AcqVoltageSamples_ExtClk\Vb

Sorry for the delayed response, I was out teaching for two weeks.

Best regards,

Justin T.
0 Kudos
Message 6 of 6
(5,336 Views)