How can I get the time remaining in the shift?

How can I get the time remaining in the shift?

aaditya_j
Not applicable
22 Views
5 Replies
Message 1 of 6

How can I get the time remaining in the shift?

aaditya_j
Not applicable

[ FlexSim 18.1.0 ]

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.

0 Likes
Accepted solutions (1)
23 Views
5 Replies
Replies (5)
Message 2 of 6

isaac_l1
Not applicable

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

0 Likes
Message 3 of 6

jeff_nordgren
Not applicable
Accepted solution
@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.

Message 4 of 6

aaditya_j
Not applicable

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
Message 5 of 6

aaditya_j
Not applicable

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

0 Likes
Message 6 of 6

jason_lightfootVL7B4
Autodesk
Autodesk

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[1]-getvarnum(current,"modelstarttime");
0 Likes