Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

task was done within the specified timeout

I was trying to generate a 50ms pulse on the PFI12 line using counter-0 in the NI-6345 card. The following code from the NI git repository giving a timeout error

https://github.com/ni/nidaqmx-python/blob/master/examples/counter_out/write_single_dig_pulse.py

 

"""Example for generating a single digital pulse.

This example demonstrates how to generate a single digital pulse
from a Counter Output Channel. The Initial Delay, High Time, Low
Time, and Idle State are all configurable.
"""

import nidaqmx
from nidaqmx.constants import Level

with nidaqmx.Task() as task:
    channel = task.co_channels.add_co_pulse_chan_time(
        "Dev1/ctr0", idle_state=Level.LOW, initial_delay=0.0, low_time=0.05, high_time=0.05
    )
    channel.co_pulse_term = "/Dev1/PFI12"

    task.start()
    task.wait_until_done(timeout=10)
    task.stop()

 

 

Error :

   task.wait_until_done(timeout=2)
  File "/home/user/.pyenv/versions/3.10.7/lib/python3.10/site-packages/nidaqmx/task/_task.py", line 1061, in wait_until_done
    self._interpreter.wait_until_task_done(self._handle, timeout)
  File "/home/user/.pyenv/versions/3.10.7/lib/python3.10/site-packages/nidaqmx/_library_interpreter.py", line 5914, in wait_until_task_done
    self.check_for_error(error_code)
  File "/home/user/.pyenv/versions/3.10.7/lib/python3.10/site-packages/nidaqmx/_library_interpreter.py", line 6412, in check_for_error
    raise DaqError(extended_error_info, error_code)
nidaqmx.errors.DaqError: Wait Until Done did not indicate that the task was done within the specified timeout.
Increase the timeout, check the program, and make sure connections for external timing and triggering are in place.

Task Name: _unnamedTask<0>

Status Code: -200560

 am I missing any configuration here?

Any help on this issue will be greatly appreciated

0 Kudos
Message 1 of 3
(165 Views)

Is your USB-6345 have an Alias name of "Dev1" in NI MAX?

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 3
(135 Views)

Yes, my ni PCIe 6345 is detected as Dev1. Also, I can see the pulse coming in the output line along with the above error

0 Kudos
Message 3 of 3
(124 Views)