Cancel
Showing results for 
Search instead for 
Did you mean: 

how to calculate the parts duration of stay in the store

Valued Contributor
Valued Contributor

I've just a little question about how to calculate the parts duration of stay in the store. I don’t know which name I should use to achieve my purpose,

 

123.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Firstly, calculating the time when the part store[i,j] enters the store;

Secondly, recording the current time;

Then, using variables to calculate duration of stay, such as duration of stay=the current time –entering time;

If duration of stay>=4 hours,

the AGV get the part “store[i,j]” out of the store and send it to the specific location.

 

Could you help me program a method?

3 REPLIES

回复: how to calculate the parts duration of stay in the store

Valued Contributor
Valued Contributor

Thanks everyone!

Though l refer to  some similar models and study them ,now ,here is a possible way to reach the targets:

@.[i,j].cont.starttime:=eventcontroller.simtime       /*record the time when the part enters store*/

@[i,j].cont.move(store)                                                

 

if store[i,j].cont/=void

t:=eventcontroller.simtime-store[i,j].cont.starttime     /*the duration of stay  ,the data type of "t" is time*/

 if  t>=14400                                                                      /*  4hours=14400s  */

store[i,j].cont.move(@)

end

end

回复: how to calculate the parts duration of stay in the store

Siemens Phenom Siemens Phenom
Siemens Phenom

Hello MarkLee,

The MU already has an attribute 'EntryTime' which you can use to get the time the part has entered.

Regards,

Ralf

回复: how to calculate the parts duration of stay in the store

Valued Contributor
Valued Contributor

Thank u very much!

 When I use an object ,it's difficult for me to understand the meanning and syntax of the attributes,i.e, I dont konw how to program  a method with the atttributes,such as the"entrytime" of the entity,"task " of the transporter.

Could you give some suggestions?

 Have a good time!