ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Flexsim Student Forum
FAQ Downloads Calendar Search Mark Forums Read

Flexsim Student Forum Forum for discussion for Flexsim Students using the Flexsim Textbook.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-04-2015
hendry teo
Guest
 
Posts: n/a
Downloads: 41
Uploads: 0
Default Operator always loads and waits

Hi all

I have a simple question that I cant figure it out.
In the attached flexsim file, you will see that a batch of 10 items goes into queue2, which will then be processed one by one in the processor, downstream. Processor's capacity is 1. My problem is that, when the operator takes an item from queue2 and unloads it to the processor, it will stay near the processor and waits there. This is NOT what I want.

What I want is:
1. Operator loads one item from queue2 --> travel to processor --> unloads the item to processor
2. While the processor is processing, the operator will go back to queue2 and loads one item again in queue2 --> travel to processor --> waiting for the processor.

I want the operator always prepares one item on his hand and wait for the processor.

Please guide me. Thank you!!

Best regards
Hendry
Attached Files
File Type: fsm operator.fsm (22.1 KB, 777 views)
Reply With Quote
  #2  
Old 10-05-2015
Rahel Carolina
Guest
 
Posts: n/a
Downloads: 30
Uploads: 0
Default

Hi hendry,

You can (for example) put trigger OnEntry in processor. So everytime one box entries the processor, it will send message to the operator. Then set the trigger OnMessage in operator and create some codes with tasksequence like codes below:

/**Custom Code*/
treenode current = ownerobject(c);
treenode queue_loading = centerobject(current,1); //reference for Queue2
treenode Processor = centerobject(current,2); //reference for Processor
treenode box = rank(queue_loading,1); //reference for box in queue
//create task sequence for operator
treenode ts = createemptytasksequence(current,1,0);
inserttask(ts,TASKTYPE_TRAVEL,queue_loading, NULL);
inserttask(ts,TASKTYPE_FRLOAD,box, queue_loading,1);
inserttask(ts,TASKTYPE_TRAVEL,Processor,NULL);
inserttask(ts,TASKTYPE_BREAK,NULL,NULL);
dispatchtasksequence(ts);

I hope it helps
Reply With Quote
  #3  
Old 10-05-2015
hendry teo
Guest
 
Posts: n/a
Downloads: 41
Uploads: 0
Default

Hi Rahel,

Firstly, thanks to your reply and help.

From the code that you have generated, I think there is still some issue, which I believe it is due to the reference of flowitem. I did as what you have suggested, and found out that, the so-called 'buffer box' (the flowitem which is in operator's hand), is not released to the processor. Any idea to solve this? Thank you again!

Best regards
Hendry
Reply With Quote
  #4  
Old 10-05-2015
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 315
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

Hi hendry,

I think you are looking for at least 2 things.

1. you should set the Position of the item on the Processor. There some ways for it. One would be to just turn off the "Convey items across processors lenght", another one could be to use "setloc()" for this.

2. Write Tasksequences to the Operator to send him back and collect the next item.
You can send the Operator back to the Queue just by picking "Travel to a home Location" in his "OnRessourceAvailable Trigger". If it arrives you have to check if there is an item and if so then you can load it and travel back to the processor. The best way would be, to use some Networknodes. This way you can use the Triggers on it to check, if the Operator arrived at the Destinations.
This all will need some more logic to resist all deadlogs ;-)

For example you have to unload the item (I think the missing part on the solution of Rahel is the Unload Task) but only if Operator has reached the Processor, and really loaded an item, an Processor has finished the Process (is empty).
__________________
Hemmi
Reply With Quote
The Following User Says Thank You to Sebastian Hemmann For This Useful Post:
hendry teo (10-05-2015)
  #5  
Old 10-05-2015
hendry teo
Guest
 
Posts: n/a
Downloads: 41
Uploads: 0
Default

Hi Sebastian

Thank you for your suggestion, but I still think something is missing.

"check if there is an item and if so then you can load it and travel back to the processor."
It is true that if there is NO item in the queue, operator does not have to load it and travel back to the processor. However, if there IS item in the queue, operator has to load it and travel back to the processor, which is true also, but this does not mean the operator could unload the item to the processor until the processor has done processing.

If I were to use your method (correct me if I am wrong), the operator would only wait near to the queue while the processor is doing its job. Nothing on the operator's hand while he is waiting.

For me, I want the operator to collect an item in the queue and travel back to the processor. Hold the item on hand while waiting for the processor. Only when the processor is done, he will release the item to the processor.

Yes, I agree with you that the missing part on the Rahel solution is the unload task. But if I insert in another unload task to the operator, then, he will NOT wait for the processor regardless it is still processing.

Any ideas? Thank you so much!

Best regards
Hendry
Reply With Quote
  #6  
Old 10-06-2015
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 680
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

I would take a look at a callsubtask. If it arrives at the processor it does a call subtask and in the code that you then call, check if the processor is busy. If it is busy you return a utilize task if not you simply return and let him continue with unload task. When the product leaves the processor you check if the operator is utilized and then you free him to continue with the unload task.

