Python code for Data Aqusition using NI-DAQ. Had downloaded NI-driver
Error
Traceback (most recent call last):
File "C:\Users\icon\Desktop\DAQ 1.0.py", line 68, in <module>
chan = ctypes.create_string_buffer('Dev1/ai0')
File "C:\Python34\lib\ctypes\__init__.py", line 63, in
create_string_buffer
raise TypeError(init)
TypeError: Dev1/ai0
I am a student. I was trying to code a program in Python to acquire data from NI-DAQ it raised the above error.
this is the code
imported all libraries required
nidaq = ctypes.windll.nicaiu
int32 = ctypes.c_long
uInt32 = ctypes.c_ulong
uInt64 = ctypes.c_ulonglong
float64 = ctypes.c_double
TaskHandle = uInt32
written = int32()
pointsRead = uInt32()
DAQmx_Val_Volts = 10348
DAQmx_Val_Rising = 10280
DAQmx_Val_Cfg_Default = int32(-1)
DAQmx_Val_ContSamps = 10123
DAQmx_Val_ChanForAllLines = 1
DAQmx_Val_RSE = 10083
DAQmx_Val_Volts = 10348
DAQmx_Val_GroupByScanNumber = 1
DAQmx_Val_FiniteSamps = 10178
DAQmx_Val_GroupByChannel = 0
taskHandle = TaskHandle(0)
min1 = float64(-10.0)
max1 = float64(10.0)
timeout = float64(10.0)
bufferSize = uInt32(10)
pointsToRead = bufferSize
pointsRead = uInt32()
sampleRate = float64(200.0)
samplesPerChan = uInt64(100)
#specifiy the channels
chan = ctypes.create_string_buffer('Dev1/ai0')
clockSource = ctypes.create_string_buffer('OnboardClock')