FlexLogger

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate summary file containing the average of all channels using Flexlogger?

Solved!
Go to solution

Could you please let me know is it possible to generate summary file containing the average of all channels for logs captured using flexlogger. This would help in analyzing the data instead of opening each log and calculating the average.

Generation of the summary file should be followed automatically after the log is captured.

0 Kudos
Message 1 of 8
(1,916 Views)

Hello,


There are a couple ways to do that:

1) Create a plugin with the FlexLogger Plug-in Development Kit that computes the average and log it as one of the signals to the TDMS file.

FlexLogger Plug-In Development Kit Download - NI

2) Use the FlexLogger Python API.

ni/niflexlogger-automation-python: The niflexlogger-automation package contains an API (Application ...

 

Using Python, you can automate FlexLogger. The upcoming version, that will be posted to github momentarily has support for events.
i.e. FlexLogger can send an event to Python to get a notification of when a log file is done writing.
In response to that event, you can use the Python TDMS package to read the log file, compute the average and save it to a new file.

0 Kudos
Message 2 of 8
(1,905 Views)

Could you please share an example of using  Python TDMS package to read the tdms log file, compute the average and save it to a new file.

0 Kudos
Message 3 of 8
(1,892 Views)

Sure! Let me write something and I'll post it soon.

0 Kudos
Message 4 of 8
(1,876 Views)

That would be really helpful!

0 Kudos
Message 5 of 8
(1,872 Views)

I forgot to mention built-in ways to have access to the channel average.

In the TDMS file, each channel has a custom property named NI_ChannelValueAverage, which may be what you're looking for.

If you want to save it to a different file, then the Python API may be what you need.

 

It is also worth noting that FlexLogger has a built-in functionality allowing you to compute a running average:

You can add it by choosing from the toolbar: Add channels>>Calculation>>Statistics>>Mean.

This will create a channel computing the running average of another channel that will be logged in the TDMS file.

 

Hope this helps.

 

Message 6 of 8
(1,845 Views)
Solution
Accepted by topic author ebenellis

If you go the Python route, you would first need to install the niflexlogger-automation package.

The Python library to manipulate tdms files is npTDMS.

Welcome to npTDMS’s documentation — npTDMS 1.7.0 documentation

I am attaching a Python script that shows how to access a channel average, after FlexLogger finishes writing the TDMS file.

 

Hope this helps. Please let me know if you have any questions.

Message 7 of 8
(1,835 Views)

Thank you, this worked!

0 Kudos
Message 8 of 8
(1,717 Views)