Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatic task property change error

I am using a Compact DAQ with 9211 TC module, creating my tasks in MAX.  In my LV 2012 application I need to modify the task at times to change the Thermocouple type and min/max input ranges independently for each channel, and do this once the task has already been running.  I have successfully achieved this by first using the "Clear Task.vi", modifying the properties using a Daqmx Channel node, and then restarting the task.  

I first tried to simply stop the task (Stop Task.vi), modify the properties and resart, but I would receive error -201171 suggesting a min input value out of range.

 

It isn't clear to me why I need to clear the task rahter than just stop the task to modify the properties, and the error I receive does not seem accurate with the behavior I am seeing.

I am wondering if this is a bug or expected behavior?  

 

Thanks

Dan

0 Kudos
Message 1 of 4
(3,309 Views)

Hi Dan,

 

It might be a bug. Could you provide some more information?

  1. Which model of Compact DAQ chassis and NI-DAQmx version are you using?
  2. What values did you pass to the DAQmx Create Channel VI for those three properties?
  3. Which properties did you set after stopping the task (all three? a subset?), and what values did you set them to?
  4. Does your program do anything else with the task after stopping it, such as reading properties?
  5. If you drop a second DAQmx Channel property node, configure it for AI.Max and AI.Min, right-click on each property and select Change To >> Default Value, and wire it in front of the first DAQmx Channel property node, does that prevent the error?

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 2 of 4
(3,301 Views)

Brad,

 

One other thing to note is that I have replicated this issue both with simulated HW and with the actual HW

 

To answer your questions:

1. I am using a cDaq 9174 (simulated) with Daqmx v9.5.5 (have also replicated the issue with a cDaq-9178 - real HW)

2. I am passing values given in the following link for polynomial limits: http://digital.ni.com/public.nsf/allkb/98EE9F9C730FDF09862572F800603D6B

  and have verified I am passing the correct values for the respective therrmocouple.

3. I am setting the AI.Thrmcple.Type, AI.Min, and AI.Max properties after stopping the task.

4. Nothing else is preformed in between stopping and restarting the task other than writing these three properties for each of 4-chs on a 9211

5. This did not prevent the error.

 

Thanks

Dan

0 Kudos
Message 3 of 4
(3,284 Views)

@LV_Dan wrote:

I am using a Compact DAQ with 9211 TC module, creating my tasks in MAX.  In my LV 2012 application I need to modify the task at times to change the Thermocouple type and min/max input ranges independently for each channel, and do this once the task has already been running.  I have successfully achieved this by first using the "Clear Task.vi", modifying the properties using a Daqmx Channel node, and then restarting the task.  

I first tried to simply stop the task (Stop Task.vi), modify the properties and resart, but I would receive error -201171 suggesting a min input value out of range.

 

It isn't clear to me why I need to clear the task rahter than just stop the task to modify the properties, and the error I receive does not seem accurate with the behavior I am seeing.

I am wondering if this is a bug or expected behavior?  

 

Thanks

Dan


You have the difference between the Stop and the clear task vi in handling the hardware resources.That is the reason it worked for changing the configuration when you have cleared the task and didn't work when you just try to stop the task. You can take a look into the Knowledge Base for more detail.

 

Good luck

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 4
(3,272 Views)