Hi,
I've been looking at the provisions of wxTimer. It would appear that could be used.
https://docs.wxwidgets.org/trunk/classwx_timer.htmlThus a Lua statement like:
MyLubeTimer:start(-1) would cause the previously defined wxTimer called MyLubeTimer to restart from it
previous stop time. Thus the timer would accumulate. Your m3 and m4 macros would each contain such a timer
start statement and your m5 macro would contain a timer stop statement.
In your PLC script you would test the sate of the timer, once 1 hour had accumulated the lube pump would be run.
The timer could then be reset and it would start to accumulate again.
I have yet to complete my experimentations with wxTimer to confirm my idea. If it works as I imagine that would allow
you to track spindle on time to within seconds.
As much as I'd like to do most everything in Mach4 I may just use an Arduino with its millis function for the timed events.
This adds complexity.......but then so does the programming that Brett has hinted at or the wxTimer idea that I have
outlined. The question is 'does the required accuracy warrant the extra complexity', the operative word is 'required',
not 'wanted' or 'desired' or 'I really want to skite about this' or 'my mother told me I'd go blind doing this'
BUT 'required'.
Craig