Used to get Job Information including the Job Stack. Also allows the setting of active Jobs.
Name | Description |
---|---|
SetActiveJob | Set the active job on the controller. |
GetExecutingJobInformation | If the controller is currently executing a job, this function will return the name of the job. |
GetJobStack | Get the job stack from the controller. |
Set the active job on the controller.
StatusInfo SetActiveJob(const std::string& jobName, UINT32 lineNumber)
jobName
[in] The name of the job to set as active. Not case sensitive. ".JBI" extension does not have to be included, but it can be if your program requires it.
lineNumber
[in] The line number to start executing the job at. If the line number is 0, the job will start at the beginning.
0 if successful, otherwise a StatusInfo object with a description of error.
StatusInfo status{};
auto c = YMConnect::OpenConnection("192.168.1.31", status);
status = c->Job->SetActiveJob("Test", 0);
std::cout << status << std::endl;
YMConnect::CloseConnection(c);
Output
Code (0): OK
If the controller is currently executing a job, this function will return the name of the job.
StatusInfo GetExecutingJobInformation(InformTaskNumber selection, JobData& job)
selection
[in] Task associated with executing job. For example, if InformTaskNumber::Master is selected, the returned job will be associated with the master task. See InformTaskNumber.
job
[out] The job data currently executing on the controller. This name cooresponds with the task number selected in the selection parameter.
0 if successful, otherwise a StatusInfo object with a description of error.
StatusInfo status{};
auto c = YMConnect::OpenConnection("192.168.1.31", status);
JobData jobData{};
status = c->Job->GetExecutingJobInformation(InformTaskNumber::Master, jobData);
std::cout << status << std::endl;
std::cout << jobData << std::endl;
YMConnect::CloseConnection(c);
Output
Code (0): OK
Name: TEST1
Line: 1
Step Number: 0
Speed Override: 100%
Get the job stack from the controller.
StatusInfo GetJobStack(InformTaskNumber taskNumber, std::vector<std::string>& jobStack)
taskNumber
[in] Task associated with job stack. For example, if InformTaskNumber::Master is selected, the returned job stack will be associated with the master task. See InformTaskNumber.
jobStack
[out] The job stack represented as a vector of strings. Top of stack is at index 0.
0 if successful, otherwise a StatusInfo object with a description of error.
StatusInfo status{};
auto c = YMConnect::OpenConnection("192.168.1.31", status);
std::vector<std::string> jobStack{};
status = c->Job->GetJobStack(InformTaskNumber::Master, jobStack);
std::cout << status << std::endl;
for (auto& job : jobStack)
{
std::cout << job << std::endl;
}
YMConnect::CloseConnection(c);
Output
Code (0): OK
TEST2
TEST3