Combining Current Time and Minutes Left

Im trying to create a datetime tag that combines a current time tag and a float tag with "minutes left" together. I am basically trying to figure out a production end time based on a end goal and an average done per hour.

Right now i have a tag that displays currentTime and I have a tag that displays minutesLeft. In stupid terms I just need to add currentTime+minutesLeft and have it output in dateTime format.

I know there is system.date.addMinutes(X,X) however I need to use a tag value that is constantly changing for the second argument in addMinutes.

Any ideas?

There is a corresponding expression function you can use in an expression binding (or expression tag):

The Syntax is add*(date, value)

For the Value argument how can I use a tag path in there?

addMinutes(now(5000), {[default]MinutesLeft})

Minutes left

  1. Pick the function.
  2. Pick the tag.

now(5000) causes the expression to reevaluate every 5000 ms. Adjust to suit.

3 Likes

Something like

addMinutes({path/to/now}, {path/to/forecastMinutes})
1 Like

Got it, appreciate the help guys.

Good. Don't forget to mark one of the answers as "Solution".

2 Likes

How can I format the label to only show the time like I have the tag formatted? Its showing the date first then the time. I have the tag I want to display formatted with h:mm aa and thats also how I want the label on the page to show but i dont see any formatting options for it.

dateFormat(
	addMinutes(now(5000), {[default]MinutesLeft}),
	'h:mm aa'
)

If you had pressed (1) in my image above you should have been able to find it. See Expression Functions | Ignition User Manual for the docs.