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

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

 

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.

 Share