03-10-2026 03:46 AM
Hello,
I’m working with the FlexLogger Python automation API (niflexlogger-automation) to read measurements from multiple channels in a FlexLogger project.
I created a small wrapper around the API where sensors are mapped to channel names, and then I periodically read all sensor values. The issue I’m encountering is that reading all channels takes significantly longer than expected.
Context
The FlexLogger automation API exposes the following method to read measurements:
channel_value = channel_specification.get_channel_value(channel_name)
value = channel_value.value
As far as I can see in the documentation, there is no function that allows retrieving multiple channel values in a single call. The only available approach seems to be calling get_channel_value() once per channel.
Example of what I currently do
def read_all(self):
return {
name: sensor.read()
for name, sensor in self._sensors.items()
}
Each sensor.read() internally calls:
self._channel_specification.get_channel_value(channel_name).value
Problem
When reading multiple channels (around ~15–20), the total time for read_all() can reach ~2–3 seconds. Profiling shows that most of the time is spent inside the repeated get_channel_value() calls.
Since the API only allows reading one channel per call, this results in many sequential calls to the FlexLogger automation interface.
Questions
Is there a way in the FlexLogger automation API to read multiple channel values in a single call?
Is there a recommended pattern for efficiently polling many channels from FlexLogger?
Is this latency expected due to the automation/COM interface?
Would using a different API (e.g., NI SystemLink, TDMS streaming, etc.) be more appropriate for frequent polling?
Any suggestions or best practices would be greatly appreciated.
Thanks!
03-10-2026 05:05 AM