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 Model Start Time from Excel?
Dear all, is it possible to set the Model Start Time from an Excel's table? I know how to import data from Excel, I usually do this. But I'd like to know if I can set the Model Start Time from an imported data.
Actually I want to change also the Finish Time from the same Excel's input. Is it possible? How? Best Regards. Mauricio |
#2
|
|||
|
|||
Based on the UnixTime
Hi Mauricio
I am very interested in your question. Due to the different timing patterns of regular time and computer system ,It's inconvenient to set the Model Start or Stop Time from an Excel's table. So I tried to make a user command to make it easy to do. In the model attached, you can use the command set_time() to set the start or stop time. The first six parameters are yyyy/MM/dd/hh/mm/ss (u can see the example in the discribe), and the last parameter decide you want to set the start time or the stop time. The core command is applicationcommand("convertunixtime", tonum(Node), Time); You can read the date information from different cells in excel as the parameters of "set_time" Any suggestions would be appreciated? |
The Following 3 Users Say Thank You to Jing Chen For This Useful Post: | ||
Sebastian Hemmann (08-13-2015) |
#3
|
|||
|
|||
Excel datetimes are OADatetime doubles when imported to FlexSim 7.5 (if you choose numeric rather than automatic data distinction, or if you go through a DB) (Matt mentioned this changing for 7.7 next beta to automatically create unixdatetimes).
Try this: Code:
#define UNIXSECSB4OADATETIME 9435312000.0 double unixstart=oastart*days(1)+UNIXSECSB4OADATETIME; treenode startNode = tonode(getmodelunitnum(START_TIME_NODE)); set(startNode, unixstart); applicationcommand("convertunixtime", tonum(startNode), unixstart); Last edited by Jason Lightfoot; 08-13-2015 at 10:01 AM. Reason: Clarification on how to get oaddatetime imported |
The Following 7 Users Say Thank You to Jason Lightfoot For This Useful Post: | ||
Sebastian Hemmann (08-13-2015) |
Tags |
start time excel |
Thread | Thread Starter | Forum | Replies | Last Post |
Unable to set model start time with custom repeating Time Table? | Ryan Davis | Q&A | 1 | 04-30-2014 05:00 PM |
Simulation Start Time | Jamie Santa Ana | Container Terminal (CT) Library | 1 | 04-14-2010 09:02 AM |
What is the exact start time of dewell time? | zhang xin | Container Terminal (CT) Library | 1 | 11-23-2009 10:56 AM |
Command overview does not start because XML does not start | Tom David | Q&A | 0 | 09-17-2008 12:11 AM |
Start Flexsim and model from externally via a batch file | Tom David | Q&A | 3 | 09-12-2007 03:17 PM |