SYNOPSIS

loadrt time [count=N|names=name1[,name2…]]

DESCRIPTION

Time

When either the time.N.start or time.N.pause bits goes true the cycle timer resets and starts to time until time.N.start AND time.N.pause go false. When the time.N.pause bit goes true timing is paused until time.N.pause goes false. If you connect time.N.start to halui.program.is-running and leave time.N.pause unconnected the timer will reset during a pause. See the example connections below for more information.

Time returns the hours, minutes, and seconds that time.N.start is true.

Sample PyVCP code to display the hours:minutes:seconds.

In your post-gui.hal file you might use one of the following to connect this timer:

For a new config:

Previous to this version if you wanted the timer to continue running during a pause instead of resetting, you had to use a HAL NOT component to invert the halui.program.is-idle pin and connect to time.N.start as shown below:

For those who have this setup already, you can simply add a net connecting time.N.pause to halui.program.is-paused:

FUNCTIONS

time.N (requires a floating-point thread)

PINS

time.N.start bit in

Timer On

time.N.pause bit in (default: 0)

Pause

time.N.seconds u32 out

Seconds

time.N.minutes u32 out

Minutes

time.N.hours u32 out

Hours

AUTHOR

John Thornton, itaib, Moses McKnight

LICENSE

GPL