Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

triggering analog input with digital edges

Solved!
Go to solution

I am currently triggering an Analog Read with a digital trigger using a 0-5v shaft encoder as the digital source.  I am running LV 8.2.1, DAQmx 9.0, and a PCI-6259.  I am using a VI I wrote that is very similar to the "Acq&Graph Voltage-Ext Clk.vi", and using the encoder A-pulse connected to PFI8 as the clock source for the Sample Clock vi.  The only major difference is using the Z-trigger AI channel as a software reset inside the While Loop with the DAQmx AI Read.  Currently, the Sample Clock only allows either reading the falling or rising edge of PFI8, so I only get one sample per A-pulse. 

 

I need to double the Analog Read rate for a given shaft rpm and encoder, so I need to read on both rising and falling edges of the encoder A-pulse.  Can the Sample Clock be reconfigured to Change Detection and still read the PFI8 port for both rising and falling as physical channel inputs, or do I need to configure a Digital Input Task/Change Detection for a single line, and use the "ChangeDetectionEvent" as the source for the AI Sample Clock? Can the DAQmx Timing/Change Detection still use the signal into PFI8, or must I use DI ports, and what DI ports must I use?

 

Thanks in advance!

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

Hi Turbosaurus,

 

Unfortunately the sample clock for analog input can only be configured for either rising or falling.  The Change Detection timing option does have inputs for a rising edge and falling edge source (which can be the same line), however, the official Change Detection timing option can only be used as the timing engine for digital and counter tasks, and are not compatible with analog tasks.

 

 

However, you are absolutely correct in that you can create a dummy DI task using Change Detection, and then use the ChangeDetectionEvent for the sample clock source for your analog input.

 

For the source of the Change Detection rising and falling edges you should be able to use any line of Port 0. 

Eric S.
AE Specialist | Global Support
National Instruments
0 Kudos
Message 2 of 6
(3,674 Views)

Thanks, Eric.  Just to be sure; so I need to move the encoder trigger signal from PFI8 to any line in port 0? 

 

Do you see any problem with leaving the signal connected to PFI8 and jumpering it to P0.8?  I have more than one program, (others still use PFI8 as single edge trigger) and I don't want the end user to keep having to move hardware lines!

0 Kudos
Message 3 of 6
(3,672 Views)
That's correct, you'd have to change it to be on the digital line and not just PFI8.  But you should be able to jumper PFI8 and P0.0  (P0.8 doesn't exist, max is P0.7 before going to P1.0) without a problem.
Eric S.
AE Specialist | Global Support
National Instruments
0 Kudos
Message 4 of 6
(3,647 Views)
Solution
Accepted by topic author Turbosaurus
Actually P0.8 does exist.  I was looking at the pinout for the 6251, not 6259.  Sorry about that.
Eric S.
AE Specialist | Global Support
National Instruments
0 Kudos
Message 5 of 6
(3,645 Views)
Thank you, Eric!
0 Kudos
Message 6 of 6
(3,641 Views)