Hi all
I am using kflop board.
In Kmotion CNC there is a Run time option in Caption bar of Kmotion cnc here it is shown.
This run time i wan to print somewhere else using DRO Label on my KmotionCNC screen.
I want to know that how to use a DRO Label for printing Run Time.
Waiting for your kind reply.
For printing runtime other then caption bar of KmotionCNC
Moderators: TomKerekes, dynomotion
-
- Posts: 134
- Joined: Tue Feb 20, 2018 7:35 am
- Location: India
For printing runtime other then caption bar of KmotionCNC
Thank You
AMIT KUMAR
AMIT KUMAR
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: For printing runtime other then caption bar of KmotionCNC
Hi Amit,
Here is C Program that monitors whether a Job is Active, Time stamps when a Job Starts, detects when a Job Ends, Formats a Job Time message, and writes it to a DROLabel.
Attached is a Screen Script example (also Attached)with the DROLabel that looks like this:
HTH
Here is C Program that monitors whether a Job is Active, Time stamps when a Job Starts, detects when a Job Ends, Formats a Job Time message, and writes it to a DROLabel.
Code: Select all
#include "KMotionDef.h"
#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"
void ServiceJobTimer(void);
#define JOBTIMEPERSIST 162
main()
{
for (;;)
{
WaitNextTimeSlice();
ServiceJobTimer();
}
}
// Monitor and time Jobs starting and ending
void ServiceJobTimer(void)
{
static BOOL WasActive = FALSE;
static double StartTime;
double dt, Seconds;
int Hours, Minutes;
char s[80];
if (JOB_ACTIVE && !WasActive) // Started ??
{
StartTime = Time_sec();
WasActive = TRUE;
}
if (!JOB_ACTIVE && WasActive) // Ended ??
{
WasActive = FALSE;
dt = Time_sec() - StartTime;
Hours = (int)(dt / 3600.0);
Minutes = (int)((dt - Hours * 3600.0) / 60.0);
Seconds = dt - Hours * 3600.0 - Minutes * 60.0;
if (Hours > 0)
sprintf(s, "Last Run Time %d hours %d min %5.1f sec", Hours, Minutes, Seconds);
else if (Minutes > 0)
sprintf(s, "Last Run Time %d min %5.1f sec", Minutes, Seconds);
else
sprintf(s, "Last Run Time %5.1f sec", Seconds);
// Put it onto the Screen using Persist
DROLabel(1000, JOBTIMEPERSIST, s);
}
}
- Attachments
-
- RawCustomWithJobTimeDRO.scr
- (45.72 KiB) Downloaded 174 times
-
- ServiceJobTimer.c
- (1.3 KiB) Downloaded 172 times
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 134
- Joined: Tue Feb 20, 2018 7:35 am
- Location: India
Re: For printing runtime other then caption bar of KmotionCNC
Hi Tom,
Thanks for the reply.
The timer for printing runtime other then caption bar is working fine as expected by the program that you sent.
Will let you know about further updates.
Thanks for the reply.
The timer for printing runtime other then caption bar is working fine as expected by the program that you sent.
Will let you know about further updates.
Thank You
AMIT KUMAR
AMIT KUMAR