StartNextJobViaFC(Int32,String,Int32,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 ID to specify the entity.
'Declaration
Public Overloads Shared Sub StartNextJobViaFC( _
ByVal sessionId As Integer, _
ByVal userId As String, _
ByVal entId As Integer, _
ByVal jobPos As Nullable(Of Integer) _
)
'Usage
Dim sessionId As Integer
Dim userId As String
Dim entId As Integer
Dim jobPos As Nullable(Of Integer)
JobExec.StartNextJobViaFC(sessionId, userId, entId, jobPos)
public static void StartNextJobViaFC(
int sessionId,
string userId,
int entId,
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.
- entId
- Required. Holds the ID of the entity on which the job is to be run.
- jobPos
- Optional. Holds the job position on the entity on which the job is to be run. Default is 0.
Return Value
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.