question

Aaditya J avatar image
0 Likes"
Aaditya J asked Jason Lightfoot edited

How can I get the time remaining in the shift?

How can I get the time remaining in the shift for Operator from Machine/Processor?

I am working on a project where I will need the operator to be working in shift. The Operators will be assigned to the work stations, I will check the remaining time in shift, if remaining time > process time then only I will process the part.

FlexSim 18.1.0
shift schedule
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Isaac Litster avatar image Isaac Litster commented ·

Would you be able to upload an example model of what you have so we can better understand the question?

0 Likes 0 ·
Aaditya J avatar image Aaditya J commented ·

Case Description: My Operator is feeding parts to the processor, I have different shift for operator and Processor. At the end of the shift for Processor I dont want any part to be there on Processor. So I will check the available time for machine and process time for part and then based on the study I will move the part to the machine. shiftstudy.fsm

Question : How can I know dynamically the time left before the end of shift.

0 Likes 0 ·
shiftstudy.fsm (24.3 KiB)

1 Answer

·
Jeff Nordgren avatar image
1 Like"
Jeff Nordgren answered Jason Lightfoot edited
@Aaditya J

Without seeing your model and exactly what you are trying to do, here is what I would suggest.

I would have a Global Table with one row and one column. Then in the Time Table OnDown code area I would write a zero in the Global Table. Then in the OnResume code area, I would write the current time in the Global Table. You already know how long the Time Table should last so it should be just a matter of taking the current time, subtract the Global Table start time which would give you the amount of time since the start of the shift. Subtract that from the Time Table (shift) total time and that should give you how much time is left in the shift.

If that doesn't help, seeing how your model works would be very helpful.

Thanks.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Aaditya J avatar image Aaditya J commented ·

Sorry for the delay in reply. I was on vacation. I have uploaded the model for your reference.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Aaditya J commented ·

If you're using a date-based timetable calendar - then in the upfunction (shown as Resume Function in the GUI functions) you can find the time of the next planned stop for a given calendar using the code below. Note that the time values in the table are relative to the calendar start date, as is the modelstarttime variable, which is why you need to subtract that from a given event start time to find simulation event time.

double timeofnextplannedstop=GLOBAL_DELAYINDEFINITE;
Table calendar=getvarnode(current,"table");
if (calendar.numRows>tablerow)
	timeofnextplannedstop=calendar[tablerow+1][1]-getvarnum(current,"modelstarttime");
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.