09-07-2016 01:19 AM
Hi all,
I'm new to LabVIEW and I always have issues in getting the synchronization right.
The tasks for my VI: Generate pulse train, using counter to measured the freq of generated pulse train and acquire an analog signals work fine without the synchronisation.
When it comes to synchronizing the counter measurement and analog acquisition, i had errors coming and I am aware that, as a rule of thumb, master timebase, start triggered and sample clocks must be shared for synchronized measurement.
Appreciate if there were any kind ones would like help to share your opinions towards synchronisation programming practice.
09-07-2016 11:09 AM
Your rules for sync'ing are reasonable, but for many practical cases they're actually overkill. I do quite a bit of task syncing and I often don't share start triggers or timebases explicitly. It's often sufficient to conceive of one task as the master task, configure the other tasks to use the master's sample clock, and be sure to start the master task last (so everyone else is already armed and ready to go when the sample clock pulses start).
Second, for tasks coming off the same board, they're all gonna derive their timebase from the same internal source. Further, one consequence of that is that there's no particular value in measuring the frequency of the pulse train you're generating. There *is* value in querying the pulse generation task for the *actual* frequency it's able to generate.
I made some simple mods to your program to help illustrate, but wasn't able to test it yet.
-Kevin P
09-20-2016 09:02 PM - edited 09-20-2016 09:03 PM
Yes, sorry for really really late replies. I agree to your standpoints for those synchronization rules but I still encounter some errors when it comes to timing and start during synchronization of my other works. And I shouldn't have deleted the whole acquisition line for the coutner input for the generated pulse train for freq measurement although it seems redundant. It is one of the requirement in the task although the VI you had uploaded works fine.
Do you have any good synchronisation guidelines available in online for reference because I am still having troubles doing the synchronisation for this task.
Thanks
09-21-2016 08:29 AM
Don't know of any specific online resource to point you to offhand, I've just accumulated some knowledge from experience working with DAQmx tasks.
1. First it's crucial to understand exactly what your synchronization needs are. I have only very rarely needed anything more than to share standard task signals such as the sample clock and trigger. Those will get you sync'ed to within some number of nanosec.
2. Syncing to external signals is sometimes easy, sometimes a little trickier. Depends very much on the specific system and timing requirements.
I'd first try to focus on what can be done with regular task signals such as the sample clock, maybe a trigger, and maybe use a counter/timer if any are available. What are the specific problems you're having with sync? What are the symptoms? Do you have scope traces? Are you getting DAQ errors in your tasks?
-Kevin P