The callsubtask is specifically designed to handle these kind of situations where a taskexecuter arrives somewhere and only when he is there you know what to do.
Reply With Quote
The Following 2 Users Say Thank You to Steven Hamoen For This Useful Post:
hendry teo (10-06-2015), Sebastian Hemmann (10-06-2015)
  #7  
Old 10-06-2015
hendry teo
Guest
 
Posts: n/a
Downloads: 41
Uploads: 0
Default

Hi Steven

I thought of using call subtask before. However, I have never used that command before. Can you please guide me?

I have passed the secondary task sequence to the "Break To" in the TaskExecuter, e.g.
inserttask(ts, TASKTYPE_CALLSUBTASK,NULL,NULL);
right??

Then in the "Break To" of the task executer, I also write another new task sequence:

treenode Processor = centerobject(current,2);
if (getstatenum(centerobject(current, 2)) == STATE_IDLE){
treenode dispatcher = current; // the dispatcher or task executer
double priority = getvarnum(current,"transportpriority"); // read the Priority value on the GUI
int preempting = getvarnum(current,"preempttransport"); // read the Preemption mode on the GUI

treenode ts = createemptytasksequence(dispatcher,priority,preemp ting);
inserttask(ts,TASKTYPE_FRUNLOAD,item,Processor);
return tonum(ts);
} else {
treenode dispatcher = current; // the dispatcher or task executer
double priority = getvarnum(current,"transportpriority"); // read the Priority value on the GUI
int preempting = getvarnum(current,"preempttransport"); // read the Preemption mode on the GUI

treenode ts = createemptytasksequence(dispatcher,priority,preemp ting);
inserttask(ts,TASKTYPE_UTILIZE,item,Processor);
inserttask(ts,TASKTYPE_FRUNLOAD,item,Processor);
return tonum(ts);
}


What is wrong? and,
I do not know how to refer to the flowitem on the operator's hand. Please help! Thank you!!

Hendry
Reply With Quote
  #8  
Old 10-06-2015
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 680
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Thumbs up

I have rewritten your code a bit for better understanding on my part
treenode Processor = centerobject(current,2);
treenode item = first( current );
treenode ts = NULL;
treenode dispatcher = current; // the dispatcher or task executer
double priority = getvarnum(current,"transportpriority"); // read the Priority value on the GUI
int preempting = getvarnum(current,"preempttransport"); // read the Preemption mode on the GUI


if( getstatenum( Processor ) == STATE_IDLE)
{

ts = createemptytasksequence(dispatcher,priority,preemp ting);

inserttask(ts,TASKTYPE_FRUNLOAD,item,Processor);

return tonum(ts);

}
else
{
ts = createemptytasksequence(dispatcher,priority,preemp ting);
inserttask(ts,TASKTYPE_UTILIZE,item,Processor);
inserttask(ts,TASKTYPE_FRUNLOAD,item,Processor);
return tonum(ts);
}

So the item can simply be referenced by using first( current) because when you call this function the item is in the operator.

If you have this build in and it doesn't work please post the model
Reply With Quote
The Following 3 Users Say Thank You to Steven Hamoen For This Useful Post:
hendry teo (10-06-2015), Jing Chen (10-08-2015), Sebastian Hemmann (10-06-2015)
  #9  
Old 10-06-2015
hendry teo
Guest
 
Posts: n/a
Downloads: 41
Uploads: 0
Unhappy

Hi Steven

I am not sure what is wrong with my task sequence. Please check this for me. I will try to familiarize with the code after that. Thank you

Note: I have customized the task sequence in Queue3's "Use Transport", and also Operator's "Break To". That's all. Thank you very much!

Hendry
Attached Files
File Type: fsm operator loads and waits.fsm (22.1 KB, 722 views)
Reply With Quote
  #10  
Old 10-06-2015
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 680
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Your tasksequence was mostly fine. There was one small issue when you create the Utilize task it is easier to specify both reference parameters with NULL because then if you call freeoperators you don't have to specify a matching parameter.

The other problem you had was the capacity of the processor was 1, which means that the next tasksequence from the queue is not generated. That will only generate if the product can leave the object if there is capacity on the receiving object. So if you put the max content on the processor on 2, change your Utilize task to have to NULL parameters and write:
treenode operator = centerobject( current, 1 );
if( getstatenum(operator) == STATE_UTILIZE )
{
freeoperators( operator, NULL );
}

On the exit trigger of the processor you are done.

Btw are we now doing your homework?
Reply With Quote
The Following 2 Users Say Thank You to Steven Hamoen For This Useful Post:
hendry teo (10-06-2015), Sebastian Hemmann (10-06-2015)
  #11  
Old 10-06-2015
hendry teo
Guest
 
Posts: n/a
Downloads: 41
Uploads: 0
Talking Sorry, it is my school project

Hi Steven

Haha. It works perfectly fine now, exactly like what I want it to be. Really many thanks to your explanation, time, and effort to help me.

Best regards
Hendry
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Breakdown -> call operator -> repair breakdown by operator KvThiel Q&A 4 02-26-2013 03:43 AM
Truck suddenly loads other truck :-) Katharina Muller Q&A 2 12-08-2012 11:55 PM
TE loads to it's capacity qin tian Q&A 1 11-13-2008 09:35 AM


All times are GMT -6. The time now is 03:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.