Info | Data types for NI Python APIs |
---|---|
Author | National Instruments |
The nitypes
Python package defines data types for NI Python APIs:
- Analog and complex waveforms
- Frequency spectrums
- Complex integers
- Time conversion
NI created and supports this package.
See the API Reference.
nitypes
supports Windows and Linux operating systems.
nitypes
supports CPython 3.9+ and PyPy3.
Installing NI driver Python APIs that support waveforms will automatically install nitypes
.
You can also directly install the nitypes
package using pip
or by listing it as a dependency in
your project's pyproject.toml
file.
The nitypes.waveform.AnalogWaveform
class represents a single analog signal with timing
information and extended properties (such as channel name and units). Multi-channel analog data is
represented using a collection of waveforms, such as list[nitypes.waveform.AnalogWaveform]
. For
more details, see Analog
Waveforms
in the API Reference.
The nitypes.waveform.ComplexWaveform
class represents a complex-number signal, such as I/Q data,
with timing information and extended properties (such as channel name and units). For more details,
see Complex
Waveforms
in the API Reference.
The nitypes.waveform.Spectrum
class represents a frequency spectrum with frequency range
information and extended properties (such as channel name and units). For more details, see
Frequency
Spectrums
in the API Reference.
nitypes.complex.ComplexInt32DType
is a NumPy structured data type object representing a complex
integer with 16-bit real
and imag
fields. This structured data type has the same memory layout
as the NIComplexI16 C struct used by NI driver APIs. For more details, see Complex
Integers
in the API Reference.
You can use the nitypes.complex.convert_complex()
function to convert complex-number NumPy arrays
between nitypes.complex.ComplexInt32DType
and the standard np.complex64
and np.complex128
data
types. For more details, see Complex >>
Conversion
in the API Reference.
You can use the nitypes.time.convert_datetime()
and nitypes.time.convert_timedelta()
functions
to convert time values between the standard datetime
library and the high-precision hightime
library.For more details, see Time >>
Conversion in
the API Reference.