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 |
#141
|
|||
|
|||
Hi Victor,
I am using this code to set the target in the Combiner: Code:
if(port == 1) { treenode thelist = getvarnode(current,"componentlist"); treenode thesum = getvarnode(current,"targetcomponentsum"); setnodenum(thesum,0); int target=getlabelnum(item,"PackTarget"); setnodenum(cellrowcolumn(thelist,1,1),target); inc(thesum,target); } The container have the label PackTarget. Hope this give you some ideas. Lars-Olof |
The Following User Says Thank You to Lars-Olof Leven For This Useful Post: | ||
Victor Monell (04-01-2009) |
#142
|
||||
|
||||
In normally use the following code:
// SET THE TARGET QUANTITY OF A COMBINER int iTargetQuantity = duniform(2,4); setnodenum(node(">variables/componentlist/From Input Port 2/Target Quantity",current),iTargetQuantity); setnodenum(node(">variables/targetcomponentsum",current),iTargetQuantity); I had a short look into your code and I guess because you first make a treenode to variables (varList) and then use getvarnode your pointer is wrong, because getvarnum already points to variables. In my code you see that I use setnodenum which could also be getnodenum. I guess I did it with setnodenum and not setvarnum, because varnum only points to the first level. I am not sure how to get from componentlist to From Input Port 2 / Target Quantity by using getvarnum. But maybe I am wrong and there is a way. And it looks like that this was what you were trying. Anyway, I hope I gave you the right hints. Looks like that Lars-Olof and me were working on a reply at the same time, but he was faster ... But now you have two replies and hopefully the right hints ...
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
The Following User Says Thank You to Tom David For This Useful Post: | ||
Victor Monell (04-01-2009) |
#143
|
||||
|
||||
Quote:
Thanks very much for the code! It works like a charm. I have a follow-up question, if I may: How did you know you needed to modify targetcomponentsum as well as Target Quantity? This is the sort of "secret information" I'm having a difficult time finding in the Flexsim documentation. Thanks again! VM Last edited by Victor Monell; 04-01-2009 at 01:12 PM. |
#144
|
||||
|
||||
There is a pick option "Update Combiner Component List" in the OnEntry trigger.
|
The Following User Says Thank You to Phil BoBo For This Useful Post: | ||
Victor Monell (04-01-2009) |
#145
|
||||
|
||||
How can I reset or clear the state statistics of a Task Executer?
I have Task Executers, for example trucks, generated by a source. And when trucks moving into different locations, its state will be set to some specific value. Since I recycle the truck, I need to reset the state statistics of the truck when the truck enter the model. I know I can go through the whole state profile and set all of them are 0. I wonder if there is a simple command to do that, but I could not find it in the command help. Thanks for the help.
__________________
Best, Alan |
#146
|
|||
|
|||
Very Simple Question
Why would a combiner release the item into which the rest are to be packed (through port 1) without receiving any of the other items (through port 2).
Alistair |
#147
|
||||
|
||||
Can combiner wait to pull in from port 1?
I think my question is similar to Alistair's.
What I would like to do is have the Combiner wait to pull the container in from port 1 until at least one item is available to be pulled in from port 2. (In other words, I don't want an empty pallet sitting in the Combiner waiting for items to show up.) I tried using "pull" logic on port 1 of the Combiner, but only succeeded in messing up the model so badly it hung Flexsim. Here is the pull logic I tried to use... (Don't try this at home!!) treenode current = ownerobject(c); treenode item = parnode(1); int port = parval(2); /**At least one item must be waiting in upstream splitter...*/ treenode splitNode = inobject(current, 2); // get a pointer to upstream splitter string splitName = getname(splitNode); int splitItems = content(splitNode); pt("From Rebundler: Splitter "); pt(splitName); pt(" contains "); pd(splitItems); pt("."); if (splitItems > 0) return 1; else return 0; How can I get the Combiner to wait until there's an available item on port 2 before pulling in the container on port 1? Many thanks in advance! VM |
#148
|
||||
|
||||
@ Alistair:
Things that I can think off are that the components list is empty, or that you have messed up your pointers somewhere so that somewhere says releaseitem but it is actually the container in your combiner gets the message. @Victor: The easiest way is to block the input of the combiner with closeinput and open it again if a product enters the splitter. |
The Following User Says Thank You to Steven Hamoen For This Useful Post: | ||
Victor Monell (04-06-2009) |
#149
|
||||
|
||||
Quote:
Code:
treenode obj = parnode(1); if(!objectexists(obj)) return 1; // reset profile treenode tn = state_profile(obj); for(int i=1;i<=content(tn);i++) set(rank(tn, i), 0); // reset state since to the current simulation time treenode stateSince = rank(up(tn), 3); set(stateSince, time()); return 0;
__________________
Best, Alan |
The Following User Says Thank You to AlanZhang For This Useful Post: | ||
Tom David (04-09-2009) |
#151
|
|||
|
|||
Hi Alistair,
Check under OnMessage for the Queue, there you have an options called Create Fowitems. Lars-Olof |
The Following User Says Thank You to Lars-Olof Leven For This Useful Post: | ||
Alistair Smitheman (04-21-2009) |
#152
|
|||
|
|||
Quote:
Any ideas, I've attached the file so you can see for yourself. |
#153
|
|||
|
|||
Hi Alistair,
That is correct that when using insercopy or moveobject, no check is done in the receiving object. You must do the check for your self. Lars-Olof |
#154
|
|||
|
|||
Lars-Olof,
Do the copied items pass through the output/input ports? As could a simple content vs max content comparison controlling the ports work, otherwise I'm confused on what would work. Alistair |
#155
|
|||
|
|||
Alistair,
Answer to your first question: What I know, the items are not going through any ports when using insertcopy. Insertcopy will trigger the OnEntry trigger. Answer to the second question: Can you do a simple check between content and max content and the answer is yes. In your case the could looks something like this: Code:
if (content(destination)+numitems>getvarnum(destination,"maxcontent"))return 0; Hope this gives some ideas. Lars-Olof |
The Following User Says Thank You to Lars-Olof Leven For This Useful Post: | ||
Alistair Smitheman (04-21-2009) |
#156
|
|||
|
|||
Looking at code in Visual Studio
I'm having real trouble with my models run times and thought I'd have a look to see if there were any glaring mistakes in the code.
When I reached the bottom of the code there were two parts called: void * runtimegetfunction(int index) and char * runtimegetfunctionname(int index) These seem to contain "a link" to all the triggers in the model, what suprised me and what I am asking is: Is 810 items a lot? Cheers Alistair |
#157
|
|||
|
|||
canceling "waiting the operator" event
Hi,
Could you please advize me how to cancel the "waiting operator"? I have one multiprocessor currently waiting a operator to process one of the sub-processes. However, I would like to bypass all the processes if the flowitem waits for the operator too long. I tried "moveobject" and "destroyobjectevent" for the flowitem. It successfully move the flowitem out of the Multiprocessor (bypass), but the MultiProcessor state is still "waiting the operator" and yellow box is surrounded. Consequently, the next new flowitme for the Multiprocessor cannot get into the MultiProcessor. Any suggestion? Thanks, Sung All, I moved this post to it's own thread: http://www.flexsim.com/community/for...=4279#post4279 It is a complicated question that deserves it's own thread. Brandon Last edited by Brandon Peterson; 04-30-2009 at 01:33 PM. |
#158
|
|||
|
|||
Invalid Node
HELP!
I'm running a model which is happy doing it's thing when I get "invalid node remove command" pop up. What is this and why am I getting it as it is ocuuring at time of steady state where the model doing repeated operations (processed 155 of of a total of 788 items). Any Ideas............ The only downside to trying to find out the problem is that it occurs at a a model time of 1267.38 but it takes 90mins to get there. Cheers Alistair |
#159
|
||||
|
||||
Run your model with the system console open (View > System Console) to see if you have exceptions being thrown in your code. Exceptions in your code are usually the cause of those sorts of problems.
If that doesn't work, you should probably send your model to tech support. |
The Following User Says Thank You to Phil BoBo For This Useful Post: | ||
Alistair Smitheman (05-07-2009) |
#160
|
|||
|
|||
Saving shapes in models
Simple question, hopefully simple question.
Can the custom 3d shapes been saved inside a model so that if it is opened on another computer the shapes are visible? Thanks Alistair |
Thread | Thread Starter | Forum | Replies | Last Post |
Can coordinated task sequence and "break to requirement" be used together? | qin tian | Q&A | 1 | 05-26-2008 10:44 AM |
error message "Clock overflow, running stopped" | Martin Kooijman | Q&A | 11 | 04-17-2008 10:29 AM |
about "no select" and "show parameter window from side bar" | qin tian | Gripes and Goodies | 3 | 03-21-2008 08:10 AM |
Which variable stores "Properties -> General ->Flags -> Protected" information? | KelvinHo | Q&A | 1 | 03-06-2008 06:18 AM |
"Getting Started" and "Tutorial" models for v4.01 | Cliff King | Product Announcements | 0 | 12-10-2007 07:34 PM |