-
Notifications
You must be signed in to change notification settings - Fork 15
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
niscope_acquire_waveform example fails with "unsupported operand type(s)" error #923
Comments
DiscoveryService log:
|
I think deserialize_parameters needs another special case to convert from a protobuf repeated object to a list: |
Hmm, sample_measurement uses a type hint of Maybe niscope_acquire_waveform should do the same, and explicitly convert to @dixonjoel What do you think? |
Converting RepeatedScalarContainer to list would look something like this: diff --git a/packages/service/ni_measurement_plugin_sdk_service/_internal/parameter/decoder.py b/packages/service/ni_measurement_plugin_sdk_service/_internal/parameter/decoder.py
index b11c7cb2..277f52a0 100644
--- a/packages/service/ni_measurement_plugin_sdk_service/_internal/parameter/decoder.py
+++ b/packages/service/ni_measurement_plugin_sdk_service/_internal/parameter/decoder.py
@@ -49,6 +49,9 @@ def deserialize_parameters(
and value.ByteSize() == 0
):
parameter_values[i] = None
+ elif parameter_metadata.repeated:
+ # Convert RepeatedScalarContainer to list.
+ parameter_values[i] = list(value)
else:
parameter_values[i] = value
return parameter_values |
If we already have a pattern that works for the measurement service, I would just change this to |
Bug Report
niscope_acquire_waveform fails with this error:
This may be related to #767
Repro or Code Sample
Install example (with install_examples.py), install .env.simulation as .env, and run it.
Expected Behavior
It works.
Current Behavior
It fails with this error:

Possible Solution
Context
Your Environment
ni-measurement-plugin-sdk-service
version: 2.1.0-dev1AB#2864650
The text was updated successfully, but these errors were encountered: