I didn’t think of a drop down. Thanks. I would still like to see if this could work as intended though.
I have this script running as change script on the selected property of a toggle. Here’s the code:
if self.props.selected == True:
tag1 = system.tag.getConfiguration("[default]PressureTestV2/SimulatedCurrentPressure",0)
tag2 = system.tag.getConfiguration("[default]PressureTestV2/SimulatedMaxPressure",0)
tag1[0][u'historyEnabled'] = True
tag2[0][u'historyEnabled'] = True
system.tag.configure("[default]PressureTestV2",tag1) #could use merge overwrite
system.tag.configure("[default]PressureTestV2",tag2)
system.tag.writeBlocking("[default]PressureTestV2/BatchStarted",1)
system.tag.writeBlocking("[default]PressureTestV2/StartTime",system.date.now()) # Forum! this line
if self.props.selected == False:
tag1 = system.tag.getConfiguration("[default]PressureTestV2/SimulatedCurrentPressure",0)
tag2 = system.tag.getConfiguration("[default]PressureTestV2/SimulatedMaxPressure",0)
tag1[0][u'historyEnabled'] = False
tag2[0][u'historyEnabled'] = False
system.tag.configure("[default]PressureTestV2",tag1)
system.tag.configure("[default]PressureTestV2",tag2)
system.tag.writeBlocking("[default]PressureTestV2/BatchStarted",0)
system.tag.writeBlocking("[default]PressureTestV2/EndTime",system.date.now()) # Forum! this line too
There’s some other stuff in here where I turn tags’ history on an off, and I do admit this might not be the best way to do this. For the stuff relevant to this post, I used the last lines of the if and else statement to write to the tags. I added comments saying which lines.
The tags (EndTime and StartTime) are just standard memory tags. Tags also might not be the best way to this either, but it’s just what I know right now.
Here’s the tag history binding on the table.
In regards to the table, I have also added to the columns property to exclude the time stamp column. The problem is still there when I have the time stamp column.
