09-12-2013 08:59 AM
Hello everyone!
I have two tasks and a timed loop that I need to synchronize to get meaningful results. I can synchronize the timed loop and the input task with the Create Timing Source VI.
My application would be a lot more effective if I could change the task's sampling rate online. I have tried the following: Inside the loop, stop the task, change the rate with a property node, and restart the task right away. Later I would adjust the loop's period so that its actual duration remains the same. This, however, leads to an unpleasant error -805 (timing source was cleared) and the abortion of the timed loop. Is there a workaround for this?
And another question: If the second task has a (30-40x) higher rate than the first, can I still use the first timing source in the second task (to synchronize both)?
Thanks a lot!
09-26-2013 03:07 AM
Hi SLS,
do you use this vi?
Please post your code to let us see what exactly you are doing.
Best regards,
Peter
09-26-2013 03:30 AM
Hello Peter, thanks for your reply.
I was not clear enough: I was referring to the DAQmx create timing source VI. I was trying something like this:
But the error was thrown as soon as I stopped the task.
In the meantime I came to the following workaround: To put the timed loop inside a while loop. Then, to change the rate, I would just quit the timed loop, change the sample rate in the while loop and let the timed loop restart. Would work... But that's really bulky.
09-26-2013 04:32 AM
There are multiple ways to synchronize loops.
Do you have special requirements which make it necessary not to use those?
Best regards,
Peter
09-26-2013 05:52 AM
Well, what I'm trying to synchronize are not independent events in time which have to happen in a certain order, but the ticks of the timing sources. I don't know if those VIs are able of doing such a thing?
09-26-2013 09:14 AM
I'm sorry, but I still don't know what you are trying to do.
You would like to "synchronize ... the ticks of the timing sources".
This sounds like you are trying to synchronize the sample clocks of two devices.
Please be more precise.
Best Regards,
Peter
09-30-2013 10:15 AM
hello,
I think you are trying to do this (attached file)