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 |
#61
|
|||
|
|||
visual tools - removing the association
I placed a processor object inside of a visual tool but I don't want the processor associtead with the visual tool in any way. Right now it appears as a sub-node to the visual tool in the model tree. How do I break the assocation of the processor to the visual tool?
|
#62
|
||||
|
||||
If you right click an object in your model in the tree view and go to Edit > Sort Alphabetically, it will sort your model alphabetically. The danger in this option is that you might use it somewhere that is not a good idea, like on your model node itself which will sort the project alphabetically, which will cause various things in the Flexsim that reference things in the project by rank to stop working.
Also, another thing to be aware of when messing around with the order of objects in the tree is that Flexsim assumes often that the Tools folder will be rank 1 under model. Don't mess with the Tools folder rank or things will stop working correctly. |
The Following User Says Thank You to Phil BoBo For This Useful Post: | ||
Joe Allen (09-19-2008) |
#63
|
||||
|
||||
Select the Processor in red in the tree. Highlight the model node in yellow in the tree. Click the Move into Highlighted button in the Edit Selected Objects section of the tree's sidebar (that you access through the little arrow button at the left side of the window).
|
The Following 2 Users Say Thank You to Phil BoBo For This Useful Post: | ||
Jörg Vogel (09-19-2008) |
#64
|
|||
|
|||
As a quick followup question to Tom David's post about rank in the model, does the rank of objects have any impact on the performance of the model. Would it be a good idea to move all visual tools that dont' actually do anything in the model when it runs to the bottom ranks in the tree or will this have no impact on runtime performance?
|
#65
|
||||
|
||||
The ranks of objects in your model usually hardly makes a difference in performance. The only significant speed hit where the rank of the object really makes a difference is in referencing items by a string lookup.
An example of this is: node("/Processor1",model()); If Processor1 is the 2nd object in the model, it compares text "Processor1" to "Tools" and then to "Processor1", finds it, and returns. If Processor1 is the 600th object in the model, it compares text with 599 objects before "Processor1" before it finds "Processor1" and returns. That's quite a bit slower than just comparing text twice. If you are doing things by numbers or pointers, it doesn't make a significant difference. This is why rank() and Global Pointers are faster than referencing things by name. This is also why referencing labels and tables by rank or pointer is faster than by name, especially if you have lots of labels and tables and the one you want is far down the list. |
The Following User Says Thank You to Phil BoBo For This Useful Post: | ||
Joe Allen (09-19-2008) |
#66
|
|||
|
|||
gettablenum() or treenode rank
Does anyone know which of these 2 methods of getting the value out of column 2 row 2 of the 2nd global table would be faster?
Method 1: treenode theGT = reftable(2); double theGTval = gettablenum(theGT,2,2); Method 2: double theGTval = rank(rank(rank(variables(rank(rank(rank(model(),1) ,4),2)),1),2),2); |
#67
|
|||
|
|||
Can a User Command Return a String Value?
Does anyone know how to get a user command to return a string value to the calling procedure?
As a workaround I established a global variable so that the user command can have a space to which it can write the output string. Then the calling procedure reads the string from the global variable. This isn't very clean but it works. I would much rather be able to write: string sTheString = TheStringUserCommand(); ...but this doesn't work. Instead I have to write: TheStringUserCommand(); //writes output to the global variable GlobalVariableString string sTheString = GlobalVariableString; Any suggestions? |
#68
|
||||
|
||||
Joe,
You can use the rank of a global table to get a value from it. So, you could use: gettablenum(2, 2, 2); I don't know for sure but I think that that code is probably the fastest given your situation. As for you second question I can only ask "Why?" There may be a better way of doing what you want without returning a string but we don't know what you are doing. Good Luck, Brandon
__________________
thats not normal. |
The Following User Says Thank You to Brandon Peterson For This Useful Post: | ||
Joe Allen (09-22-2008) |
#69
|
|||
|
|||
You can use the command 'stringreturn' documented in the commands help:
Code:
string result="Returning this as a string"; stringreturn(result); return anum(result); |
The Following 4 Users Say Thank You to Jason Lightfoot For This Useful Post: | ||
RalfGruber (09-23-2008) |
#70
|
|||
|
|||
Thanks Brandon. I thought I tried using a rank before and it didn't work. I'll give it a try again.
As for returning a string, I would like to be able to build some user commands that handle some of the more complicated string parsing so I can get the result they provide with one line of code. It makes for cleaner coding (at least for me). |
#71
|
|||
|
|||
sub integer time units
Can senddelayedmessage() be made to work in sub integer time units? It appears that both senddelayedmessage() and time() only allow integer values. I'm hoping I won't have to convert all the rates in the model to where 100 model time units = 1 second.
|
#73
|
|||
|
|||
Execute Code
Does anyone know a way of executing code written in a user command or elsewhere to test it out without having to create an "on reset" user event or have an object kick off the code on reset?
|
#74
|
||||
|
||||
Joe,
If it is a user command then you can call the command from the script window. If it is a function that is located on a node then you can highlight the node in the tree and click on the "Execute Node" button in the "Edit Highlighted Object" area. Brandon
__________________
thats not normal. |
The Following 2 Users Say Thank You to Brandon Peterson For This Useful Post: | ||
Jörg Vogel (09-26-2008) |
#75
|
|||
|
|||
Task sequence
Hello,
I'm trying to dispatch a global task sequence to an operator with the command "dispatchtasksequence(obj tasksequence)". If I have named the global task sequence "tasksequence1", how do I write the name of my task sequence in the command ? In what trigguer do I write this command ? Thank you !
__________________
---------------------------------------------------- http://www.clermont-cloutier.com |
#76
|
||||
|
||||
Simon,
I am not an experienced user but I think you can dispatch the ts in any of the triggers, depending on what you exactly want the operator to do. Maybe you can give a more detailed explanation of what you'd like to do. Concerning the command you're asking for, I think should be like following: dispatchtasksequence(tasksequence1) |
The Following User Says Thank You to Yasemin Vatandas For This Useful Post: | ||
Simon Riopel (09-29-2008) |
#77
|
||||
|
||||
You should use the createglobaltasksequence command for creating a global task sequence:
createglobaltasksequence(str name, obj dispatcher[, obj dp1, obj dp2, obj dp3, obj dp4, obj dp5]) Description: Creates an instance of the named global task sequence with the given dynamic parameters 1-5 and dispatches it to the specified dispatcher. Returns a reference to the created global task sequence. Note that this does not dispatch the task sequence. You need to dispatch it yourself using dispatchtasksequence(). Example: treenode ts = createglobaltasksequence("GlobalTS", centerobjec(current,1)) To dispatch a global task sequence, just use the dispatchtasksequence command. So in the above example, you would use dispatchtasksequence(ts); ts, because that is the tree node (object) name of the task sequence.
__________________
Jeff Flexsim Support |
#78
|
|||
|
|||
Thank you Yasemine for your fast response !
I'll try to give more detail with a simplified model of what I'm trying to do(see attached file). First, I have 3 different multiprocessors (M1, M2 & M3) with 2 process each (P1 & P2), so I want my operator to do the process of M1 and M2 alternatively at each end of a process (end of P1 of M1, do P1 of M2, do P2 of M1 and complete P2 of M2). After that I want my operator to do the 2 process of M3. I have created a global task sequence (tasksequence1) to do the process in sequence that I have explained. That problem is that the operator is not doing the task sequence. I'm presently using the trigguer "OnResourceAvailable" with the command "dispatchtasksequence(node("/tasksequence1",model()));" and I have tried the command "dispatchtasksequence(tasksequence1)" without success. Thank you for your help ! Simon
__________________
---------------------------------------------------- http://www.clermont-cloutier.com |
#79
|
||||
|
||||
Simon,
I think the problem is that you set the number of operators to 1, in each process in each multiprocessor, which in turn will assign the default-ts to the operator. If you want to use your own ts, the no. of operators value should be set to 'zero' for each process, and then you can assign your own ts to the operator. As for how to dispatch the global ts to the operator, you can use the approach which Jeff has just mentioned, i.e. use the createglobaltasksequence command. Or you can use sendmessage command in the OnEntry trigger of M1,M2,M3 and dispatch the ts in OnMessage trigger of the operator. I am sure there are more reasonable ways to do that but my experience in Flexsim dates back to 2 months and what I've written above are just some suggestions. Hope you get a more concrete help from other users |
The Following User Says Thank You to Yasemin Vatandas For This Useful Post: | ||
Simon Riopel (09-29-2008) |
#80
|
|||
|
|||
Hi,
I have some problems with the command delayeventsofobject, what are the situations where this command is working and where it does'nt ? Because I have a model with conveyors and I want to have a delay for simulating the mecanical transfers between two conveyors. Maybe you have some other ideas to create the delay of tranfer ? Thank you ! Simon
__________________
---------------------------------------------------- http://www.clermont-cloutier.com |
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 |