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

  #141  
Old 04-01-2009
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

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);
}
In this code it is the container that tells the combiner how many to combine.
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  
Old 04-01-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

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  
Old 04-01-2009
Victor Monell's Avatar
Victor Monell Victor Monell is offline
Flexsim User
 
Join Date: Mar 2009
Location: Seattle
Posts: 4
Downloads: 3
Uploads: 0
Thanks: 7
Thanked 0 Times in 0 Posts
Rep Power: 0
Victor Monell is on a distinguished road
Default

Quote:
Originally Posted by Tom David View Post
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);
Hi Tom,

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  
Old 04-01-2009
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

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  
Old 04-01-2009
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Default

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  
Old 04-02-2009
Alistair Smitheman Alistair Smitheman is offline
Flexsim User
 
Join Date: Aug 2007
Location: Nottingham, England
Posts: 43
Downloads: 6
Uploads: 0
Thanks: 21
Thanked 1 Time in 1 Post
Rep Power: 157
Alistair Smitheman is on a distinguished road
Default 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  
Old 04-03-2009
Victor Monell's Avatar
Victor Monell Victor Monell is offline
Flexsim User
 
Join Date: Mar 2009
Location: Seattle
Posts: 4
Downloads: 3
Uploads: 0
Thanks: 7
Thanked 0 Times in 0 Posts
Rep Power: 0
Victor Monell is on a distinguished road
Default 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  
Old 04-06-2009
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

@ 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  
Old 04-09-2009
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Default

Quote:
Originally Posted by AlanZhang View Post
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.
Since I cannot not find the Flexsim command, I coded a user command resetStateProfile(treenode obj) to do this:

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)
  #150  
Old 04-20-2009
Alistair Smitheman Alistair Smitheman is offline
Flexsim User
 
Join Date: Aug 2007
Location: Nottingham, England
Posts: 43
Downloads: 6
Uploads: 0
Thanks: 21
Thanked 1 Time in 1 Post
Rep Power: 157
Alistair Smitheman is on a distinguished road
Default Spliting

Is there any other way of turning 1 flowitem into 1000 without using a seperator?
  #151  
Old 04-20-2009
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

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  
Old 04-21-2009
Alistair Smitheman Alistair Smitheman is offline
Flexsim User
 
Join Date: Aug 2007
Location: Nottingham, England
Posts: 43
Downloads: 6
Uploads: 0
Thanks: 21
Thanked 1 Time in 1 Post
Rep Power: 157
Alistair Smitheman is on a distinguished road
Default

Quote:
Originally Posted by Lars-Olof Leven View Post
Hi Alistair,

Check under OnMessage for the Queue, there you have an options called Create Fowitems.

Lars-Olof
Cheers, looks like it should work it should a more efficently than the combiner, however, it does seem to let the object down stream go over it's capacity if you send the flowitems directly into it.

Any ideas, I've attached the file so you can see for yourself.
Attached Files
File Type: zip flowitemcreationtest.fsm.zip (37.5 KB, 198 views)
  #153  
Old 04-21-2009
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

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  
Old 04-21-2009
Alistair Smitheman Alistair Smitheman is offline
Flexsim User
 
Join Date: Aug 2007
Location: Nottingham, England
Posts: 43
Downloads: 6
Uploads: 0
Thanks: 21
Thanked 1 Time in 1 Post
Rep Power: 157
Alistair Smitheman is on a distinguished road
Default

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  
Old 04-21-2009
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

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;
The code should be before the for loop.

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  
Old 04-22-2009
Alistair Smitheman Alistair Smitheman is offline
Flexsim User
 
Join Date: Aug 2007
Location: Nottingham, England
Posts: 43
Downloads: 6
Uploads: 0
Thanks: 21
Thanked 1 Time in 1 Post
Rep Power: 157
Alistair Smitheman is on a distinguished road
Question 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  
Old 04-30-2009
Sung Kim Sung Kim is offline
Flexsim User
 
Join Date: Jan 2008
Location: York, PA
Posts: 85
Downloads: 70
Uploads: 0
Thanks: 70
Thanked 9 Times in 6 Posts
Rep Power: 160
Sung Kim is on a distinguished road
Default 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  
Old 05-05-2009
Alistair Smitheman Alistair Smitheman is offline
Flexsim User
 
Join Date: Aug 2007
Location: Nottingham, England
Posts: 43
Downloads: 6
Uploads: 0
Thanks: 21
Thanked 1 Time in 1 Post
Rep Power: 157
Alistair Smitheman is on a distinguished road
Exclamation 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  
Old 05-05-2009
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

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  
Old 05-07-2009
Alistair Smitheman Alistair Smitheman is offline
Flexsim User
 
Join Date: Aug 2007
Location: Nottingham, England
Posts: 43
Downloads: 6
Uploads: 0
Thanks: 21
Thanked 1 Time in 1 Post
Rep Power: 157
Alistair Smitheman is on a distinguished road
Default 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


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.