Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to run nifgen example - probable resource name issue

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.

0 Kudos
Message 1 of 2
(939 Views)

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.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 2
(922 Views)