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 08-31-2011
nie wuwei nie wuwei is offline
Flexsim User
 
Join Date: Dec 2008
Posts: 6
Downloads: 0
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0
nie wuwei is on a distinguished road
Default Why don't run the custom code

hello everybody,

I build a sample, but it doesn't run. Can you help me? thanks!


if the content of Queue2 more than 7, Queue2 send item to Queue3.
Attached Files
File Type: fsm help.fsm (464.6 KB, 132 views)
  #2  
Old 08-31-2011
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: 319
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

Should be solved by writing your code in the OnEntry Trigger of Queue 2.

OnExit Trigger is only fired when item leaves Queue.
In your model this way only once by first item. And there you close output, so it isn´t fired again.

If you want to built filling level model you will need some code in both, OnEntry and OnExit Trigger ;-)
__________________
Hemmi

Last edited by Sebastian Hemmann; 09-01-2011 at 12:38 AM.
  #3  
Old 09-01-2011
nie wuwei nie wuwei is offline
Flexsim User
 
Join Date: Dec 2008
Posts: 6
Downloads: 0
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0
nie wuwei is on a distinguished road
Default

there are 9pcs items in queus when the first item leaves queue2, so the queue2 output don't close.
  #4  
Old 09-01-2011
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: 319
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

Right. But I can´t help you with sending a model because of don´t got your version.

Just close Output in OnExit Trigger if filling level goes under 7.
__________________
Hemmi

Last edited by Sebastian Hemmann; 09-01-2011 at 11:44 PM.
  #5  
Old 09-01-2011
nie wuwei nie wuwei is offline
Flexsim User
 
Join Date: Dec 2008
Posts: 6
Downloads: 0
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0
nie wuwei is on a distinguished road
Default

My flexsim version is 4.3.
  #6  
Old 09-01-2011
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: 319
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

Mine is 5.1.2 ;-)
__________________
Hemmi
  #7  
Old 09-01-2011
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Sebastian is right, put this code in the entry trigger of queue 2:

if (content(current)>7)
openoutput(current);
else
closeoutput(current);

and then this in the exit trigger:

if(content(current)<7)
closeoutput(current);


Thread Thread Starter Forum Replies Last Post
Custom GUI: Graph OnDraw Phil BoBo Tips and Tricks 2 05-16-2013 03:48 AM
Custom Console Phil BoBo User Development 6 12-12-2011 04:19 AM
how to add custom draw code trigger in flow item LINWEIXU Q&A 10 09-10-2009 12:19 AM
one question about custom draw code trigger LINWEIXU Q&A 5 08-03-2009 11:21 PM
Setting Custom State Francois Perron Q&A 1 04-06-2009 02:37 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.