FlexLogger

cancel
Showing results for 
Search instead for 
Did you mean: 

Having trouble making plugin to consume and produce data. Can we please have a simple "get latest value from FlexLogger channel" function?

I've had a lot of trouble making a plugin which consumes data from other FlexLogger chans and uses it to produce data.

 

The "produce data" aspect of the plugin works without issues. As soon as I try to read other channel's data it causes FlexLogger to overflow a buffer which causes extreme lag, or the "consume data" channel just flickers erratically between 0 and the actual value.

 

I've tried many combinations of resample timing, stream timing and plugin timing.

 

All I need is the latest value of a FlexLogger channel...

 

Channel data is at 100Hz. It is only a single channel.

 

In Initialize.vi:

  • SET RESAMP
    • Mode = Custom rate or minimum or no resampling
  • SET PLUGIN TIMING
    • Mode = when data ready or immediate
    • If I select "immediate," my Process.vi has a function to control the loop rate.

In Configure session.vi:

  • SET STREAM TIMING
    • set t0 and dt for producer channels

In Process.vi:

  • READ 1D WAVEFORM
    • Get waveform, extract Y data array and calculate mean.
    • Feed this value into my "produce data" function.

My "produce data" function controls an external instrument according to the value which I need to get from another analog channel, then feeds back into the "produce data" channels of the plugin. It works absolutely fine when I feed it a value from a "setpoint" channel instead.

 

Does any one have any tips or tricks to get a proper "consume and produce data" plugin working?

0 Kudos
Message 1 of 4
(1,801 Views)

In Initialize.vi, I set "Plugin Timing" to "On data ready"  and these are the responses I get when changing resampling to the following:

 

Minimum = buffer overflow (appears to be independant of block size and drift tolerance)

Custom = buffer overflow (appears to be independant of block size and drift tolerance)

No resampling = value flickering between actual value and null, plugin starts lagging.

 

The flickering causes issues with my produce data plugin. I can likely just ignore useless values, but that doesn't solve the problem of the severe lag...

0 Kudos
Message 2 of 4
(1,756 Views)

Have you tried the shipping example for Perform Calculation? If you open LabVIEW and go to File>>Create Project and select FlexLogger IO Plugin and choose this option:

Brad_0-1620825482247.png

It should be a good starting point. If channel data is at 100Hz, how fast does your "produce data" function operate? Can it keep up with the incoming data? If you're still having problems, please provide a sample plugin that doesn't require 3rd party HW to simulate the problem you are having, and I would be more than happy to take a look.

 

Thanks,

Brad

0 Kudos
Message 3 of 4
(1,715 Views)

Thanks Brad, appreciate you spending the time to help me out.

 

I used the "Perform Calculation" template as a starting point. The issue I found is that this relies on the producer channels having the same dt and t0 as the consumer channels. I was hoping to have a customizable dt for the producer channels so that a user can specify what rate to communicate with the hardware. I can do this with the "Set Stream Timing" block, and having Process.vi control the timing.

 

A simple "get latest value from channel" would solve this because then I would not need to sync the time properties of the consumer and producers. 

 

The 3rd party hardware takes between 6-10ms to receive and send the serial data per loop.

 

I'll build a simplified version of the plugin to share here.

 

Thanks again,

James

0 Kudos
Message 4 of 4
(1,702 Views)