turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Navigation
- Tecnomatix
- Forums
- Blogs
- Knowledge Bases
- Groups

- Siemens PLM Community
- Tecnomatix
- Plant Simulation
- Find the index of time interval for multiple days

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Saturday

I would like to divide the time into a lot of 15-minute intervals and use i to be its index. Originally, I just run the model for an 8 hour shift. So I use the code below to find i. It works, so i=1 ,2, 3, ..., 32. (8 hours have 32 15-minute intervals)

a:=time_to_num(timeofDay(EventController.AbsSimTim

i:=a//900;

Now I need to run the model for a lot of days. I need the i to be indexed by i=1,2,...,32,33,......... Which function I should use to replace the function "TimeofDay"?

Thanks

CSW

3 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Sunday

i:= time_to_num(shiftCalendar.calculateWorkingDuration

Steffen Bangsowfreelance simulation specialist web: www.bangsow.eu mail: steffen@bangsow.net |

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Monday

Hi CSW,

Steffen's solution considers that you only need interval-numbers during the working times; so e.g. you only have one 8hr-shift every day, then every day:

- 16:00-24:00-8:00 would not have any interval-numbers (or more precisely the same interval-number as 15:45-16:00 of the previous day!),and
- 8:00-16:00 would have
*32*(numDays - 1) + {1..32}*as interval numbers.

In case you need an interval number for every 15min-interval of each day, disregarding the shift-model, you could simply use

iIntervalNumber := time_to_num(EventController.SimTime) // 900;

The SimTime-attribute starts at 0, no matter what you set as starting datetime of the eventcontroller (so you don't have to subtract the 8hr like you did).

Regards,

Alex

____________________________________________________________

Alex Dilg, Consultant at**Sim**Plan AG (www.SimPlan.de)

This post was good and/or helpful to you? Please provide some Kudos, thank you!

This answered your question? Please mark it as "Accepted Solution", thank you!

Alex Dilg, Consultant at

This post was good and/or helpful to you? Please provide some Kudos, thank you!

This answered your question? Please mark it as "Accepted Solution", thank you!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Monday

if timeofday(eventcontroller.abssimtime)>=21600 /*(600hrs)*/ and timeofday(eventcontroller.abssimtime)<=50400/*(140

tm:=timeofday(eventcontroller.abssimtime);

value:=tm\\900;

if value=0 then

i:=i+1;

end;

end;

Sachin

Follow Siemens PLM Software

© 2017 Siemens Product Lifecycle Management Software Inc