Hi Steve,
From the sound of your message you're right there and almost have the
solution. As you indicated if you use an analog read then it is
going to take a bit of time between the acquisition of the data,
pulling it into LabVIEW, analyzing the data, looking for a certain
level, and then writing out a digital value.
What you need is some sort of triggering so that the operations you are
doing are based off of hardware timing instead of software timing.
You are using an M-Series board, so in order to trigger your digital
lines you will have to configure the clock for your operations to be
one of the counter pins. Once you have this 'external' clock
source, you can then trigger that clock using a digital edge
trigger. Unfortunately the boards do not directly support analog
triggering for the counter gates.
Probably the best thing you could do for this case is use an external
Schmitt Trigger
to turn your analog level into a TTL pulse. You can then put that
pulse into a PFI line which would be used as the trigger for your
counter. And that counter would be the timebase for your digital
operation.
If you don't want to use a Schmitt Trigger then you will have to use a
solution that uses software timing similar to what you currently have
implemented.
Regards,