-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error getting string size #39
Comments
This is a bug that should be corrected : by default all the functions are supposed to return an error code. An exception was made to a generic case of function (see DAQmxFunctions.py the catch_error function) but not to DAQmxGetSystemInfoAttribute You should be able to get your attribute by passing a long enough string ( Second options : use the
|
I was working on trying to record multiple channel data from NI 9220. It from ctypes import * class NI_9220:
numChannels,comments=""):
self.pydaqTask.CreateAIVoltageChan(channels,"",pydaq.DAQmx_Val_Cfg_Default,-10.0,10.0,pydaq.DAQmx_Val_Volts,None) self.pydaqTask.CfgSampClkTiming("",fs,pydaq.DAQmx_Val_Rising,pydaq.DAQmx_Val_ContSamps,1)
args=(self.event,))
self.pydaqTask.ReadAnalogF64(-1,10.0,pydaq.DAQmx_Val_GroupByChannel,data,self.fs_self.numChannels,byref(read),None)
(self.filename,os.path.getsize(self.filename)))
analog=NI_9220() On Mon, Sep 19, 2016 at 8:20 AM, Pierre Cladé [email protected]
|
I was looking for a forum to post this question but could not find one.
I am trying to get size of string for the device names using the following function. I copied from a NI C++ example.
import ctypes
import PyDAQmx as pydaq
import numpy as np
n=pydaq.DAQmxGetSystemInfoAttribute(pydaq.DAQmx_Sys_DevNames,None)
I get the following error:
Traceback (most recent call last):
File "C:\HMRI\Calorimeter\python\main.py", line 9, in
print pydaq.DAQmxGetSystemInfoAttribute(pydaq.DAQmx_Sys_DevNames,None)
File "", line 2, in function
File "C:\Anaconda2\lib\site-packages\PyDAQmx\DAQmxFunctions.py", line 34, in mafunction
raise DAQError(error,errBuff.value.decode("utf-8"), f.name)
PyDAQmx.DAQmxFunctions.DAQError: NI-488: Interface has lost power.
in function DAQmxGetSystemInfoAttribute
The text was updated successfully, but these errors were encountered: