Jump to content

Recommended Posts

Hello,

 

My project involves filling a data table with real time data, and in order to progress through the experiment it needs to read the last 100 values recorded, sort them, and then get the resultant range. So I only need to read the last 100 values of the column I am currently fillling up during the program, but I only see a function that copies the entire row to a vector. This wouldn't work as the column has more numbers than the MI memory has operands. Is there any way to only put part of a column into a vector?

 

Thanks in advance!

Share this post


Link to post
Share on other sites

Why not determine the range as you go? Simply check each new number to be greater than the last highest number or less than the last lowest number and if true store it for the next check.

Share this post


Link to post
Share on other sites

Normally that would work, but not in this case because the experiment is highly sensitive and the instruments are likely to have some noise associated with them. You might get an abnormally large or small run which would throw off the range if it was taking every one into account. The way I have gotten around this is to store the 100 values into a vector, sort them from smallest to largest, cut off the top and bottom 5% (to remove extreme outliers), and then get the range from the higest and lowest one in the set.

Share this post


Link to post
Share on other sites

In that case, create another Data Table with a single column and only 100 rows. Send the data to this table also, shifting the entire table down one row prior to each entry. This will maintain the last 100 data points and allow you to read them out into 100 MIs when you want to do your range calculation.

Share this post


Link to post
Share on other sites

In addition to the above solutions, there also is a read column function block that will allow you to copy a given number of rows into a vector of operands. The benefit of using this function blocks is that you can then use the vector tools within the logic.

  • Upvote 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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