Job is running status
Posted: Tue Jul 15, 2025 12:39 pm
Hello! I'm trying to find out if a job is running or not. Specifically, the filename that is loaded. The trouble I'm having is that SV_JOB_IN_PROGRESS returns IO_LOGICAL_1 even when I'm running a warmup routine, and haven't actually started the job. Is there a way to differentiate this?
Thanks!
Corbin
My code:
I'm also curious about this method on CNCPipe.State, but it is internal:
Thanks!
Corbin
My code:
Code: Select all
public static bool IsJobRunning(this CNCPipe pipe)
{
CNCPipe.Plc.IOState plcState = CNCPipe.Plc.IOState.IO_STATE_UNKNOWN;
CNCPipe.ReturnCode rc = pipe.plc.GetPcSystemVariableBit(CentroidAPI.PcToMpuSysVarBit.SV_JOB_IN_PROGRESS, out plcState);
if (rc == CNCPipe.ReturnCode.SUCCESS)
{
return plcState == CNCPipe.Plc.IOState.IO_LOGICAL_1;
} else
{
return false;
}
}
Code: Select all
internal bool CheckIfJobIsRunning()
{
if (File.Exists("C:\\cncm\\loadcommand.txt"))
{
return true;
}
string command = "STATE_CheckIfJobIsRunning";
m_parent.SendAndReceive(command, out var response);
FromString(response, out var value);
return Convert.ToBoolean(Convert.ToInt32(value));
}