Jump to content

Dealing with continuous 2D data & Filter reentrancy


Kevin P

Recommended Posts

Looking for reasonably elegant solution. Will be acquiring multiple channels from data acq boards at same rate (shared clock). Would like to perform software lowpass filtering on each channel, but do not know # of channels at design time. Will be processing data continuously and cannot accept the transient effect of using the 'init = True' input on every call to the filter function. Will need to use the reentrancy of the filter vi's so that each channel uses its own instance and maintains state between calls.

So, the problem is that there's a simple and elegant approach (of auto-indexing the 2D array on a For Loop to extract the channels, then feeding the 1D rows to a filter vi inside the loop) that happens not to work right. I need a separate instance of the filter vi for each channel, but won't know how many I need to instantiate until run time.

My working plan is that on the first call to my 2D array processing routine, I would auto-index the 2D array and use VI Server to open refnums to the reentrant 1D filter function, 1 refnum per data acq channel. On subsequent calls, the array of refnums could be autoindexed with the 2D array to keep specific channels synced with their filter instance. (Note: # of channels can't change *within* a test run). It feels pretty clunky though, and I'll also have to add some further auxiliary code to deal with cleanup operations like closing the refs.

Any better, more elegant approaches than this? Any obvious problems with my working plan, if nothing better comes around? Would this be a good use case for LVOOP? If so, maybe this will serve as an incentive to check it out, but I doubt I've got enough learning curve time available for immediate use.

-Kevin P.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.