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

  #121  
Old 11-24-2008
Dennis Adams-Smith Dennis Adams-Smith is offline
Flexsim User
 
Join Date: Oct 2008
Location: Greenville, SC
Posts: 5
Downloads: 8
Uploads: 0
Thanks: 7
Thanked 3 Times in 2 Posts
Rep Power: 0
Dennis Adams-Smith is on a distinguished road
Default New Question : Experimenter Paths?

I'm very new to FlexSim and am trying to continue work on a model built by another forum member, so please be kind.

I'm trying to change the setup time on a processor (DummyProc).
So I figure the path should start something like this:
Code:
MAIN:/project/model/DummyProc>variables/setuptime
But setup time is changing based on whether or not the itemtype changes. Right now I've got values of 13 if itemtype changes and 6 if it does not. I'd like to run experiments where I change both of these values, but I can't seem to get the reference path correct.

Any pointers (pun intended)?

thanks in advance,
Dennis
  #122  
Old 11-24-2008
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

Dennis,

It sound like your setup time is a piece of code (if itemtype changes it is 13 and otherwise it is 6)

So with the experimenter you can't change these number but you have to change the complete code and that is not an easy task if you are just starting.

What I would suggest is that you put these 2 values in a label on your object and in the setup code write: getlabelnum(current, "TheLabelName1") to use those label values.
In the experimenter you can then point to those labels and change them. (The path looked fine to me, so it should be no problem getting to the labels)

Hope this helps,

Steven
  #123  
Old 11-24-2008
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

Putting the values into a global table is another option as well.
The Following User Says Thank You to Anthony Johnson For This Useful Post:
Dennis Adams-Smith (11-24-2008)
  #124  
Old 11-24-2008
Dennis Adams-Smith Dennis Adams-Smith is offline
Flexsim User
 
Join Date: Oct 2008
Location: Greenville, SC
Posts: 5
Downloads: 8
Uploads: 0
Thanks: 7
Thanked 3 Times in 2 Posts
Rep Power: 0
Dennis Adams-Smith is on a distinguished road
Default

Thanks Steven, I was thinking I might have to do something like that (and hoping not to). It's hard for me to tell sometimes what is canned and what is custom code in these models I've inherited. I need to find my way out to Utah for some training.

Anthony, I think what you're suggesting must be the path the original modeler planned to take. Now I have to figure out how to do it.

Following the bread crumbs...

Dennis

Edit: Thanks Anthony, that's going to do it. -djas
  #125  
Old 12-13-2008
Ward Mertens Ward Mertens is offline
Flexsim User
 
Join Date: Oct 2008
Posts: 2
Downloads: 0
Uploads: 0
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
Ward Mertens is on a distinguished road
Default New Question:CloseInput & Time in model

High, I am building a model for a school project of a highway and secundary road, to simulate the difference between roudabouts and ordinary junction with traffic lights.
To analyze the model, I would like to measure how long it takes a flowitem to get from point A to point B. Is this possible with a simple method?

Alse I would like "preset" the traffic lights when pushing the reset button.
In other words, closing some inputs of conveyors.
Therefor I created an User Event to run on Reset Only, writing the following code;


Quote:
treenode licht1 =rank(model(),20);
treenode licht2 =rank(model(),29);
treenode L1=rank(model(),23);
treenode R1=rank(model(),24);
treenode L2=rank(model(),31);
treenode R2=rank(model(),32);

closeinput(licht1);
closeinput(R2);
closeinput(L2);
colorred(R2);
colorred(L2);
colorred(licht1);
openinput(licht2);
openinput(L1);
openinput(R1);
colorwhite(licht2);
colorwhite(L1);
colorwhite(R1);
The conveyors turn red, but flowitems keep passing trough. The closeinput() action do work at my MTBF/MTTR action.

Thanks in advance, and sorry for my bad English. I am Belgian.
  #126  
Old 12-13-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: 490
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

Ward,

Take a look at this sample model: http://www.flexsim.com/community/for...?do=file&id=74

It should be a big help because it models two different intersections with conveyors.

The only reason I can see that you would be having the problem you are is that you are closing the inputs and not the outputs, but without seeing your model I wouldn't know for sure.

Anyway, take a look at that sample model as I'm sure that it will do a lot towards helping you out.

Good Luck,
Brandon
__________________
thats not normal.
  #127  
Old 12-14-2008
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 Ward,

Put the closeinput for the conveyor on the conveyor OnReset trigger.

If I remember right the User Event is fired before the conveyor reset trigger.
Each object have "two" reset trigger, the first one is that one Flexsim have
made and as end user we can not see and change that. The second reset is
that one we find at the tab for triggers.
The sequence of of the different reset triggers are User Event - Default Trigger - User defined trigger on object.

I think that in the Default Reset Trigger all ports is opened, so in your
case the Default Reset Trigger open your ports at reset.

