Python daqmx client workflow question #1146
-
|
My workflow for using Python as a client is to copy the proto file from this repo into my own and then generate that into nidaqmx_pb2. My issue with that is I already have a proto codegen process for our client/server code and these protos don't make a ton of sense to add in with our code. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Ping on this. Not sure who might know. |
Beta Was this translation helpful? Give feedback.
-
|
@rdecarreau, I apologize for the extremely delayed response. The nidaqmx Python package supports proxying DAQmx API calls to NI gRPC Device Server. To use this feature, specify Example: import grpc
import nidaqmx
from nidaqmx.constants import AcquisitionType, READ_ALL_AVAILABLE
with grpc.insecure_channel("localhost:31763") as channel:
with nidaqmx.Task(grpc_options=nidaqmx.GrpcSessionOptions(channel, "")) as task:
task.ai_channels.add_ai_voltage_chan("Dev1/ai0")
task.timing.cfg_samp_clk_timing(1000.0, sample_mode=AcquisitionType.FINITE, samps_per_chan=50)
data = task.read(READ_ALL_AVAILABLE)
print("Acquired data: [" + ", ".join(f"{value:f}" for value in data) + "]") |
Beta Was this translation helpful? Give feedback.
@rdecarreau, I apologize for the extremely delayed response.
The nidaqmx Python package supports proxying DAQmx API calls to NI gRPC Device Server. To use this feature, specify
grpc_optionswhen you construct thenidaqmx.Taskobject.Example: