Jump to content

Only copy part of a Data Table column to a vector?


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!

Link to comment
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.

Link to comment
Share on other sites

  • MVP 2023

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.

Link to comment
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...