Lars-Olof
The Following User Says Thank You to Lars-Olof Leven For This Useful Post:
Ward Mertens (12-14-2008)
  #128  
Old 12-14-2008
Ward Mertens Ward Mertens is offline
Flexsim User
 
Join Date: Oct 2008
Posts: 2
Downloads: 0
Uploads: 0
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
Ward Mertens is on a distinguished road
Default

That last one seems to be true. I changed the user event from "On Reset" to a first event time of 0,1 time units. So it's done immediately after the start what works just fine. The advantage is that all the presets are grouped in one event, rather than putting al the logic at the OnReset Triggers of the conveyors.
I couldn't open the sample model because the school only provides me the 4.0 version of flexsim and the free download of the 4.1 restricts such large models.

Nevertheless thanks for your help!
  #129  
Old 12-14-2008
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 Ward,

What I do to handle this problem with OnReset is to create an object from
BasicFR and call the object ResetBlock.
In the ResetBlock I put the thing I want to happen when reset is pressed.

Most important thing is to have the ResetBlock set to the highest rank.
The block should be fired last when reset is pressed.

Lars-Olof
  #130  
Old 12-16-2008
Joe Allen Joe Allen is offline
Flexsim User
 
Join Date: Jul 2008
Posts: 80
Downloads: 2
Uploads: 0
Thanks: 34
Thanked 5 Times in 3 Posts
Rep Power: 151
Joe Allen is on a distinguished road
Default Terminate Delayed Message

Is there a way to send an immediate command that will terminate a delayed message before it arrives?
  #131  
Old 12-16-2008
Jeff Nordgren's Avatar
Jeff Nordgren Jeff Nordgren is offline
Technical Support Manager
 
Join Date: Jul 2007
Location: Orem, UT
Posts: 65
Downloads: 79
Uploads: 0
Thanks: 40
Thanked 21 Times in 17 Posts
Rep Power: 233
Jeff Nordgren is just really niceJeff Nordgren is just really niceJeff Nordgren is just really niceJeff Nordgren is just really nice
Default

For what purpose? You would usually handle things like this in the OnMessage trigger of the receiving object. Like if this condition, do nothing, else do this.
__________________
Jeff
Flexsim Support
  #132  
Old 12-16-2008
Joe Allen Joe Allen is offline
Flexsim User
 
Join Date: Jul 2008
Posts: 80
Downloads: 2
Uploads: 0
Thanks: 34
Thanked 5 Times in 3 Posts
Rep Power: 151
Joe Allen is on a distinguished road
Default

I'm assuming your answer means no.

I need to know if a state of a sensor has changed since the message was sent. The sensor could change to true or false multiple times between the time the delayed message was sent and the time it is received. If the state of the sensor changes from the state that it was in when the delayed message was sent to another state and back again before the message returns I have know way of knowing if it changed at all. I would like to kill the delayed message when the sensor changes from the state that it was in during the sending of the delayed message. If I can't do this I will need to make use of 1 or more variables to keep track of the states that the sensor changed to. Multiple delayed messages could be fired after the first one during the wait time for the first one to return so I can't use a global table cell to capture the state of the sensor since I would need variables in the global tables that are tied specifically to the messages and there could be a variable amound of messages each needing a global table cell specific to itself. If I could make use of global variables like in other programming languages and create them with names that are tied to each particular delayed message with some sort of id. This would really be a messy way of accomplishing what could easily be done by terminating the delayed message directly (if this is possible). If this can be done please let me know how since this will be the most elegant solution to my problem.
  #133  
Old 12-16-2008
Jeff Nordgren's Avatar
Jeff Nordgren Jeff Nordgren is offline
Technical Support Manager
 
Join Date: Jul 2007
Location: Orem, UT
Posts: 65
Downloads: 79
Uploads: 0
Thanks: 40
Thanked 21 Times in 17 Posts
Rep Power: 233
Jeff Nordgren is just really niceJeff Nordgren is just really niceJeff Nordgren is just really niceJeff Nordgren is just really nice
Default

If my answer was no, I would have said no.

What happens is that the sent message get put into the model event queue. Can an event be deleted? Sure, but it's usually not the desired way of handling things.

I'm not sure I still understand exactly what is needed in your model, so if this response if off the wall, just let me know. I'm guessing that you have a fixed number of sensors with a fixed number of states? If so, you could create a global variable for each sensor (integer array) with enough array elements for all the states. When that sensor changes to a certain state, increment that array element for that state.

In the message, you could pass the current state of the sensor, the number of times that state has been entered. Then in the OnMessage trigger you could check that sensor and see if it has changed from the state that was passed in the message and if it has changed to that state since the message was sent. By the number of times that state has been entered. Then you can do whatever you need to do in the OnMessage trigger to handle it. Do something or not do something. And you still have one additional parameter in the message trigger that you could pass information. Would something like that work?
__________________
Jeff
Flexsim Support
  #134  
