ATTENTIONThis 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 |
#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
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. |
The Following 3 Users Say Thank You to Brandon Peterson For This Useful Post: | ||
Jörg Vogel (08-22-2008) |
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 |