Hello Guest it is April 16, 2024, 07:41:48 PM

Author Topic: service timer  (Read 1015 times)

0 Members and 1 Guest are viewing this topic.

service timer
« on: February 05, 2021, 06:53:53 AM »
what is the best way to make timing for auto service(like run electric oil pump)
for example each 100 working h (h can be when Enable) force lubrication 1 minutes
thanks
yaakov
Re: service timer
« Reply #1 on: February 05, 2021, 08:29:41 AM »
2 ways that are easy... You can do an on screen timer in screen edit mode OR you can make a PMC file. https://www.youtube.com/watch?v=jVhH9qyjjf0
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: service timer
« Reply #2 on: February 05, 2021, 09:06:17 AM »
please give me sample how do it with screen timer
,i didnt find any manual and i rea understand when you mean screen timer

Offline Bill_O

*
  •  563 563
    • View Profile
Re: service timer
« Reply #3 on: February 05, 2021, 09:14:07 AM »
Here is what I use.
You need to make a couple of registers also.

In PLC
-------------------------------------------------------
--  Cycle time label update
-------------------------------------------------------
--Requires a static text box named "CycleTime" on the screen
if (machEnabled == 1) then
   local running = mc.mcCntlIsInCycle(inst)
   if (running == 1) then
      local cycletime = mc.mcCntlGetRunTime(inst, time)
      scr.SetProperty("CycleTime", "Label", SecondsToTime(cycletime))
   
      --run time
      local hRun = mc.mcRegGetHandle(inst, 'iRegs0/RunningTime')
      RunTime = cycletime
      mc.mcRegSetValue(hRun, RunTime)
   
   end
end


In PLC First Run section
---------------------------------------------------------   
   --Pop up message for maintenance
   --Keep at bottom
   ---------------------------------------------------------      
   local MaintReg = mc.mcRegGetHandle(inst, 'iRegs0/MaintTime')
   local MaintRegVal = mc.mcRegGetValue(MaintReg)
   if (MaintRegVal >= 144000) then
      mc.mcRegSetValue(MaintReg, 0.0)
      wx.wxMessageBox("Please perform maintenance")
   end



In the Cycle Start function in Screen Load Script
         --Set time on Maintenance timer
         local hMaint = mc.mcRegGetHandle(inst, 'iRegs0/MaintTime')
         local MaintTime = mc.mcRegGetValue(hMaint)
         local hRunning = mc.mcRegGetHandle(inst, 'iRegs0/RunningTime')
         local RunningTime = mc.mcRegGetValue(hRunning)
         MaintTime = (MaintTime + RunningTime)
         mc.mcRegSetValue(hMaint, MaintTime)
         mc.mcRegSetValue(hRunning, 0.0)
         
Re: service timer
« Reply #4 on: February 05, 2021, 09:22:19 AM »
At the top of the screen in screen edit mode you can mouse over the icons. The 2nd one from the right looks like a stopwatch. That is an on screen timer object. Place that on the screen and you can use that to call your code at your intervals you would like.
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: service timer
« Reply #5 on: February 05, 2021, 09:24:24 AM »
brian its not angular meter?
Re: service timer
« Reply #6 on: February 05, 2021, 10:57:38 AM »
It is in the newer versions I guess ..... I don't run old LOL
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: service timer
« Reply #7 on: February 06, 2021, 11:25:16 AM »
Where can download?

Offline smurph

*
  • *
  •  1,546 1,546
  • "That there... that's an RV."
    • View Profile
Re: service timer
« Reply #8 on: February 06, 2021, 01:14:09 PM »
http://www.machsupport.com/ftp/Mach4/DevlopmentVersions/

Get the latest one.  4609, I believe

Steve