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 > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 01-24-2014
Tomasz Kisiel Tomasz Kisiel is offline
Flexsim User
 
Join Date: Apr 2012
Posts: 13
Downloads: 4
Uploads: 0
Thanks: 9
Thanked 1 Time in 1 Post
Rep Power: 98
Tomasz Kisiel is on a distinguished road
Default 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
Attached Files
File Type: fsm ownerobject.fsm (13.9 KB, 69 views)
  #2  
Old 01-25-2014
arunkrmahadeva's Avatar
arunkrmahadeva arunkrmahadeva is offline
CCS, India
 
Join Date: Sep 2013
Location: India
Posts: 71
Downloads: 67
Uploads: 0
Thanks: 285
Thanked 101 Times in 51 Posts
Rep Power: 145
arunkrmahadeva is a jewel in the rougharunkrmahadeva is a jewel in the rougharunkrmahadeva is a jewel in the rougharunkrmahadeva is a jewel in the rough
Default

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
Attached Files
File Type: fsm ownerobject.fsm (14.0 KB, 55 views)
The Following User Says Thank You to arunkrmahadeva For This Useful Post:
Tomasz Kisiel (01-25-2014)
  #3  
Old 01-25-2014
Tomasz Kisiel Tomasz Kisiel is offline
Flexsim User
 
Join Date: Apr 2012
Posts: 13
Downloads: 4
Uploads: 0
Thanks: 9
Thanked 1 Time in 1 Post
Rep Power: 98
Tomasz Kisiel is on a distinguished road
Default

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  
Old 01-25-2014
Esther Bennett Esther Bennett is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 115
Downloads: 27
Uploads: 0
Thanks: 103
Thanked 116 Times in 50 Posts
Rep Power: 271
Esther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to all
Default

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  
Old 01-25-2014
Tomasz Kisiel Tomasz Kisiel is offline
Flexsim User
 
Join Date: Apr 2012
Posts: 13
Downloads: 4
Uploads: 0
Thanks: 9
Thanked 1 Time in 1 Post
Rep Power: 98
Tomasz Kisiel is on a distinguished road
Thumbs up

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  
Old 01-29-2014
Cameron Pluim Cameron Pluim is offline
Steelcase, Inc.
 
Join Date: Apr 2012
Location: MI
Posts: 30
Downloads: 27
Uploads: 11
Thanks: 5
Thanked 34 Times in 20 Posts
Rep Power: 120
Cameron Pluim will become famous soon enoughCameron Pluim will become famous soon enough
Default

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  
Old 02-03-2014
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Hello Tomasz,

your Question:
Quote:
Originally Posted by Tomasz Kisiel View Post
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.
can get an answer. If you add another sendmessage task in the Tasksequence created in the "Use Transport" function of the Source1 and Queue2 you can communicate from the Taskexecuter to its destination object.
Code:
inserttask(ts,TASKTYPE_SENDMESSAGE,outobject(current,port),item);
Then you can open the output in the OnMessage-Trigger.

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


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.