Sign in to follow this  
CallumSamuels

Removing last entry into test channel

Recommended Posts

Hi All,

I have a button that when clicked records a value and saves it in a test channel (D to A). I was wondering if I could have a separate button that I can use to remove the last entry? If so, how would I go about this? 

Thanks a lot

Callum

Share this post


Link to post
Share on other sites

No, channels were purposely designed so that you couldn't remove data from them.  It goes back to the 80's when the discovered the ozone hole.  A group was already down in Antarctica measuring ozone when another group came down, found the hole, published a paper and became famous for finding it.  The first group, that had been down there for years couldn't figure out why they hadn't seen it until they realized they had removed all the data below 50ppb because they assumed it was invalid data.  But of course, the data below 50ppb ended up being the most interesting data!

So, if you are going to want to add and remove data you really should use a global variable instead of a channel.  There is a way to do it in a channel, but I can't say how that would affect persist files or logging sets, which really are the primary reasons you would choose a channel over a variable.

Adding to a variable is the same:

myVar.addValue(5)

Removing, I just subset:

myVar = myVar[1,numrows(myvar)-1]

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this