FlexLogger

cancel
Showing results for 
Search instead for 
Did you mean: 

FlexLogger Python Automation – Slow channel reads because API only allows single-channel access

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

  1. Is there a way in the FlexLogger automation API to read multiple channel values in a single call?

  2. Is there a recommended pattern for efficiently polling many channels from FlexLogger?

  3. Is this latency expected due to the automation/COM interface?

  4. 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!

0 Kudos
Message 1 of 2
(72 Views)
Why are you using FlexLogger to read data from DAQ into Python? why not directly use DAQmx drivers to get data in Python?
Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution
Message 2 of 2
(55 Views)