Old 12-16-2008
Joe Allen Joe Allen is offline
Flexsim User
 
Join Date: Jul 2008
Posts: 80
Downloads: 2
Uploads: 0
Thanks: 34
Thanked 5 Times in 3 Posts
Rep Power: 151
Joe Allen is on a distinguished road
Default

Let me try and clarify what you are saying. Are you suggesting establishing global arrays for each sensor with array values for each state of the sensor, then during the model run continually incrementing the numbers in the array when the sensor changes to those states, then sending in the message the number of times the sensor has been in each of the states that it can be in, then check again when the message is received to evaluate whether the number has been incremented any further since the message was sent?
  #135  
Old 12-16-2008
Joe Allen Joe Allen is offline
Flexsim User
 
Join Date: Jul 2008
Posts: 80
Downloads: 2
Uploads: 0
Thanks: 34
Thanked 5 Times in 3 Posts
Rep Power: 151
Joe Allen is on a distinguished road
Default

I forgot to ask. How do you delete the delayed message from the event queue? I would like to understand all available options in order to have the ability to pick which one is best suited not just for this situation but potential future situations. I enjoy learning new things (even if they are usually not the desired way to handle a situation).
  #136  
Old 12-17-2008
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

We have a similar situation. We use a time stamp in the delayedmessage when it was send. The same time is set to a global variable. So if a message is recieved on a trigger it compares time stamp in the message with the time in the global variable. If it is even the message is still not changed by another message and it is executing the rest of the program code.

Jörg
The Following User Says Thank You to Jörg Vogel For This Useful Post:
Joe Allen (12-17-2008)
  #137  
Old 12-17-2008
Jeff Nordgren's Avatar
Jeff Nordgren Jeff Nordgren is offline
Technical Support Manager
 
Join Date: Jul 2007
Location: Orem, UT
Posts: 65
Downloads: 79
Uploads: 0
Thanks: 40
Thanked 21 Times in 17 Posts
Rep Power: 233
Jeff Nordgren is just really niceJeff Nordgren is just really niceJeff Nordgren is just really niceJeff Nordgren is just really nice
Default

Quote:
Originally Posted by Joe Allen View Post
Let me try and clarify what you are saying. Are you suggesting establishing global arrays for each sensor with array values for each state of the sensor, then during the model run continually incrementing the numbers in the array when the sensor changes to those states, then sending in the message the number of times the sensor has been in each of the states that it can be in, then check again when the message is received to evaluate whether the number has been incremented any further since the message was sent?
That is pretty much it, except for the passing each state in the message. You would only need the current state and how many times it has entered that state. It's understood that if the current state isn't the same state as the one passed in the message, then it has changed. In the third parameter of the message, you could also pass the time and do something like Jörg is suggesting.

The command you are looking for to delete events is destroyeventsofobject(). Just know that if you shoot yourself in the foot, I don't have any bandages.
__________________
Jeff
Flexsim Support
The Following User Says Thank You to Jeff Nordgren For This Useful Post:
Joe Allen (12-17-2008)
  #138  
Old 01-08-2009
Joe Allen Joe Allen is offline
Flexsim User
 
Join Date: Jul 2008
Posts: 80
Downloads: 2
Uploads: 0
Thanks: 34
Thanked 5 Times in 3 Posts
Rep Power: 151
Joe Allen is on a distinguished road
Default Error on Excel Import

Every time I try to use Multiple Table Import to import my global tables from excel now it fails. The error log states:
Call was rejected by callee.
ExcelOpen: FileName: [ThePath]

Is there any way to trouble shoot this? I've been using this same excel for a long time and never had a problem before. Just in case anyone wonders... the excel file is not already open.
  #139  
Old 01-08-2009
Joe Allen Joe Allen is offline
Flexsim User
 
Join Date: Jul 2008
Posts: 80
Downloads: 2
Uploads: 0
Thanks: 34
Thanked 5 Times in 3 Posts
Rep Power: 151
Joe Allen is on a distinguished road
Default

Restarting the computer cleared this issue up. I apologize if I have wasted anyone's time.
  #140  
Old 03-31-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
Arrow simple question on Combiner

Hi all,

I'm still going through some newbie "growing pains." I am trying to get/set the target quantity on port 2 in a Combiner in pack mode. After examining the tree view of my Combiner, I was convinced the following code would work:

/**Go get the target number.*/
treenode current = ownerobject(c);
treenode varList =
getvarnode(current, "variables");
treenode compList =
getvarnode(varList, "componentlist");
treenode port2list =
getvarnode(compList, "From Input Port 2");
int targetNum =
getvarnum(port2list, "Target Quantity");

pt("\nCombiner got a target quantity of "); pf(targetNum);

It's clearly not working, however, because the console message says the value obtained was zero, when in reality it is a positive integer.

Can someone point me to the correct way in Flexscript to get/set the target quantity in a Combiner?

Many thanks in advance.
VM


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.