Cancel
Showing results for 
Search instead for 
Did you mean: 

Worker

Pioneer
Pioneer

Good afternoon.
Help me please.
I have on my system workstations and pieces on these stations that will be made by the Workers. For example, there are three workers to run the service, but four pieces in the stations. As I work with shifts, one piece is being worked out, and after the change of shift or pause it may happen the Worker go run the service in another piece, leaving the other on hold. I need to piece where is already started the work is finished, need not be the same worker, but she can not stay on hold. How do?
It's a little hard to explain. Follow the example below for ease of understanding.

 

lateral1.PNG

 

lateral2.PNG

 

lateral3.PNG

10 REPLIES 10

Re: Worker

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

After the end of the pause the Broker mediates the worker anew and not to the same station.

You can use the Broker-Importer - request control to control how to engage Plant Simulation worker. I guess, it is the easiest way, to prevent the mediation of a worker, if his previous work is not finished. There are some information you can use: <worker>.previousLocation.station --> in the workerpool the worker remembers the last workstation ...station is the connected machine; <mu>.remainingProcTime is the remaining proctime of the part (-1.000 if not started). A condition in the Broker-Importer-request-control could look like this:

--dont mediate worker with unfinished work at the previous location
 if workersToBeExported[1,1] /= void and workersToBeExported[1,1].previousLocation/= void and
    workersToBeExported[1,1].previousLocation.station.occupied then
  if workersToBeExported[1,1].previousLocation.station.cont.remainingProctime  > 0 and
     workersToBeExported[1,1].previousLocation.station.cont.remainingProctime <
     workersToBeExported[1,1].previousLocation.station.procTime then
   if obj /= workersToBeExported[1,1].previousLocation.station then   
--worker has a unfinished work, but this is not the right station
-- do not engage 
    testImportSuccessfull:=false;
   end;
  end;   
 end;

 

See in the control of the broker in the example.

 

 

 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Worker

Pioneer
Pioneer

Thanks Steffen.
But following error occurred: use 'footpath' in my project, and using the 'previousLocation.station.occupied' command, it recognizes as the last place one 'footpath', not a workstation, so you can not locate the 'station', or verify that it is 'occupied'. Any suggestions?

 

erro.png

Re: Worker

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Hi Martins,

 

this increases the variants to find the last workplace. With walkpath.succ we can read the connected workplace. We need to differ than, where the worker is located, if he finish his job and is able for a new mediation. If you don`t select the option "get job orders in the pool only", he can be also located on a workplace.  the broker-control might than look like this.

 

 

(obj : object;   -- Importer
 type : integer) -- Importer type (0=failure importer, 1=setup importer, 2=processing importer, 3=transport importer)
is
 workersToBeExported : table;
 testImportSuccessfull : boolean;
 workplace: object;
 
do
 workersToBeExported.create;
 testImportSuccessfull := ?.testImportFor(obj, type, workersToBeExported);
 if workersToBeExported[1,1] /= void and workersToBeExported[1,1].location.class.name="Workplace" then
  workplace:=workersToBeExported[1,1].location;
 elseif workersToBeExported[1,1] /= void and workersToBeExported[1,1].location.class.name="WorkerPool" and workersToBeExported[1,1].previousLocation/= void  then
  workersToBeExported[1,1].previousLocation.succ;
 else
  --debug;
 end;
 
 --dont mediate worker with unfinished work at the previous location
 if workersToBeExported[1,1] /= void and workersToBeExported[1,1].previousLocation/= void and
    workplace.station.occupied then
  if workplace.station.cont.remainingProctime  > 0 and
     workplace.station.cont.remainingProctime <
     workplace.station.procTime then
   if obj /= workplace.station then    
    testImportSuccessfull:=false;
   end;
  end;   
 end;
 
 

 if testImportSuccessfull = true  then
  ?.engage(obj, type, workersToBeExported);
 end;
end;


 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Worker

Pioneer
Pioneer

Hi Steffen.
I'm using the PS 11.3. When I ran the example that you has attached, after a time this error occurred.

 

erro.png

 

I put the method in Broker Importer of my system. After a period the same error has occurred. Can you tell why?

Re: Worker

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

This is a topic for Siemens.

 

I have tested it for V. 11 and V. 12 no error.

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Highlighted

Re: Worker

Pioneer
Pioneer

Hello again.
Do you know me speak the 11.0.3 version of Plant Simulation has this attribute 'remainingProctime'? Is experiencing an error in the method at this point, and did not find this attribute in the SingleProcs.

Re: Worker

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

RemainingProcTime is a attribute of the MUs (Entity, Container...)

in the method:

workplace.station.cont.remainingProctime 

 

workplace.station is the SingleProc

workplace.station.cont is the MU on the SingleProc

 

 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Worker / Broker

Pioneer
Pioneer

Good morning.
I left this topic on hold until I could upgrade my version of PS.

 

Steffen, when trying to execute your code above, it still fails, I set up the 'workers' to always return to 'workpool' when finalizing a service to receive the new work order. There is no changing that.
I also think it may give an error when exchanging work shift, they will be new 'workers' who have not worked in any work order. The 'broker' would have to observe the stations the parts that have been initiated to then direct a worker to her.
As I said, it need not be the same worker, but is necesssário the part that has already started is finished. If there is not initiated parts and there are 'workers' available, these can be triggered to start the service.

 

Thanks.

Re: Worker / Broker

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

If you not need the same worker, you could check for a new job (mu.remainingProcTime = -1) if one station has unfinished work and no worker on the workplace.

Like this:

 

(obj :  object;   -- Importer
 type : integer) -- Importer type (0=failure importer, 1=setup importer, 2=processing importer, 3=transport importer)
is
 workersToBeExported : table;
 testImportSuccessfull : boolean;
 workplace: object;
 stations:list[object];
 i:integer;
 
do
 workersToBeExported.create;
 stations.create;
 stations.append(singleProc);
 stations.append(singleProc1);
 stations.append(singleProc2);
 stations.append(singleProc3);
 --etc.
 
 
 --do not mediate a worker, if one of the machines has unfinished work and no worker on the station
 testImportSuccessfull := ?.testImportFor(obj, type, workersToBeExported);
 
 if obj.occupied and obj.cont.remainingProctime = -1 then
  --new job
  --check all stations
  for i:=1 to stations.dim loop
   if stations.read(i).occupied then
    if stations.read(i).cont.remainingProctime  > 0
       and stations.read(i).assignedWorkplaces[1].occupied=false then
     --one uncompleted station, do not mediate a worker
     testImportSuccessfull:=false;
     exitloop;
    end;
   end;
   
  next;
  
 end;
 
 
 

 if testImportSuccessfull = true  then
  ?.engage(obj, type, workersToBeExported);
 end;
end;

 

 

For shift-change I have included one minute space, to avoid problems.

 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net