_dwNextProcReq)) THEN CONTINUE; END_IF // Find next available station according to recipe and available station _uiNextAvailStation := M_FindNextAvailStation(_dwNextProcReq); // Check if there is a station available IF _uiNextAvailStation <> 0 THEN // Reserve source station _stTmpJob.uiFromStationHandle := _aiStations[_uiCnt].M_Reserve(); // Reserve target station _stTmpJob.uiToStationHandle := _aiStations[_uiNextAvailStation].M_Reserve(); // Check if we could reserve the stations IF (_stTmpJob.uiToStationHandle <> 0) AND (_stTmpJob.uiFromStationHandle <> 0) THEN // Create transport job _stTmpJob.uiFromStation := _uiCnt; _stTmpJob.uiToStation := _uiNextAvailStation; _stTmpJob.uiPrio := fbFlowRecHandler.M_GetNextPrio(iIdx := _iFlowRecIdx); // Add job to job queue fbJobQueue.M_AddJob(stJob := _stTmpJob); ELSE // Remove registrations from stations _aiStations[_uiCnt].M_Release(_stTmpJob.uiFromStationHandle); _aiStations[_uiNextAvailStation].M_Release(_stTmpJob.uiToStationHandle); END_IF END_IF END_IF END_FOR]]> (GVL_Scheduler.MAX_STATIONS - 1) THEN M_GetStation := 0; RETURN; END_IF M_GetStation := _aiStations[iStationIdx];]]>