From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sampling an AtoD off of a Digital Output Change event

I have a NI cDAQ-9174 with a NI 9401 and NI 9221 module.

 

Individually I can:

1> Set up a digital pattern to be clocked off of a counter.

2> Set up a the Analog input module to Clock samples off of an external trigger though the digital module.

 

I would like to be able to clock the Analog module off of the pattern that is generated by the digital module but it is not allowing me to do so with an error that it won't work because it is an output.

 

I tried physically wrapping the output from DIO 7/Counter 2 to DIO0 (PFI0), however, I get an error that the resources are reserved. My understanding is that the Chassis has 4 timers, so I don't know why using Counter 2 would prevent me from being able to use Counter 0.

 

Does anyone have any examples of how to accomplish what I need to get done. Ideally I would not need an external wrapback, but the digital output would be useful for probing purposes.

0 Kudos
Message 1 of 6
(2,911 Views)

Hi Steve,

 

How many digital output lines are you using?  

 

Are you using DO for anytihng other than triggering AI samples?

 

 

Regards,
0 Kudos
Message 2 of 6
(2,829 Views)

DIO4-7 are configured as outputs for DIO. DIO1-3 need to be able to accept an input trigger.

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

Is the digital signal you want to clock on periodic?  If so, you can generate your clock signal using counters and remove the need for generating the digital AI clock signal altogether.

 

If not, I think you'll have to read in your digital output to a DI line and then point your AI sample clock at the PFI line that corresponds to that digital line.

 

It looks like you have line 0 open, so you may be able to use this line for digital input.  

 

I tried pointing the AI sample clock directly at the PFI line corresponding to the digital line I'm writing to, but also got an error about it being configured as an output. To get it to work, I created a second digital task that read in the output of the first digital task and then pointed the AI sample clock at the PFI line for that digital input line.  This does requre a physical route between your digital output and input, though.  

Regards,
0 Kudos
Message 4 of 6
(2,780 Views)

Do you have any code for the solution that uses the second digital task? I tried it but it didn't work, however, there might be something I'm missing.

0 Kudos
Message 5 of 6
(2,731 Views)

Unfortunately, there don't appear to be any examples which do this as with most NI hardware you wouldn't need the extra task. I just threw something together really quick for testing which was certainly not in a suitable state for distribution. However, if you could provide your code, I would be happy to have a look at it.

Regards,
0 Kudos
Message 6 of 6
(2,704 Views)