def ai_max_multi_chan_rate(self):
"""
float: Indicates the maximum sampling rate for an analog input
task from this device. To find the maximum rate for the
task, take the minimum of **ai_max_single_chan_rate** or the
indicated sampling rate of this device divided by the number
of channels to acquire data from (including cold-junction
compensation and autozero channels).
"""
val = ctypes.c_double()
cfunc = lib_importer.windll.DAQmxGetDevAIMaxMultiChanRate
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value
python类POINTER的实例源码
def ai_max_single_chan_rate(self):
"""
float: Indicates the maximum rate for an analog input task if
the task contains only a single channel from this device.
"""
val = ctypes.c_double()
cfunc = lib_importer.windll.DAQmxGetDevAIMaxSingleChanRate
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value
def ai_min_rate(self):
"""
float: Indicates the minimum rate for an analog input task on
this device. NI-DAQmx returns a warning or error if you
attempt to sample at a slower rate.
"""
val = ctypes.c_double()
cfunc = lib_importer.windll.DAQmxGetDevAIMinRate
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value
def ai_simultaneous_sampling_supported(self):
"""
bool: Indicates if the device supports simultaneous sampling.
"""
val = c_bool32()
cfunc = (lib_importer.windll.
DAQmxGetDevAISimultaneousSamplingSupported)
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(c_bool32)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value
def ai_trig_usage(self):
"""
List[:class:`nidaqmx.constants.TriggerUsage`]: Indicates the
triggers supported by this device for an analog input task.
"""
val = ctypes.c_int()
cfunc = lib_importer.windll.DAQmxGetDevAITrigUsage
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_int)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return enum_bitfield_to_list(
val.value, _TriggerUsageTypes, TriggerUsage)
def ao_max_rate(self):
"""
float: Indicates the maximum analog output rate of the device.
"""
val = ctypes.c_double()
cfunc = lib_importer.windll.DAQmxGetDevAOMaxRate
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value
def ao_min_rate(self):
"""
float: Indicates the minimum analog output rate of the device.
"""
val = ctypes.c_double()
cfunc = lib_importer.windll.DAQmxGetDevAOMinRate
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value
def ao_samp_clk_supported(self):
"""
bool: Indicates if the device supports the sample clock timing
type for analog output tasks.
"""
val = c_bool32()
cfunc = lib_importer.windll.DAQmxGetDevAOSampClkSupported
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(c_bool32)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value
def ao_trig_usage(self):
"""
List[:class:`nidaqmx.constants.TriggerUsage`]: Indicates the
triggers supported by this device for analog output tasks.
"""
val = ctypes.c_int()
cfunc = lib_importer.windll.DAQmxGetDevAOTrigUsage
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_int)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return enum_bitfield_to_list(
val.value, _TriggerUsageTypes, TriggerUsage)
def bus_type(self):
"""
:class:`nidaqmx.constants.BusType`: Indicates the bus type of
the device.
"""
val = ctypes.c_int()
cfunc = lib_importer.windll.DAQmxGetDevBusType
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_int)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return BusType(val.value)
def ci_max_size(self):
"""
int: Indicates in bits the size of the counters on the device.
"""
val = ctypes.c_uint()
cfunc = lib_importer.windll.DAQmxGetDevCIMaxSize
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_uint)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value
def ci_max_timebase(self):
"""
float: Indicates in hertz the maximum counter timebase
frequency.
"""
val = ctypes.c_double()
cfunc = lib_importer.windll.DAQmxGetDevCIMaxTimebase
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value
def ci_samp_clk_supported(self):
"""
bool: Indicates if the device supports the sample clock timing
type for counter input tasks.
"""
val = c_bool32()
cfunc = lib_importer.windll.DAQmxGetDevCISampClkSupported
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(c_bool32)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value
def ci_trig_usage(self):
"""
List[:class:`nidaqmx.constants.TriggerUsage`]: Indicates the
triggers supported by this device for counter input tasks.
"""
val = ctypes.c_int()
cfunc = lib_importer.windll.DAQmxGetDevCITrigUsage
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_int)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return enum_bitfield_to_list(
val.value, _TriggerUsageTypes, TriggerUsage)
def co_max_size(self):
"""
int: Indicates in bits the size of the counters on the device.
"""
val = ctypes.c_uint()
cfunc = lib_importer.windll.DAQmxGetDevCOMaxSize
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_uint)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value
def co_samp_clk_supported(self):
"""
bool: Indicates if the device supports Sample Clock timing for
counter output tasks.
"""
val = c_bool32()
cfunc = lib_importer.windll.DAQmxGetDevCOSampClkSupported
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(c_bool32)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value
def co_trig_usage(self):
"""
List[:class:`nidaqmx.constants.TriggerUsage`]: Indicates the
triggers supported by this device for counter output tasks.
"""
val = ctypes.c_int()
cfunc = lib_importer.windll.DAQmxGetDevCOTrigUsage
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_int)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return enum_bitfield_to_list(
val.value, _TriggerUsageTypes, TriggerUsage)
def compact_daq_slot_num(self):
"""
int: Indicates the slot number in which this module is located
in the CompactDAQ chassis.
"""
val = ctypes.c_uint()
cfunc = lib_importer.windll.DAQmxGetDevCompactDAQSlotNum
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_uint)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value
def dev_is_simulated(self):
"""
bool: Indicates if the device is a simulated device.
"""
val = c_bool32()
cfunc = lib_importer.windll.DAQmxGetDevIsSimulated
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(c_bool32)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value
def dev_serial_num(self):
"""
int: Indicates the serial number of the device. This value is
zero if the device does not have a serial number.
"""
val = ctypes.c_uint()
cfunc = lib_importer.windll.DAQmxGetDevSerialNum
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.POINTER(ctypes.c_uint)]
error_code = cfunc(
self._name, ctypes.byref(val))
check_for_error(error_code)
return val.value