kedi Posted July 29, 2021 Share Posted July 29, 2021 Please create a command to stop history update. I have a one time through sequence. After the sequence ends it may be some time till somebody notes the results. But results change even when the sequence has ended. To get around the issues that constant history updating causes, required multiple times the code and complication. Multiplying the chances for mistakes. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted July 30, 2021 Share Posted July 30, 2021 Actually it is pretty simply to implement this. Use a flag: a global variable named, say "updateHistory" which you set to 1 when you want to update and 0 when not. Then create a second channel for whichever channels you want to do this with. Type is "Test", D to A, Timing = 0. Then, in the Event for the actual channel that is getting data put: if(updateHistory) myTestChannel.AddValue(myChannel[0]) endif This will cause myTestChannel to get a copy of all values from myChannel, but only when updateHistory is non-zero. That way you can stop the update of myTestChannel by simply setting updateHistory to 0. Quote Link to comment Share on other sites More sharing options...
kedi Posted July 30, 2021 Author Share Posted July 30, 2021 I am dealing with 72 channels. It quickly becomes not simple. To get around the history update scheme now, I have to create 4X72 variables for the particular instance I am dealing with. Then I have to enter those 288 variables into expressions in 72 tables. I have to read the channels into those 288 variables so the data does not shift through. It is working. But the ability to just stop history update would save so much trouble and tricky coding. Also having the option of history increment from 0 instead of inserting at 0 would also be wonderful. With the ability to stop history. So compare a command like Stop_History, compared to if(updateHistory) myTestChannel.AddValue(myChannel[0]) endif For 72 channels. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted July 30, 2021 Share Posted July 30, 2021 With that many channels you should simply use a sequence to trigger the reads. So, give all 72 channels a timing of 0, and put them in a channel group, say "myGroup". Then create a sequence: while(1) if (updateHistory) channel.readGroup("myGroup") endif delay(1) endwhile Then, whenever updateHistory is non-zero, the inputs will be read and the history updated. When it is 0, no reading will occur and the history will be frozen. Quote Link to comment Share on other sites More sharing options...
kedi Posted July 30, 2021 Author Share Posted July 30, 2021 A nice solution in many instances. I could do that 4 times with a 3 hour delay, to display my voltage snapshots, without them scrolling out. Referencing the history in the tables. It will not be compatible with my desire to graph the channels. But definitely thanks for the idea. 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.