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 05-16-2012
Peppino Peppino is offline
Flexsim User
 
Join Date: May 2012
Location: Leverkusen, Germany
Posts: 27
Downloads: 1
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 98
Peppino is on a distinguished road
Default Set Combiner Pack quantity by Globalvariabel?

Is it possible to set the Combiner Pack quantity by Globalvariabel?
  #2  
Old 05-16-2012
Jens Mühlheimer Jens Mühlheimer is offline
Flexsim User
 
Join Date: Jul 2008
Location: Stuttgart, Germany
Posts: 140
Downloads: 8
Uploads: 0
Thanks: 40
Thanked 35 Times in 27 Posts
Rep Power: 174
Jens Mühlheimer will become famous soon enoughJens Mühlheimer will become famous soon enough
Default

Put this code in the OnMessage trigger

Code:
setnodenum(node(">variables/componentlist/From Input Port 2/Target Quantity", current), GlobalVariable);
and set the OnReset trigger to

Code:
senddelayedmessage(current,0,current);
Depending on what you want to do in your model, I would think about using a GlobalTable - and get the table value - instead of a GlobalVariable.

// Edit:

Or if you have multiple input ports to your combiner and you don't care how many FlowItems per ItemType are collected you could just use:

Code:
setvarnum(current,"targetcomponentsum",GlobalVariable);
The Following User Says Thank You to Jens Mühlheimer For This Useful Post:
Peppino (05-16-2012)
  #3  
Old 05-16-2012
Peppino Peppino is offline
Flexsim User
 
Join Date: May 2012
Location: Leverkusen, Germany
Posts: 27
Downloads: 1
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 98
Peppino is on a distinguished road
Default

I have a batch productionsystem and i wont only pre-set my 9 combiners by GV. I wont that i dont need to change it in every combiner when i change the batch size in my system.

Why i should send a message to the combiner itselfe on reset, i thing it should by sufficiently to take the change on reset?
  #4  
Old 05-21-2012
Jens Mühlheimer Jens Mühlheimer is offline
Flexsim User
 
Join Date: Jul 2008
Location: Stuttgart, Germany
Posts: 140
Downloads: 8
Uploads: 0
Thanks: 40
Thanked 35 Times in 27 Posts
Rep Power: 174
Jens Mühlheimer will become famous soon enoughJens Mühlheimer will become famous soon enough
Default

Hi Peppino,

well, then the solution to use a GlobalVariable might be sufficient. It's just a personal experience that I always create a GlobalTable called paramters for my simulation model where I control all variables that I might have to change quickly.

About the reset trigger:
Especially with creating FlowItems it's better to create them with the OnMessage trigger combined with a message instead of creating directly in the OnReset trigger.

Quote:
From Anthony Johnson:

It's generally a bad idea to create flowitems on reset. The point of reset is to set the model to an initial state, and not to begin logic for the next model run. Instead, the reset trigger should send a delayed message in 0 time, and then perform the logic in the message trigger. This is so that the model will do its initial population when the user hits the run button, and not the reset button.

http://www.flexsim.com/community/for...hp/t-1602.html
So you are right. In your case it should be totally ok to use the OnReset trigger
  #5  
Old 05-21-2012
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: 684
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

Better test it first. What if the reset of the object is executed after your code and on reset the Target Quantity nodes are reset to 0?

So I would always use a delaymessage to prevent you interfering with the standard code of the object!
  #6  
Old 05-21-2012
Peppino Peppino is offline
Flexsim User
 
Join Date: May 2012
Location: Leverkusen, Germany
Posts: 27
Downloads: 1
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 98
Peppino is on a distinguished road
Default

Hi Jens,

Quote:
then the solution to use a GlobalVariable might be sufficient. It's just a personal experience that I always create a GlobalTable called paramters for my simulation model where I control all variables that I might have to change quickly.
I think that is a good idea, i will use it next time.

About the reset trigger:
That sounds logic, i´ve done it by a delaymessage.

But now i have an other problem. I have all ready a rack in my model that creat on reset his opening balance, but it´s working fine i can´t find any errors.
I´ve done it in that way because i realse items on message.

I think i can change i by an "if" where i check a massage with value maybe 99. When true creat items, else releas item.

Or somebody, know some better?
  #7  
Old 05-21-2012
Peppino Peppino is offline
Flexsim User
 
Join Date: May 2012
Location: Leverkusen, Germany
Posts: 27
Downloads: 1
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 98
Peppino is on a distinguished road
Default

Quote:
Originally Posted by Peppino View Post
Hi Jens,



I think that is a good idea, i will use it next time.

About the reset trigger:
That sounds logic, i´ve done it by a delaymessage.

But now i have an other problem. I have all ready a rack in my model that creat on reset his opening balance, but it´s working fine i can´t find any errors.
I´ve done it in that way because i realse items on message.

I think i can change i by an "if" where i check a massage with value maybe 99. When true creat items, else releas item.

Or somebody, know some better?

I tried it, it works!


Thread Thread Starter Forum Replies Last Post
How can I find the quantity of the ships after finishing run? syseo Container Terminal (CT) Library 0 02-11-2011 08:22 PM
Change the downstream Combiner's batch quantity to this object's batch Nico Zahn Q&A 4 01-07-2011 04:18 PM
Combiner problem Angie Williamson Q&A 6 04-21-2010 09:04 AM
Combiner Target Quantity, Release of packed pallets BenjaminBuecklein Q&A 1 09-04-2008 03:31 AM
a combiner question Vic Li Q&A 2 08-19-2008 03:42 AM


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.