Convert time to Integer and write to OPC tag

Hi
I want ti put a Spinner on a page formated at H:mm. I then want to convert this to an integer Hmm.
So if time set on Spinner is 14:32 the Interger OPC tag would read 1432.
Any sugestions?
I created a memory tag of type DateTime for my spinner then created a script tag that did the conversion but still have to get that tag to an OPC tag. There must be a simpler solution.
My scrip tag expression. (dateExtract(toDate({[.]FillChillStartTime}), "hour")) * 100 + dateExtract(toDate({[.]FillChillStartTime}), "minute")

To make things clear:
bi-directional binding on the datetime input component to the memory tag, and then an expression tag that references the memory tag and does the conversion.
Is that what you have ?

That sounds like an okay way to do it, though if the result needs to end up in an OPC tag you can skip the expression tag and set the value source of the OPC tag to expression, and put the conversion expression there.

What? Value source == OPC is what makes a tag an OPC tag.

Wait, I thought I was changing something else...

Sorry, I need some rest. Kid's pushing some teeth out and I'm not getting much sleep :X

1 Like