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
Downloads

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

  #1  
Old 04-11-2016
ACGN SeaTT
Guest
 
Posts: n/a
Downloads: 1
Uploads: 0
Question How to open and close the queue input/output every 30 sec?

Dear all,

I am doing a transportation traffic road simulation with flexsim 6.0 version.

i have created the 5 sources representing 5 different vehicles and connect them to the queue (for the vehicles can go to random port) and then 2 same direction conveyors and finally sink.

Now i wish to the vehicles can pass through the queue every 30 sec, which means that 30 sec allow the car pass through and stop the car for another 30 sec. But i do not know how to do and i have limited knowledge on programming code.

Great thanks
kevin
  #2  
Old 05-10-2016
Adarsh Jeyes
Guest
 
Posts: n/a
Downloads: 3
Uploads: 0
Default

It would be helpful for users to understand your problem better if you could attach a sample of your model along with your question.

As far as I've understood, you want to alternatively open and close the input/output of the queue every 30 s.

Assuming model units in seconds, and working only with the output of the queue, use the following code on the queue:

OnResetTrigger:
openoutput(current);
senddelayedmessage(current,30,current,1);

OnMessageTrigger:
if(msgparam(1)==1)
{
closeoutput(current);
senddelayedmessage(current,30,current,2);
}

if(msgparam(1)==2)
{
openoutput(current);
senddelayedmessage(current,30,current,1);
}
The Following 4 Users Say Thank You to Adarsh Jeyes For This Useful Post:
Sebastian Hemmann (05-12-2016)

Tags
queue


Thread Thread Starter Forum Replies Last Post
Open and Close Output Herwina Richelle Andres Q&A 4 03-22-2016 09:59 AM
Close or open the output for the source Ismail Benabicha Flexsim Student Forum 2 04-30-2015 01:13 PM
Close and Open ports in Processor every 80 seconds? Gaurav Majumdar Q&A 2 07-17-2013 11:19 AM
How to open/close a single port in objects Manoj Kumar Q&A 12 04-23-2013 07:21 AM
How to open/close processor when there is a long queue Lilian_wulp Q&A 5 12-03-2008 08:51 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.