Get Cycle Time Using Okuma API

798 views Asked by At

Control: Okuma OSP-P200L
Machine: LB3000
API: 1.15.0.0

I need to get the cycle time for a part program in an Okuma Lathe using the THINC API. The help file mentions a cycle complete method:
public bool CycleComplete( MachineSideEnum enMachineSide )
But I'm not finding any way to detect a cycle start.
Any ideas?

2

There are 2 answers

0
Still.Tony On BEST ANSWER

Like AppFzx said, you'd have to poll. Have user start the application, then start their part program. Your application will need to poll GetProgramRunningState() (not faster than 100ms interval!) to see when the part program starts. Then poll CycleComplete() to see when it finishes. On that thread though, events are an interesting idea for future API releases...

0
jweaver On

Another possible approach is to use the CmachingReport.GetMachiningReports method. It returns an ArrayList of the CMachining class which has a property called OperatingTime. This is a cumulative timer representing actual time from start to finish each time the program is run.

You can calculate the average cycle time for a particular program by dividing the OperatingTime by the NumberOfWork property. Doing it this way would give you some flexibility in case the app isn't running or you don't want to poll.