Jump to content

How to manipulate Scaled Data


km4hr

Recommended Posts

I am receiving eight streams of data from from an analog input device in the form of "Scaled Data". I am able to plot these eight streams of data in a chart. However I want to perform calculations on each stream of analog data before plotting. For example, let's say I want to add a bias of 1 to the first stream of data values, a bias of 2 to the second, and so forth, before plotting. How do break out each individual stream of values for use in calculations?

It seems to me, a brand new labview programmer, that a Formula Node would do the trick if I knew how to split out each of the eight input values into an array. Of course after I did that I would then need to re-assemble the result back into a Scaled Data stream for charting.

I've been trying to do this using arrays in a Formula Node but I just can't get it to work. Is it possible to do this in labview? Can anyone point me in the right direction?

I've noticed that there are two forms of the Formula Node. One is found on the Block Diagram as follows;

Functions -> Arithmetic & Comparisions -> Formulas

The other Formula Node is found as follows:

Programming -> Structures -> y=f(x)

The Formula Node found in Formulas is able to accept the entire Scaled Data stream and perform calculations on all eight data streams and return a Scaled Data stream for charting. But I need to perform a different calculation on each of the 8 streams of analog data. Is that possible? How is it done?

thanks

Link to comment

Hi km4hr,

there are more efficient ways to deal with arrays and matrices in LabVIEW than to use a Formula Node.

I've simulated a Scaled Data stream with two channels (Black Box) and the video shows you where to look for when you want to play with nD-arrays. There is a lot to learn in the Array and Numeric palettes alone, and my demo is just the tip of the iceberg.

Break out your individual streams using "Index Array", apply a customized function to each streams and put them back together by "building arrays".

Link to comment

normandinf,

Wow! What a fantastic reply! Thank you VERY much. I learned more from this post than I've been able to find in days of searching.

QUOTE (normandinf @ Oct 14 2008, 06:10 PM)

Hi km4hr,

there are more efficient ways to deal with arrays and matrices in LabVIEW than to use a Formula Node.

I've simulated a Scaled Data stream with two channels (Black Box) and the video shows you where to look for when you want to play with nD-arrays. There is a lot to learn in the Array and Numeric palettes alone, and my demo is just the tip of the iceberg.

Break out your individual streams using "Index Array", apply a customized function to each streams and put them back together by "building arrays".

Link to comment

QUOTE (km4hr @ Oct 15 2008, 08:41 AM)

normandinf,

Wow! What a fantastic reply! Thank you VERY much. I learned more from this post than I've been able to find in days of searching.

You're welcome.

You can continue your findings about those functions by using the context help of LabVIEW. Press Ctrl-H and hover your mouse over any functions in the palettes to find out what they are, what they do and what it takes to wire them. A more detailed help link is provided with all native LabVIEW icons.

Link to comment

QUOTE (normandinf @ Oct 14 2008, 06:10 PM)

Hi km4hr,

there are more efficient ways to deal with arrays and matrices in LabVIEW than to use a Formula Node.

I've simulated a Scaled Data stream with two channels (Black Box) and the video shows you where to look for when you want to play with nD-arrays. There is a lot to learn in the Array and Numeric palettes alone, and my demo is just the tip of the iceberg.

Break out your individual streams using "Index Array", apply a customized function to each streams and put them back together by "building arrays".

Actually using a For Loop with autoindexing would be quite a bit more efficient than using Index Array and Build Array. If you would need different operations on different indices you could still implement the operations in a case structure wired to the loop index counter.

Rolf Kalbermatter

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.