Skip to content
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5e53c36
Enhance NIDAQmx API with waveform support and additional metadata
Oct 16, 2025
fff7769
fix lint
Oct 16, 2025
01ea5e9
fix validate_examples
Oct 16, 2025
1270fd7
ReadAnalogWaveforms implementation (untested, but compiles)
Oct 16, 2025
836c408
add tests
Oct 16, 2025
b9cf67a
Add support for creating two AI voltage channels in tests
Oct 20, 2025
12ca5e5
cleanup
Oct 20, 2025
8e5eb77
cleanup CMakeLists.txt
Oct 20, 2025
7b50a84
attempt fix for ubuntu build
Oct 20, 2025
3d29cbc
more verbose build output
Oct 20, 2025
9b26670
Try some different build settings
Oct 20, 2025
d117ec2
add quotes to fix cmake flags
Oct 20, 2025
23a6e98
add sampsPerChanRead to ReadAnalogWaveforms response
Oct 22, 2025
1577116
revert changes in build_cmake.yml and do -fno-var-tracking-assignment…
Oct 22, 2025
c03a50d
use GCC push_options
Oct 22, 2025
4c36ac8
use -fno-var-tracking-assignments globally for gcc
Oct 22, 2025
e7055d1
fix timing conversion
Oct 22, 2025
5aa982d
add ReadDigitalWaveforms RPC with stub implementation
Oct 23, 2025
a765c94
implementation and tests for single channel
Oct 23, 2025
26c1608
test multi channel and multi line
Oct 23, 2025
0b45f4b
add copilot instructions for how to build with ninja, and do some cle…
Oct 23, 2025
ec3e076
fix data layout
Oct 23, 2025
ae53b1c
brad's feedback
Oct 24, 2025
9c0c333
copy protobuf types protos to heirarchical location
Oct 24, 2025
85d899b
Merge branch 'users/mprosser/task-3424627-read-analog-waveforms' into…
Oct 24, 2025
c56bd62
fix merge and templatize the SetWfmAttrCallback
Oct 24, 2025
95f15c2
copilot-build.ps1
Oct 24, 2025
e3109e7
handle epoch difference (note - SecondsFrom0001EpochTo1904Epoch value…
Oct 24, 2025
7b90ab4
convert_dot_net_daqmx_ticks_to_btf_precision_timestamp
Oct 27, 2025
9f77232
fixes and cleanup
Oct 27, 2025
4f7cf86
cleanup and more test cases
Oct 27, 2025
2962d82
PrecisionTimestampConverterLiteralTests
Oct 27, 2025
50767bb
Merge branch 'users/mprosser/task-3424627-read-analog-waveforms' into…
Oct 27, 2025
4a87aa8
fix merge
Oct 27, 2025
897e6f3
remove copilot instructions (will be added in separate PR)
Oct 27, 2025
ba59257
use correct logic for NI-BTF
Oct 28, 2025
cf85e37
test cleanup
Oct 28, 2025
5df95b9
Merge branch 'users/mprosser/task-3424627-read-analog-waveforms' into…
Oct 28, 2025
3b6681f
fillMode: 1 = GROUP_BY_SCAN_NUMBER (interleaved)
Oct 28, 2025
664f03a
Merge remote-tracking branch 'origin/main' into users/mprosser/task-3…
Oct 28, 2025
1579f84
cleanup merge
Oct 28, 2025
c33446b
cleanup
Oct 28, 2025
30355e1
use waveform->mutable_y_data();
Oct 28, 2025
ca6e216
test cleanup
Oct 28, 2025
cfef232
Merge remote-tracking branch 'origin/main' into users/mprosser/task-3…
Oct 29, 2025
b40de09
Brad's feedback
Oct 30, 2025
0321106
cleanup
Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions generated/nidaqmx/nidaqmx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ service NiDAQmx {
rpc WriteToTEDSFromArray(WriteToTEDSFromArrayRequest) returns (WriteToTEDSFromArrayResponse);
rpc WriteToTEDSFromFile(WriteToTEDSFromFileRequest) returns (WriteToTEDSFromFileResponse);
rpc ReadAnalogWaveforms(ReadAnalogWaveformsRequest) returns (ReadAnalogWaveformsResponse);
rpc ReadDigitalWaveforms(ReadDigitalWaveformsRequest) returns (ReadDigitalWaveformsResponse);
}

enum BufferUInt32Attribute {
Expand Down Expand Up @@ -11535,3 +11536,19 @@ message ReadAnalogWaveformsResponse {
int32 samps_per_chan_read = 3;
}

message ReadDigitalWaveformsRequest {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
double timeout = 3;
oneof waveform_attribute_mode_enum {
WaveformAttributeMode waveform_attribute_mode = 4;
int32 waveform_attribute_mode_raw = 5;
}
}

message ReadDigitalWaveformsResponse {
int32 status = 1;
repeated ni.protobuf.types.DigitalWaveform waveforms = 2;
int32 samps_per_chan_read = 3;
}

27 changes: 27 additions & 0 deletions generated/nidaqmx/nidaqmx_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12441,5 +12441,32 @@ read_analog_waveforms(const StubPtr& stub, const nidevice_grpc::Session& task, c
return response;
}

ReadDigitalWaveformsResponse
read_digital_waveforms(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant<WaveformAttributeMode, pb::int32>& waveform_attribute_mode)
{
::grpc::ClientContext context;

auto request = ReadDigitalWaveformsRequest{};
request.mutable_task()->CopyFrom(task);
request.set_num_samps_per_chan(num_samps_per_chan);
request.set_timeout(timeout);
const auto waveform_attribute_mode_ptr = waveform_attribute_mode.get_if<WaveformAttributeMode>();
const auto waveform_attribute_mode_raw_ptr = waveform_attribute_mode.get_if<pb::int32>();
if (waveform_attribute_mode_ptr) {
request.set_waveform_attribute_mode(*waveform_attribute_mode_ptr);
}
else if (waveform_attribute_mode_raw_ptr) {
request.set_waveform_attribute_mode_raw(*waveform_attribute_mode_raw_ptr);
}

auto response = ReadDigitalWaveformsResponse{};

raise_if_error(
stub->ReadDigitalWaveforms(&context, request, &response),
context);

return response;
}


} // namespace nidaqmx_grpc::experimental::client
1 change: 1 addition & 0 deletions generated/nidaqmx/nidaqmx_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ BeginWriteRawResponse begin_write_raw(const StubPtr& stub, const nidevice_grpc::
WriteToTEDSFromArrayResponse write_to_teds_from_array(const StubPtr& stub, const std::string& physical_channel, const std::string& bit_stream, const simple_variant<WriteBasicTEDSOptions, pb::int32>& basic_teds_options);
WriteToTEDSFromFileResponse write_to_teds_from_file(const StubPtr& stub, const std::string& physical_channel, const std::string& file_path, const simple_variant<WriteBasicTEDSOptions, pb::int32>& basic_teds_options);
ReadAnalogWaveformsResponse read_analog_waveforms(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant<WaveformAttributeMode, pb::int32>& waveform_attribute_mode);
ReadDigitalWaveformsResponse read_digital_waveforms(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant<WaveformAttributeMode, pb::int32>& waveform_attribute_mode);

} // namespace nidaqmx_grpc::experimental::client

Expand Down
1 change: 1 addition & 0 deletions generated/nidaqmx/nidaqmx_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ class NiDAQmxService final : public NiDAQmx::WithCallbackMethod_RegisterSignalEv
::grpc::Status WriteToTEDSFromArray(::grpc::ServerContext* context, const WriteToTEDSFromArrayRequest* request, WriteToTEDSFromArrayResponse* response) override;
::grpc::Status WriteToTEDSFromFile(::grpc::ServerContext* context, const WriteToTEDSFromFileRequest* request, WriteToTEDSFromFileResponse* response) override;
::grpc::Status ReadAnalogWaveforms(::grpc::ServerContext* context, const ReadAnalogWaveformsRequest* request, ReadAnalogWaveformsResponse* response) override;
::grpc::Status ReadDigitalWaveforms(::grpc::ServerContext* context, const ReadDigitalWaveformsRequest* request, ReadDigitalWaveformsResponse* response) override;
private:
LibrarySharedPtr library_;
ResourceRepositorySharedPtr session_repository_;
Expand Down
76 changes: 76 additions & 0 deletions source/codegen/metadata/nidaqmx/functions_addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,76 @@
'type': 'int32'
}
]
},
'ReadDigitalWaveforms': {
'returns': 'int32',
'codegen_method': 'CustomCodeNoLibrary',
'parameters': [
{
'ctypes_data_type': 'ctypes.TaskHandle',
'direction': 'in',
'is_optional_in_python': False,
'name': 'task',
'python_data_type': 'TaskHandle',
'python_description': '',
'python_type_annotation': 'TaskHandle',
'type': 'TaskHandle'
},
{
'ctypes_data_type': 'ctypes.c_int',
'direction': 'in',
'is_optional_in_python': False,
'name': 'numSampsPerChan',
'python_data_type': 'int',
'python_description': '',
'python_type_annotation': 'int',
'type': 'int32'
},
{
'ctypes_data_type': 'ctypes.c_double',
'direction': 'in',
'is_optional_in_python': True,
'name': 'timeout',
'python_data_type': 'float',
'python_default_value': '10.0',
'python_description': 'Specifies the time in seconds to wait for the device to respond before timing out.',
'python_type_annotation': 'Optional[float]',
'type': 'float64'
},
{
'ctypes_data_type': 'ctypes.c_int',
'direction': 'in',
'enum': 'WaveformAttributeMode',
'is_optional_in_python': True,
'name': 'waveformAttributeMode',
'python_data_type': 'WaveformAttributeMode',
'python_default_value': 'WaveformAttributeMode.NONE',
'python_description': 'Specifies which waveform attributes to return with the waveforms.',
'python_type_annotation': 'Optional[nidaqmx.constants.WaveformAttributeMode]',
'type': 'int32'
},
{
'direction': 'out',
'is_optional_in_python': False,
'name': 'waveforms',
'python_data_type': 'object',
'python_description': 'The waveforms read from the specified channels.',
'python_type_annotation': 'List[object]',
'type': 'repeated ni.protobuf.types.DigitalWaveform'
},
{
'ctypes_data_type': 'ctypes.c_int',
'direction': 'out',
'is_optional_in_python': False,
'is_streaming_type': True,
'name': 'sampsPerChanRead',
'python_data_type': 'int',
'python_description': '',
'python_type_annotation': 'int',
'return_on_error_key': 'ni-samps-per-chan-read',
'type': 'int32'
}
]
}
}

Expand Down Expand Up @@ -104,6 +174,12 @@
# size is determined by the number of channels in the task
'waveforms': ['ARRAY_PARAMETER_NEEDS_SIZE']
}
},
'ReadDigitalWaveforms': {
'parameters': {
# size is determined by the number of channels in the task
'waveforms': ['ARRAY_PARAMETER_NEEDS_SIZE']
}
}
}

Expand Down
Loading