04-10-2006 01:02 AM
04-10-2006 04:44 AM
04-10-2006 07:53 AM
Well, I think my question was not precise enough. What I am using is the "DAQmx Create Timing Source" function, instance "Digital Edge (Counter)". In this case, there is no task output but only "timing source name" string output, so I am unable to clear anything with that.
Is there a way to clear the timing source from its name, or by any other mean ?
Thanks for help.
04-10-2006 08:06 AM
04-10-2006 08:39 AM
04-10-2006 09:18 AM
I have the LV Pro version, so I will try to modify this VI, but I would have to do that on all develoment computers (we are several people working on the same project).
This timing source is used as the real-time cycle of my I/O applicationn, whose parameters can change dinamically. So I have to clear it if the cycle time is modified, without rebooting the controller.
04-10-2006 09:36 AM
I'm not at my LV PC to be able to describe exact syntax, but I've done something similar before. I used a counter output as a timing source for a timed loop, and when other parts of the app changed the pulsetrain frequency, the timed loop ran faster/slower as expected.
As I recall, I just configured the output pulsetrain task explicitly and then queried one of the DAQmx property nodes (something like Pulse.OutputTerminal I think?) and fed the result into the "Create Timing Source" vi. That left the rest of my app responsible for the actual DAQmx task, while the string output from "Create Timing Source" was used only for the Timed Loop.
Come to think of it, I posted an example about it -- here's the thread.
-Kevin P.
04-10-2006 10:57 AM
OK, that is a good idea. If I am not able to delete the timing source to create a new one with new parameters, I will try to modify the "old" one through its property nodes...
But I am not really sure whether or not I would be able to replace the counter associated to the timing loop. I think it could be possible to modify the parameters like edge count, edge type or terminal but I think I may have problems redefining the counter, and even more using the "old" counter for a new purpose.
I will make a try and I keep you informed.
Thanks.
04-11-2006 08:12 AM
04-12-2006 05:27 AM
I did the modification that proposed Albert : I modified the VI that creates the timing source for having the task out parameter. To avoid problems for deployment, I saved the file into the project with a new name.
When clearing the corresponding task, the timing source can be created again, with possibly new parameters. So it works now as expected.
About Kevin proposal, I also checked that, but it seems that all properties are "read only"
. Automatic clear of DAQmx task as proposed by Stuart seems to be done only when the application exits, and I do not want to do that on my RT application (to restart the exe, I think I have no other choice than rebooting, and moreover I have a TCP connection with a remote computer that I cannot close).
Well, it would be nice that future version of "DAQmx create timing source" using physical counter also inlcudes this task out terminal, or a dedicated VI able to clear the timing source using its name for example. ![]()