Get the timestamp to a tag

I wanted the operator to select a toggle switch "StartBreak", I was wondering if there is a way to capture the timestamp value of toggle switch into a tag called StartTime.
[default]/UserInputs/TimeValues/Break1/StartTime

I tried tag([default]/UserInputs/TimeValues/Break1/StartTime.Timestamp) but that did not work. Is it possible without scripting ?

no worries, figured it out timestampOf(tag("[default]Sensor 1/Reading"))

There shouldn't be a / after the provider:
[default]UserInputs/TimeValues/Break1/StartTime

Note that I have no idea what you're storing there exactly, but user input shouldn't be stored in tags. They're gateway scoped and you'll end up with conflicts if more than one user is entering inputs.

1 Like

I agree, / after [default] was copy paste error.
I build a screen where an operator toggles breakstart toggle switch. After that he would have to select the break start time and enter the duration, most of the time the duration is fixed but the operator wanted me to give him the flexibility.
Then he has to enter the start time and duration. So I added a toggle switch which captures the timestamp of when the toggle switch was pressed. I added toggle switch because later on it will be replaced with a scan code. So the operator would want to scan the barcode and I can feed the duration through the scan and capture the start time as well
After that the duration count down starts and turn off.

NB there's no need for the tag function if you have a single literal string tag path.

timestampOf({[default]Sensor 1/Reading})

Will achieve the exact same result, but faster.

I don't think you need the quotes " inside the curly braces, unless that's a new thing, which would be nice to be able to build the tag path there (v8.3? :eyes:)

1 Like

No, the quotes were just a typo. No special functionality is added here in 8.3.

1 Like