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 |
#1
|
|||
|
|||
How to set the process time ...?
Hey all,
I'm using Flexsim (Version 4.3). In my model I use a processor with a timetable, that has four colsTime, State, Duration and Speed. Each time a row is read I would like to read the value for the Speed a well, and would set the Process Time of the member of the TimeTable based on that value. Here is my code from the Down Function of the TimeTable: Code:
treenode current = ownerobject(c); treenode downobject = parnode(1); int state = parval(2); int tablerow = parval(3); double duration = parval(4); /**Stop object*/ /** \nExecute stopobject().*/ /** \nID: */ int id = /**/1/**/; /** \nPriority: */ double priority = /**/0/**/; stopobject(downobject ,state, id, priority); setProcessTime(current); return 0; Code:
pt("Hello from uc->setProcessTime");pr(); treenode current = parnode(1); string nodename = getnodename(current); // pt("Node Name: ");pt(nodename);pr(); treenode thetimetable = node("/Tools/TimeTables/TimeTable1>variables/table",model()); double speed = gettablenum(thetimetable, 1, 2); pt("Speed 1: ");pf(speed);pr(); How can I get the member and the process time from the member? How must the code extended to jump the the next row? Is there an API documentation for Flexscript or a Book? Thanks in advance Steffen |
#2
|
|||
|
|||
Steffen:
-Time for an upgrade? > Most of us are already on 5.1! To answer: Pass 'downobject' instead of current in the line: SetProcessTime() of your down function code. The 'current' in your user function then refers to the member object To jump to the next line I'd suggest a label on the downobject (current in the userfunction) that acts as a rowcounter rgds DJ |
The Following User Says Thank You to Dirk-Jan For This Useful Post: | ||
Steffen Hainke (08-22-2011) |
#3
|
|||
|
|||
How to access process time of a processor?
Thanks for the reply!!
Working with version 4.3 is not my idea! Anyway: I tried to access the "process time" like this Code:
// curSpeed = getvarnum(aDownObject, "maxcontent"); // - okay curSpeed = getvarnum(aDownObject, "cycletime"); // - 0.0 Any idea? Steffen |
Thread | Thread Starter | Forum | Replies | Last Post |
Picking process | Simon Farsah | Q&A | 9 | 03-23-2015 06:55 AM |
How can i get the total time of process in the system | wilmermoncada | Q&A | 3 | 11-29-2009 01:44 PM |
How to process with 2 processors at the same time | wilmermoncada | Q&A | 2 | 11-25-2009 08:34 AM |
Re-entrant Process | ankus d | Q&A | 2 | 02-09-2009 07:53 PM |
operators working together to decrease process time | Alex Christensen | Tips and Tricks | 4 | 07-14-2008 09:22 AM |