Skip to content

Commit

Permalink
Moniker streaming functions return standard reponse message instead o…
Browse files Browse the repository at this point in the history
…f custom data type (#1122)

### What does this Pull Request accomplish?
- Values returned from streaming APIs are now in `<function-name>StreamingResponse` message.
- Most of the custom codegen written for Moniker APIs was needed because output was not in standard "response" message. With this change, I was able to delete most of the custom codegen written for streaming functionality.

### Why should this Pull Request be merged?
Moniker functions used for streaming data to/from clients used to return custom data types defined in `custom_proto.mako` file for DAQ and FPGA. This has multiple limitations.
- The custom types had only one field `value` for streaming. Read APIs with multiple out parameters need multiple values in response.
- Response was not provided in standard `<function-name>Response` message that other grpc APIs use.


### What testing has been done?
- Existing integration tests for FPGA streaming APIs pass.
- Executed sample client tests with StreamRead/StreamWrite and validated results.
  • Loading branch information
doshirohan authored Nov 26, 2024
1 parent e991a87 commit 4f6e50c
Show file tree
Hide file tree
Showing 11 changed files with 1,652 additions and 913 deletions.
170 changes: 170 additions & 0 deletions generated/nidaqmx/nidaqmx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8518,6 +8518,12 @@ message BeginReadAnalogF64Response {
ni.data_monikers.Moniker moniker = 2;
}

message ReadAnalogF64StreamingResponse {
int32 status = 1;
repeated double read_array = 2;
int32 samps_per_chan_read = 3;
}

message ReadAnalogScalarF64Request {
nidevice_grpc.Session task = 1;
double timeout = 2;
Expand All @@ -8538,6 +8544,11 @@ message BeginReadAnalogScalarF64Response {
ni.data_monikers.Moniker moniker = 2;
}

message ReadAnalogScalarF64StreamingResponse {
int32 status = 1;
double value = 2;
}

message ReadBinaryI16Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -8571,6 +8582,12 @@ message BeginReadBinaryI16Response {
ni.data_monikers.Moniker moniker = 2;
}

message ReadBinaryI16StreamingResponse {
int32 status = 1;
repeated int32 read_array = 2;
int32 samps_per_chan_read = 3;
}

message ReadBinaryI32Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -8604,6 +8621,12 @@ message BeginReadBinaryI32Response {
ni.data_monikers.Moniker moniker = 2;
}

message ReadBinaryI32StreamingResponse {
int32 status = 1;
repeated int32 read_array = 2;
int32 samps_per_chan_read = 3;
}

message ReadBinaryU16Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -8637,6 +8660,12 @@ message BeginReadBinaryU16Response {
ni.data_monikers.Moniker moniker = 2;
}

message ReadBinaryU16StreamingResponse {
int32 status = 1;
repeated uint32 read_array = 2;
int32 samps_per_chan_read = 3;
}

message ReadBinaryU32Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -8670,6 +8699,12 @@ message BeginReadBinaryU32Response {
ni.data_monikers.Moniker moniker = 2;
}

message ReadBinaryU32StreamingResponse {
int32 status = 1;
repeated uint32 read_array = 2;
int32 samps_per_chan_read = 3;
}

message ReadCounterF64Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand All @@ -8695,6 +8730,12 @@ message BeginReadCounterF64Response {
ni.data_monikers.Moniker moniker = 2;
}

message ReadCounterF64StreamingResponse {
int32 status = 1;
repeated double read_array = 2;
int32 samps_per_chan_read = 3;
}

message ReadCounterF64ExRequest {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -8728,6 +8769,12 @@ message BeginReadCounterF64ExResponse {
ni.data_monikers.Moniker moniker = 2;
}

message ReadCounterF64ExStreamingResponse {
int32 status = 1;
repeated double read_array = 2;
int32 samps_per_chan_read = 3;
}

message ReadCounterScalarF64Request {
nidevice_grpc.Session task = 1;
double timeout = 2;
Expand All @@ -8748,6 +8795,11 @@ message BeginReadCounterScalarF64Response {
ni.data_monikers.Moniker moniker = 2;
}

message ReadCounterScalarF64StreamingResponse {
int32 status = 1;
double value = 2;
}

message ReadCounterScalarU32Request {
nidevice_grpc.Session task = 1;
double timeout = 2;
Expand All @@ -8768,6 +8820,11 @@ message BeginReadCounterScalarU32Response {
ni.data_monikers.Moniker moniker = 2;
}

message ReadCounterScalarU32StreamingResponse {
int32 status = 1;
uint32 value = 2;
}

message ReadCounterU32Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand All @@ -8793,6 +8850,12 @@ message BeginReadCounterU32Response {
ni.data_monikers.Moniker moniker = 2;
}

message ReadCounterU32StreamingResponse {
int32 status = 1;
repeated uint32 read_array = 2;
int32 samps_per_chan_read = 3;
}

message ReadCounterU32ExRequest {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -8826,6 +8889,12 @@ message BeginReadCounterU32ExResponse {
ni.data_monikers.Moniker moniker = 2;
}

message ReadCounterU32ExStreamingResponse {
int32 status = 1;
repeated uint32 read_array = 2;
int32 samps_per_chan_read = 3;
}

message ReadCtrFreqRequest {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -8951,6 +9020,11 @@ message BeginReadDigitalScalarU32Response {
ni.data_monikers.Moniker moniker = 2;
}

message ReadDigitalScalarU32StreamingResponse {
int32 status = 1;
uint32 value = 2;
}

message ReadDigitalU16Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -8984,6 +9058,12 @@ message BeginReadDigitalU16Response {
ni.data_monikers.Moniker moniker = 2;
}

message ReadDigitalU16StreamingResponse {
int32 status = 1;
repeated uint32 read_array = 2;
int32 samps_per_chan_read = 3;
}

message ReadDigitalU32Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -9017,6 +9097,12 @@ message BeginReadDigitalU32Response {
ni.data_monikers.Moniker moniker = 2;
}

message ReadDigitalU32StreamingResponse {
int32 status = 1;
repeated uint32 read_array = 2;
int32 samps_per_chan_read = 3;
}

message ReadDigitalU8Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -10405,6 +10491,11 @@ message BeginWaitForNextSampleClockResponse {
ni.data_monikers.Moniker moniker = 2;
}

message WaitForNextSampleClockStreamingResponse {
int32 status = 1;
bool is_late = 2;
}

message WaitForValidTimestampRequest {
nidevice_grpc.Session task = 1;
oneof timestamp_event_enum {
Expand Down Expand Up @@ -10461,6 +10552,15 @@ message BeginWriteAnalogF64Response {
ni.data_monikers.Moniker moniker = 2;
}

message WriteAnalogF64StreamingRequest {
repeated double write_array = 1;
}

message WriteAnalogF64StreamingResponse {
int32 status = 1;
int32 samps_per_chan_written = 2;
}

message WriteAnalogScalarF64Request {
nidevice_grpc.Session task = 1;
bool auto_start = 2;
Expand All @@ -10483,6 +10583,14 @@ message BeginWriteAnalogScalarF64Response {
ni.data_monikers.Moniker moniker = 2;
}

message WriteAnalogScalarF64StreamingRequest {
double value = 1;
}

message WriteAnalogScalarF64StreamingResponse {
int32 status = 1;
}

message WriteBinaryI16Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -10516,6 +10624,15 @@ message BeginWriteBinaryI16Response {
ni.data_monikers.Moniker moniker = 2;
}

message WriteBinaryI16StreamingRequest {
repeated int32 write_array = 1;
}

message WriteBinaryI16StreamingResponse {
int32 status = 1;
int32 samps_per_chan_written = 2;
}

message WriteBinaryI32Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -10549,6 +10666,15 @@ message BeginWriteBinaryI32Response {
ni.data_monikers.Moniker moniker = 2;
}

message WriteBinaryI32StreamingRequest {
repeated int32 write_array = 1;
}

message WriteBinaryI32StreamingResponse {
int32 status = 1;
int32 samps_per_chan_written = 2;
}

message WriteBinaryU16Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -10582,6 +10708,15 @@ message BeginWriteBinaryU16Response {
ni.data_monikers.Moniker moniker = 2;
}

message WriteBinaryU16StreamingRequest {
repeated uint32 write_array = 1;
}

message WriteBinaryU16StreamingResponse {
int32 status = 1;
int32 samps_per_chan_written = 2;
}

message WriteBinaryU32Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -10615,6 +10750,15 @@ message BeginWriteBinaryU32Response {
ni.data_monikers.Moniker moniker = 2;
}

message WriteBinaryU32StreamingRequest {
repeated uint32 write_array = 1;
}

message WriteBinaryU32StreamingResponse {
int32 status = 1;
int32 samps_per_chan_written = 2;
}

message WriteCtrFreqRequest {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -10744,6 +10888,14 @@ message BeginWriteDigitalScalarU32Response {
ni.data_monikers.Moniker moniker = 2;
}

message WriteDigitalScalarU32StreamingRequest {
uint32 value = 1;
}

message WriteDigitalScalarU32StreamingResponse {
int32 status = 1;
}

message WriteDigitalU16Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -10777,6 +10929,15 @@ message BeginWriteDigitalU16Response {
ni.data_monikers.Moniker moniker = 2;
}

message WriteDigitalU16StreamingRequest {
repeated uint32 write_array = 1;
}

message WriteDigitalU16StreamingResponse {
int32 status = 1;
int32 samps_per_chan_written = 2;
}

message WriteDigitalU32Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down Expand Up @@ -10810,6 +10971,15 @@ message BeginWriteDigitalU32Response {
ni.data_monikers.Moniker moniker = 2;
}

message WriteDigitalU32StreamingRequest {
repeated uint32 write_array = 1;
}

message WriteDigitalU32StreamingResponse {
int32 status = 1;
int32 samps_per_chan_written = 2;
}

message WriteDigitalU8Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down
Loading

0 comments on commit 4f6e50c

Please sign in to comment.