NAME
time - Time on in Hours, Minutes, SecondsSYNOPSIS
loadrt
time [count=
N|names=name1[,name2...]]
DESCRIPTION
Time<hbox>
<label>
<text>"Cycle Time"</text>
<font>("Helvetica",14)</font>
</label>
<u32>
<halpin>"time-hours"</halpin>
<font>("Helvetica",14)</font>
<format>"2d"</format>
</u32>
<label>
<text>":"</text>
<font>("Helvetica",14)</font>
</label>
<u32>
<halpin>"time-minutes"</halpin>
<font>("Helvetica",14)</font>
<format>"2d"</format>
</u32>
<label>
<text>":"</text>
<font>("Helvetica",14)</font>
</label>
<u32>
<halpin>"time-seconds"</halpin>
<font>("Helvetica",14)</font>
<format>"2d"</format>
</u32>
</hbox> </pyvcp>
For a new config:
loadrt time
addf time.0 servo-thread
net cycle-timer time.0.start <= halui.program.is-running
net cycle-timer-pause time.0.pause <= halui.program.is-paused
net cycle-seconds pyvcp.time-seconds <= time.0.seconds
net cycle-minutes pyvcp.time-minutes <= time.0.minutes
net cycle-hours pyvcp.time-hours <= time.0.hours
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:
loadrt time
loadrt not
addf time.0 servo-thread
addf not.0 servo-thread
net prog-running not.0.in <= halui.program.is-idle
net cycle-timer time.0.start <= not.0.out
net cycle-seconds pyvcp.time-seconds <= time.0.seconds
net cycle-minutes pyvcp.time-minutes <= time.0.minutes
net cycle-hours pyvcp.time-hours <= time.0.hours
For those who have this setup already, you can simply add a net connecting
time.N.pause to halui.program.is-paused:
net cycle-timer-pause time.0.pause <= 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 McKnightLICENSE
GPL2023-02-10 | LinuxCNC Documentation |