Hi, I'd like to ask you for help.
I have stations in my model (a changed duplicate of SingleProc). I use a method that sets the station's setup time and proctime, creates a container on the station, pauses the station, then make some parts enter the container on the station (custom assembly solution). Afterwards the method sets the station's paused attribute to false.
Here, the station skips both the setup and the processing time. Do you have any idea why?
There are some screenshots of the station's dialog window attached.
Thank you in advance!
Solved! Go to Solution.
could you also provide your model, or if that is not possible the code in the method that you used?
Hi Igor, thanks for stopping by!
I can't post the model, but I can share a truncated version of the method. The parts I cut are not relevant. They contained mainly information handling and comments, but they were not directly related to the station or the objects on it.
As I saw, the Station finished when the method reaches the Station.pause := false part. The container's finished attribute turns true instantly at that moment, without the simulation time changing.
param Station,input_workpiece:object var state, product:string var pid_local,id_child,id_assembly:integer var tab_Assembly_row,station_row,agvo_row,Process_Log_row,inventory_row :integer var destination,workpiece,store,palette :object var tab_Assembly:table var procTime, setup_time:time if @ /= void workpiece := @ else workpiece := input_workpiece end state := "waiting_for_parts" product := workpiece.product tab_Assembly := Assembly_graphs["tab_Assembly",product] pid_local := workpiece.pid Process_Log_row := search_tab_for_any(Process_Log,"pid",pid_local) id_child := workpiece.id_child id_assembly := getParent(workpiece.id_child) palette := workpiece.location if Station.empty tab_Assembly_row := search_tab_for_any(tab_Assembly,"ID",id_assembly) setup_time := str_to_time(Station.setup_table[Station.assembly_type,Process_Log["assembly_type",Process_Log_row]]) tab_Assembly_row := search_tab_for_any(tab_Assembly,"ID",id_assembly) station_row := search_object_in_table(tab_Assembly["station",tab_Assembly_row],Station) proctime := tab_Assembly["station",tab_Assembly_row]["proctime",station_row] station.SetupTime := setup_time station.proctime := proctime Station.paused := true .agv_lib.Assembly_container.create(Station) Station.cont.ydim := tab_Assembly["no_parts", tab_Assembly_row] Station.pid := -1 tab_Assembly_row := search_tab_for_any(tab_Assembly,"ID",getparent(workpiece.id_child)) set_assembly_Attributes(Station.cont, -1, -1, id_assembly, 0, product, tab_Assembly["name",tab_Assembly_row], void) end if not Station.cont.full workpiece.move(Station.cont) Station.cont.part_weight += workpiece.part_weight end if Station.cont.full Station.pause := false Station.assembly_type := Process_Log["assembly_type",Process_Log_row] waituntil station.cont.finished prio 1 end
if you create a MU on a station, the MU is created ready for exit, so you cannot take in to account procTime and setup behavior.
You need to create the part on a other destination (eg. dummy station) and move it to the station. Then Plant Simulation will calculate the exit event.
freelance simulation specialist