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
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 08-11-2015
Mauricio Souza
Guest
 
Posts: n/a
Downloads: 0
Uploads: 0
Default 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
Reply With Quote
  #2  
Old 08-12-2015
Jing Chen
Guest
 
Posts: n/a
Downloads: 2
Uploads: 0
Talking 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?
Attached Files
File Type: fsm Change_Star or Stop_Time_Jing(v7.3).fsm (21.8 KB, 362 views)
Reply With Quote
The Following 3 Users Say Thank You to Jing Chen For This Useful Post:
arunkrmahadeva (08-12-2015), sagar bolisetti (08-13-2015), Sebastian Hemmann (08-13-2015)
  #3  
Old 08-12-2015
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 769
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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
Reply With Quote
The Following 7 Users Say Thank You to Jason Lightfoot For This Useful Post:
arunkrmahadeva (08-12-2015), Jing Chen (08-12-2015), Jörg Vogel (08-12-2015), mefhsmflexsimbr (08-14-2015), RalfGruber (08-12-2015), sagar bolisetti (08-13-2015), Sebastian Hemmann (08-13-2015)
  #4  
Old 08-13-2015
Mauricio Souza
Guest
 
Posts: n/a
Downloads: 0
Uploads: 0
Smile Problem solved

Thank you guys for this assistance.
I used Jing's method and it's working greatly!


Regards.

Mauricio
Reply With Quote
Reply

Tags
start time excel

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
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


All times are GMT -6. The time now is 11:43 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.