산업기술/Cognex

코그넥스 JobManager

야곰야곰+책벌레 2024. 7. 26. 11:34
728x90
반응형

읽어오기

CogJobManager JobManager;
List<CogJob> Job = new List<CogJob>();
List<CogJobIndependent> independetJob= new List<CogJobIndependent>();

// VPP  읽어오기
JobManager = (CogJobManager)CogSerializer.LoadObjectFromFile(filepath);
for (int i = 0; i < JobManager.JobCount; i++)
{
    Job.Add(JobManager.Job(i));
    independetJob.Add(Job[i].OwnedIndependent);
}

JobManager.UserQueueFlush();
JobManager.FailureQueueFlush();

for (int i = 0; i < JobManager.JobCount; i++)
{
    Job[i].ImageQueueFlush();
    independetJob[i].RealTimeQueueFlush();
}

 

실행

// RUN
ICogRecord Record = null;

if (JobManager == null)
    return;
JobManager.Run();

if (Wait)
{
    while (Record == null)
        Record = JobManager.UserResult();
}

 

Job 네임 가져오기

 

CogToolGroup toolGroup = (CogToolGroup)Job[0].VisionTool;

string[] toolname = new string[toolGroup.Tools.Count];

for (int i = 0; i < toolGroup.Tools.Count; i++)
{
    toolname[i] = toolGroup.Tools[i].Name;
}
728x90
반응형

'산업기술 > Cognex' 카테고리의 다른 글

CogCalibCheckrboardTool 사용하기  (0) 2024.09.16
QuickBuild에서 ToolBlock 사용하기  (0) 2024.09.16
코그넥스 toolblock  (0) 2024.07.26
코그넥스 이미지 처리  (0) 2024.07.26