Quantcast
Channel: Digital I/O topics
Viewing all articles
Browse latest Browse all 2180

How to pause acquisition, wait for software event, and then resume

$
0
0

I am working on an application that is using the NI PCIe-6361 and C# to move a sensor (via analog outputs) and make readings at several points (via an analog input) with the final result being a rastered image. I have this part working great at this point. However, now I'm working on adding the ability to pause acquisition at some user-defined interval (i.e. every 10000 points), signal the software so that some adjustments can be made, and then resume the acquisition when the software signals everything is ready to continue.

 

My idea is to use a pause trigger on the AI and AO tasks to drive the pause trigger with a digital line that would be configured to go high at the required interval. Then, I want to use the DigitalChangeDetection callback to notify the software that the hardware is paused and that it's safe to make the needed adjustments. Finally, when the software is ready I want to drive the pause line low, causing the AI and AO tasks to resume.

 

Some questions:

1. Is this a reasonable/good way to handle this? Is there a better way? Am I using the correct mechanisms for this?

 

2. I did some initial tests with this and am having some issues. I setup a digital output task to go high at some interval. I then hardwired that digital out (P0.6) to another digital in (PFI1). With that connection I can now do one or the other of the following, but not both at the same time:

 

     a. Get a DigitalChangeDetection event in the software when PFI1 goes high

     b. pause the digital out task when PFI1 goes high

 

Is it not possible to do both of these things at the same time?

 

3. Assuming I can get #2 resolved, is it possible to configure a digital output task to go high at a specific interval (using DigitalSingleChannelWriter.WriteMultiSamplePort in C#), but to also manually push it back low when I want the hardware to resume (using something like DigitalSingleChannelWriter.WriteSingleSampleSingleLine)?


Viewing all articles
Browse latest Browse all 2180

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>