09-28-2016 08:48 PM - edited 09-28-2016 08:49 PM
Hi!
The main objective of building this VI is to sync AI and CI. At the same time, the CO should generate pulse train (of known frequency and duty cycle) and then the CI will have to measure the frequency. So the CO basically generates a test signal to be measured.
In this VI attached, I tried to use pulse train from the CO to sync both AI and CI.
Can anyone please comment on what shall I improve on my code?
09-29-2016 09:36 AM
Only have time for very brief comments:
1. Good job making sure the AI and CI tasks are started before starting the CO pulse train task. That was important and you got it right.
If this is early test code where eventually you need to sync to an external pulse train, there will be more work to do to make sure AI and CI start simultaneously. Right now while you're in control of that pulse train, you're fine as-is.
2. The code doesn't totally match your description. You've properly wired up the CO output terminal to the AI task to use it as a sample clock. It seems to me you should route that same wire to the CI task. That'd be cleaner than having the user specify a PFI pin on the front panel.
3. A very small nit to pick. It'll be better to query the CO task for its frequency because the requested freq wired into the task might not be possible. By querying, you'll get the true frequency being generated and your AI waveform timing information will be accurate.
-Kevin P