StartNextJobViaFC(Int32,String,String,String,Nullable<Int32>) Method
- Last UpdatedNov 06, 2025
- 2 minute read
The StartNextJobViaFC() method starts the next job in the queue for the specified entity.
This overload of the method uses the entity name and site name to specify the entity.
public static void StartNextJobViaFC(
int sessionId,
string userId,
string entName,
string siteName,
Nullable<int> jobPos
)
Parameters
- sessionId
- Required. Holds the ID of the session from which the job is being started.
- userId
- Required. Holds the ID of the user who is starting the job.
- entName
- Required. Holds the name of the entity on which the job is to be run.
- siteName
- Optional. Holds the site name of the entity
- jobPos
- Optional. Holds the job position on the entity on which the job is to be run. Default is 0.
This method is designed to start a job from a PLC and should only be used when the job queues are carefully controlled. Otherwise, the wrong job might be started.
The GetQueue() method is called to retrieve the job queue for this entity, taking into account scheduling to parent entities, etc. The wo_id, oper_id and seq_no of the job to be started are determined by the specified queue sequence for the specified entity. Only Ready jobs will be included.
The session_id is required for licensing checks. The user_id is used to validate that the user has permission to start a job on the supplied entity.
If a job is currently running on the specified entity, then it will be ended and the next job in the queue automatically started.
For the method to succeed, at least one job in the Ready state must be scheduled.
If the call is successful, the Job table is updated as it would normally be when starting a job. Refer to the StartJob() method for details of this.