CallumSamuels Posted June 19, 2022 Share Posted June 19, 2022 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 Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted June 20, 2022 Share Posted June 20, 2022 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] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.