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

  #1  
Old 08-16-2011
Steffen Hainke Steffen Hainke is offline
Flexsim User
 
Join Date: May 2011
Posts: 3
Downloads: 0
Uploads: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 0
Steffen Hainke is on a distinguished road
Default 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;
Here comes my user command:

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();
So I can access the value for Speed.

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  
Old 08-19-2011
Dirk-Jan Dirk-Jan is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Utrecht, Netherlands
Posts: 43
Downloads: 35
Uploads: 0
Thanks: 11
Thanked 22 Times in 16 Posts
Rep Power: 170
Dirk-Jan will become famous soon enough
Default

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  
Old 08-24-2011
Steffen Hainke Steffen Hainke is offline
Flexsim User
 
Join Date: May 2011
Posts: 3
Downloads: 0
Uploads: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 0
Steffen Hainke is on a distinguished road
Default 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
Where downobject is a PROCESSOR. It works for "maxcontent", but "cyletime" returns 0.0 instead of 99999.00 set in the parameter/properties window.

Any idea?

Steffen
  #4  
Old 08-24-2011
Carsten Seehafer's Avatar
Carsten Seehafer Carsten Seehafer is offline
FlexSim Geek
 
Join Date: Oct 2008
Location: Ritterhude, Deutschland
Posts: 230
Downloads: 45
Uploads: 1
Thanks: 474
Thanked 320 Times in 143 Posts
Rep Power: 379
Carsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud of
Default

getvarnum doesn't work with "cycletime" because it's a flexscript node

P.S.: Try executefsnode() on this node


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


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.