08-14-2022 10:38 AM
Dear community.
I am trying to run nifgen example on USB-6366 sampler.
My code:
import nifgen
import time
with nifgen.Session(resource_name='DAQ::1', channel_name='Ao0') as session:
session.output_mode = nifgen.OutputMode.FUNC
session.configure_standard_waveform(waveform=nifgen.Waveform.SINE, amplitude=1.0,
frequency=10e3, dc_offset=0.0, start_phase=0.0)
with session.initiate():
time.sleep(10)
Errors:
Traceback (most recent call last):
File "C:\NI\nifgen_sin.py", line 4, in <module>
with nifgen.Session(resource_name='DAQ::1', channel_name='Ao0') as session:
File "C:\NI\venv\lib\site-packages\nifgen\session.py", line 3188, in __init__
self._library = _library_singleton.get()
File "C:\NI\venv\lib\site-packages\nifgen\_library_singleton.py", line 50, in get
ctypes_library = ctypes.CDLL(_get_library_name())
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 364, in __init__
if '/' in name or '\\' in name:
TypeError: argument of type 'NonType' is not iterable
I guess that I do not specify valid resource name. When running nidaqmx I use 'Dev1' to call the instrument, 'Dev1/Ao0' to call a channel.
Very appreciating your help.
Leonid.
08-14-2022 01:25 PM
It is because you're using an incorrect driver (like operating a Toyota car with a Honda car key).
USB-6366 uses DAQmx driver and not niFGen driver. BTW, I am curious to know how you assumed it is an FGen.