Creating a simple countdown timer

No worries, such things should actually be in the PLC. :slight_smile:

So, for a countdown, you'll want the difference between the accumlator value and the ideal cycle time (in this case 60 seconds)

A couple of options:

  • make a tag in the PLC to subtract the difference (e.g. named countdown or something similar), then use that PLC tag in Ignition.
  • Make an Ignition tag pointing to the current cycle time in the PLC (You can also use scaling in the tag settings to conver to seconds), and subtract that from the ideal cycle time.

For a countup, just use the accumulator (scaling still applies).
Then the expression simplifies somewhat

	toInt(floor({path/to/CycleTimer/ACC}/3600))
	  + ':'
	  + numberFormat(toInt(floor({path/to/CycleTimer/ACC}/60)) % 60, '00') 
	  + ':'
	  + numberFormat({path/to/CycleTimer/ACC} % 60, '00')

Thanks

thanks for this!

1 Like