11-07-2019 02:20 PM
Two_Edge_Sep times out. Can anyone see why? I am baffled.
Python version: 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)]
Package Version
---------- -------
nidaqmx 0.5.7
numpy 1.17.3
pip 19.0.3
setuptools 40.8.0
six 1.12.0
Windows 10 Pro Version 1903
64-bit operating system, x64-based processor
16.0 GB ram installed and recognized.
Processor is Intel(R) Xeon(R) CPU E5-1650 v3 @ 3.50GHz
START OF CODE:
import nidaqmx
import os, sys
os.system('cls')
with nidaqmx.Task() as task:
task.ci_channels.add_ci_two_edge_sep_chan("Dev1/ctr0:0", min_val=0.0000001,
max_val=1.0, units=nidaqmx.constants.TimeUnits.SECONDS,
first_edge=nidaqmx.constants.Edge.RISING,
second_edge=nidaqmx.constants.Edge.FALLING)
print("\n\nPython version: {}".format(sys.version))
print(os.system('python -m pip list'))
print('\nPerforming sample read .... This will eventually \"Time out\": ')
data = ""
data = task.read()
print(data)
END OF CODE:
ERROR reported:
Traceback (most recent call last):
File "C:/Users/dupontdev/Desktop/j4.py", line 21, in <module>
data = task.read()
File "C:\Users\dupontdev\PycharmProjects\Tests\venv\lib\site-packages\nidaqmx\task.py", line 691, in read
samples_read = _read_counter_f_64_ex(
File "C:\Users\dupontdev\PycharmProjects\Tests\venv\lib\site-packages\nidaqmx\_task_modules\read_functions.py", line 349, in _read_counter_f_64_ex
check_for_error(error_code)
File "C:\Users\dupontdev\PycharmProjects\Tests\venv\lib\site-packages\nidaqmx\errors.py", line 127, in check_for_error
raise DaqError(error_buffer.value.decode("utf-8"), error_code)
nidaqmx.errors.DaqError: Specified operation did not complete, because the specified timeout expired.
Task Name: _unnamedTask<0>
Status Code: -200474
SYSTEM CONFIGURATION (PHYSICAL)
NIMax device tree:
NI PCI-6602 "Dev1"
0: NI BNC-22121 "BNC-2121/Dev1/0"
I have two Oehler Model 57 Infrared Screens
attached via BNC to the BNC 2121 block at
PFI-37 for screen 1
PFI-38 for screen 2
Solved! Go to Solution.
11-08-2019 04:35 PM - edited 11-08-2019 04:39 PM
The code DOES work, The reported problem was due to insufficient pre-conditioning of data for the sensor that was attached. (Nothing wrong with the code)