component time "Time Converter"; description """ Cycle Timer Connect time.n.start to halui.is-running to complete the cycle timer. The pyVCP code to display it might be like: "time-hours" ("Helvetica",14) "2d" "time-minutes" ("Helvetica",14) "2d" "time-seconds" ("Helvetica",14) "2d" In your post-gui.hal file you might use the following to connect it up loadrt time addf time.0 servo-thread net cycle-timer time.0.start <= halui.program.is-running 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 """; author "John Thornton"; license "GPL"; // Input Pins pin in bit start "Run Timer"; // Output Pins pin out u32 seconds "Seconds"; pin out u32 minutes "Minutes"; pin out u32 hours "Hours"; // Global Variables variable double totalnsec; variable int old_start; function _; ;; #include "rtapi_math.h" FUNCTION(_) { __u32 totalseconds; if(start && !old_start) totalnsec = 0; if(start){ totalnsec = totalnsec + period; totalseconds = totalnsec * 0.000000001; seconds = totalseconds % 60; minutes = (totalseconds / 60) % 60; hours = (totalseconds / 3600) % 60; } old_start = start; }