ATTENTIONThis 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 |
#1
|
|||
|
|||
item->container - sending command
Hi,
I have a problem that I am trying to solve a few days. I have 2 Queue connected in series (with a closed output ports on reset) when the TaskExecuter enters the first Queue I send him a message to open the output port. ( TE->OnMessage->openoutput(ownerobject(current)) ) and it works well for the first Queue, but when TE enters the second one, opens again first Queue. Could someone help me? I do not know how to send command from item to the container in which the item is currently. Best regards Tomasz |
#2
|
||||
|
||||
Hi Tomsz,
Why you need the communication between the item and queue,instead you can simply use the on entry and on exit triggers of the queue to open and close the output ports by sending message from queue to queue itself. Regards, Arun |
The Following User Says Thank You to arunkrmahadeva For This Useful Post: | ||
Tomasz Kisiel (01-25-2014) |
#3
|
|||
|
|||
Hi Arun,
thank you for your interest in the problem. I have presented here only a general problem that I encountered . In fact, my model will be more complex such as TE at some point gets information on the start of some activities and then after a certain period of time ( as the activity is completed ) sends a message to yourself and that causes a command to the container in which currently is - not necessarily open ports , can for example, also change the labelnum. And the problem is that I do not know how at the moment to check the container in which it is located ( between sending a message is moved to different containers) . If I use the function ownerobject (current) then it will only work once, and when I use it in another container command is executed for the first container in which I used functions. I think that i will try at onentry send current path to the TE label. Maybe this is some way to solve the issue but it will result in unnecessarily increasing the number of executed script. Maybe there is some function that , if necessary, ask : what is the path to you, my container? Best regards, Tomasz |
#4
|
|||
|
|||
Hello Thomasz,
Your problem is that the reference to the queue is not correct. If you define the ownerobject of the te as a seperate variable and print the name, you can see that both times it refers to Queue2. But in this case you could use the queue that is sending a message to the te as a reference. If you use msgsendingobject() instead of ownerobject( current ) in the message trigger of the te, then you will get the correct reference to the queues. Esther |
The Following 4 Users Say Thank You to Esther Bennett For This Useful Post: | ||
Tomasz Kisiel (01-25-2014) |
#5
|
|||
|
|||
Therefore, I understand that there is only one possibility, if I would like to initiate communication towards the TE-> Container. I must start from the other side: send a message from the Container to the TE and using msgsendingobject () have reference and can answer.
Thank you for your help Esther. Best regards, Tomasz |
The Following User Says Thank You to Tomasz Kisiel For This Useful Post: | ||
Jörg Vogel (02-03-2014) |
#6
|
|||
|
|||
Tomasz,
Another command that you can use is up(current) to get the container of the object. |
The Following 2 Users Say Thank You to Cameron Pluim For This Useful Post: | ||
Tomasz Kisiel (02-02-2014) |
#7
|
||||
|
||||
Hello Tomasz,
your Question: Quote:
Code:
inserttask(ts,TASKTYPE_SENDMESSAGE,outobject(current,port),item); That is the easiest way. It gets a bit complicated if you want to achieve the same in the OnExit-Trigger, because of the runtime of the flexsim engine. First you send a delayed message to the object itself (current). It contains as number values the destination and the item. In the OnMessage -Trigger you create an emptytasksequence with a message task. Then you dispatch this tasksequence. Jörg |
Thread | Thread Starter | Forum | Replies | Last Post |
FlexTips: Sending Messages Using Parameters | Markus Cueva | FlexSim Media | 0 | 09-04-2013 12:34 PM |
FlexTips: Sending a Simple Message | Markus Cueva | FlexSim Media | 0 | 09-04-2013 12:25 PM |
sending flowitem according to excel | Chieng Kai Seng | Q&A | 25 | 08-12-2011 06:17 AM |
Sending messages to Flexsim | cedric molthoff | Q&A | 2 | 03-10-2010 09:48 AM |
Question on sending to different ports | Jamie Santa Ana | Container Terminal (CT) Library | 2 | 09-09-2009 02:54 PM |