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 |
#121
|
|||
|
|||
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: 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
|
||||
|
||||
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
|
||||
|
||||
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
|
|||
|
|||
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
|
|||
|
|||
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:
Thanks in advance, and sorry for my bad English. I am Belgian. |
#126
|
||||
|
||||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
#131
|
||||
|
||||
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
|
|||
|
|||
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
|
||||
|
||||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
||||
|
||||
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
|
||||
|
||||
Quote:
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
|
|||
|
|||
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. |
#140
|
||||
|
||||
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 |