10-15-2020 11:49 AM
Hi,
Newbie to Python for NI.
I want to generate a continuous sine wave with frequency=60 Hz and amplitude = 4V .
I want to use Python NIDAQMX for this(have NI 9269 module ,if that matters)
What is the best way to do this?
10-16-2020 03:29 AM
Hello
I can recommend the documentation of the nifgen module. I do not use it myself, but the example explains your use case.
https://nimi-python.readthedocs.io/en/master/nifgen.html#usage
Please also have a look at the documentation of the nidaqmx module.
https://nidaqmx-python.readthedocs.io/en/latest/index.html#usage
Hope it helps...
Christian
Drivetek AG
10-16-2020 09:19 AM
Thanks Drivetekag,
I tried Nifgen but somehow it does not recognize my module NI 9269. Does NIFGEN support NI9269? I want to use cDAQ2Mod2 device and port 2 . I hope I am using right syntax.Tried too many different syntaxes but failed.
Regards
11-17-2020 10:36 AM
Here is what I tried
import nifgen
import time
with nifgen.Session("cDAQ2Mod2") as session:
session.output_mode = nifgen.OutputMode.FUNC
session.configure_standard_waveform(waveform=nifgen.Waveform.SINE, amplitude=1.0, frequency=10000000, dc_offset=0.0, start_phase=0.0)
with session.initiate():
time.sleep(5)
and here is the error
nifgen.errors.DriverError: -1074134944: IVI: (Hex 0xBFFA0060) Insufficient location information or resource not present in the system.
Also tried this as third line of program instead. Did not help
with nifgen.Session("cDAQ2Mod2::1") as session:
04-11-2021 06:03 AM
I wanted to use nifgen module to generator a square wave via python, then I've met the same error as you.