Hello Guest it is April 17, 2021, 08:07:09 AM

Author Topic: Cycle Time Display  (Read 321 times)

0 Members and 1 Guest are viewing this topic.

Cycle Time Display
« on: May 18, 2020, 11:29:56 PM »
I'm using the Avid set...  There is a text box that displays the cycle time.  I managed to find the function in the PLC script that sets the value there if the machEnabled variable is 1.  My issue is that I want to see the cycle time when after the G code is complete, but the value is set to zero before I can see it.  The script only changes the value is the machine is enabled.  I can't figure out how the value gets changed back to zero?  The text box has an event set "On Update Script," but I'm not sure what that means and I can't find it mentioned anywhere. 

If I can figure this out, I may have a text box display the last cycle time and a double click event to clear it to zero or something like that. 

I wish there was some better documentation of this stuff.  I have searched and looked at the help file before I bothered asking.  I appreciate the help.

Any ideas? 

Tony

Offline bcoop

*
  •  48 48
    • View Profile
Re: Cycle Time Display
« Reply #1 on: May 19, 2020, 09:54:31 AM »
Tony, on my system, the cycletime textbox maintains the value until i initate a reset or rewind the gcode
has there been any mods to the code ?
can you post your code for the cycletime from the plc script

Code: [Select]
-------------------------------------------------------
--  Cycle time label update
-------------------------------------------------------
--Requires a static text box named "CycleTime" on the screen
if (machEnabled == 1) then
local cycletime = mc.mcCntlGetRunTime(inst, time)
scr.SetProperty("CycleTime", "Label", SecondsToTime(cycletime))
end
« Last Edit: May 19, 2020, 09:57:50 AM by bcoop »
Bob
Re: Cycle Time Display
« Reply #2 on: May 19, 2020, 10:10:39 PM »
Thanks.  My script looks the same.  On my system, when the Gcode is finished, it is rewound and the cycle time is changed to 00:00:00.0.

 I played around with it today.  What I ended up doing is a little crude, but it is working.  In the PLC script, I check to see if the MachEnable variable has changed value.  I added a text box called TonyTime.  If the MachEnable is 1 and the value of the CycleTime label is NOT 00.:00:00.0, then I set the  Label of TonyTime to the same as the CycleTime Label value (I use a variable).  I then added a button that resets TonyTime to 00...   Seems to work. 

I looked at my Gcode files.  I use Vcarve Pro, btw.  There is an M30 at the end which I think does the End and rewind? 

Sorry, I don't have the code on this PC.  Its on the laptop in the shop.   



Tony

Offline bcoop

*
  •  48 48
    • View Profile
Re: Cycle Time Display
« Reply #3 on: May 20, 2020, 08:14:24 AM »
well i think you found the issue, the M30 initiate a rewind , not sure where in mach that it resets the cycle time but it does. 
you came up with a good fix for the issue.
Bob

Offline Bill_O

*
  •  362 362
    • View Profile
Re: Cycle Time Display
« Reply #4 on: August 04, 2020, 09:25:53 AM »
Here is a simple fix to the plc in mach to keep the time until you click on cycle start again.

Code: [Select]
-------------------------------------------------------
--  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))
end
end

Offline bcoop

*
  •  48 48
    • View Profile
Re: Cycle Time Display
« Reply #5 on: August 09, 2020, 08:53:53 PM »
Thanks Bill, I will have to try that one out.

Bob
Bob