Timed Toop: Signal From Task with Change Detection Event

Timed Toop: Signal From Task with Change Detection Event

Post by phil » Fri, 24 Mar 2006 21:40:09


Dear all,I have a digital input comming from a HAL Sensor of a motor. This HAL Sensor helps me find the inital motor postition.I used to poll the digital input to detect changes on the line.

Now I found the much more elegant way of using a timed loop in combination with "Create Timing source VI"
.I would like to use the "Signal from Task" instance of the VI as the associated task has already been created.The problem is that I keep getting the following error message:-200452DAQmx Create Timing Source (Signal From Task).vi<append><B>Property: </B>SignalFromTask.Signal

<B>Task Name: </B>_unnamedTask<4A1>I use a PXI System and the digital input is located on a PXI-6602.Additional Question:Later I will need to read the digital line before using it with the described loop.The Manual tells me not to use the "DAQmx Start Task" VI to start the task as the Timed Loop starts the task automatically.But I will have to start the Task. Otherwise reads are not possible.Thanks in advanvce for helping me with the ProblemViele GrePhiliMessage Edited by phili on 03-23-2006 06:25 AM


Timed Loop (Signal from Task).vi:
http://www.yqcomputer.com/ (Signal from Task).vi
 
 
 

Timed Toop: Signal From Task with Change Detection Event

Post by RebeccaF » Fri, 24 Mar 2006 23:10:09

Hello Phili,
for your first question you will find the answer in link:
<a href=" http://www.yqcomputer.com/ " target="_blank"> http://www.yqcomputer.com/ ;/a>
and there it is Application 6.
Hope this helps,
 

 
 
 

Timed Toop: Signal From Task with Change Detection Event

Post by Stuart » Sat, 25 Mar 2006 23:40:09

Phili
 
What you want to do is not use the Signal From Task Flavor.  You can use two other timing sources depending on what your board supports
 
#1.  Use the Change Detection Timing Source VI.  There is an example \examples\daqmx\control\event response.llb
#2.  If your board doesn't support change detection you can also use the Digital Edge using Counter Timing source.  This example uses a counter to trigger each time a digital line goes high or low on a given PFI line.  Look at the example \examples\daqmx\control\Dig Output-digital Edge with Ctr.
 
I also want to encourage and remind everyone who might be reading this to use the NI example finder.   We have a ton of example programs and searching for timed loop would have yielded each of these examples.
 
StuartG