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
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 08-18-2008
Enver Burak KORCAK Enver Burak KORCAK is offline
Flexsim User
 
Join Date: Jun 2008
Posts: 11
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 0 Times in 0 Posts
Rep Power: 144
Enver Burak KORCAK is on a distinguished road
Default How to make a subroutine?

I want to make a function that allways run in background.
I will use this code to check the buffers and generate messages to pull items for necessary locations from related stocking areas.
Where should I place this type of codes?

It should be do that in a cycle, for example every 5 seconds.
It will be very helpful if you can give an example code that executes something like:
...
start:
calculate x = necessary buffer - real buffer
if x>0 then generate message
wait 5 time unit
goto start
...
I'm quite new in Flexsim and also in C++, so sorry for the simple questions but I couldn't find the solution.

Thanks for your help.
Reply With Quote
  #2  
Old 08-18-2008
Brandon Peterson's Avatar
Brandon Peterson Brandon Peterson is offline
The Flexsim Consultant
 
Join Date: Jul 2007
Location: Salt Lake City, Utah
Posts: 382
Downloads: 29
Uploads: 6
Thanks: 192
Thanked 516 Times in 235 Posts
Rep Power: 489
Brandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant future
Default

Enver,

You would want to use a user event to do this. You can specify the start time and the repeat time. The only real complex issue that you are going to have in this is getting pointers to the buffers that you want to search. I would recommend making center port connections from all of the buffers to one particular object in the model (might even be a dummy object just for this purpose). Then create a Global Variable to that object. From there you could reference all of the buffers with the centerobject command.

Use the Tool drop down menu to get to the user events and global variables.

Good Luck,
Brandon
__________________
thats not normal.
Reply With Quote
The Following 3 Users Say Thank You to Brandon Peterson For This Useful Post:
Danny Pavan (08-18-2008), Enver Burak KORCAK (08-18-2008), Jörg Vogel (08-22-2008)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
hope someone to make a video tutorial about GUI qin tian Q&A 11 06-20-2013 10:17 AM
Object to make Perspective View follow objects Brandon Peterson Tips and Tricks 1 11-10-2011 05:59 PM
Make sure you stop model with the stop button before collecting state based statistics Paul Dowling Tips and Tricks 2 06-10-2008 08:10 AM
Make this GUI the Default Ortho GUI jellyboy Q&A 1 03-13-2008 09:11 AM


All times are GMT -6. The time now is 11:27 PM.


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