tracking time and entering this time in a formula

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
WUR
Posts: 21
Joined: Monday 10 June, 2013 - 14:14

tracking time and entering this time in a formula

Post by WUR »

For my simulation model I want to track the quality of the products at fixed moments in my simulation.
At production I provided the label [quality] and then the formula for quality decay of products.
However, this formula is dependend on time (e.g. Label ([quality]) := 20 + 10 * t). Does ED provides opportunities to track time of products until the moment quality is checked, the time is entered in the formula, and based on the outcome a decision is made (Channel 1 or Channel 2)?
BartC
Posts: 47
Joined: Monday 05 November, 2012 - 17:05

Re: tracking time and entering this time in a formula

Post by BartC »

Hi,

Dependent on which time you want to check there are two possibilities:
  • Use the function "Age(Atom)" to get the time in seconds since the creation of the atom
  • Set a label on the atom at a certain moment (e.g. On the entrytrigger of a server: label([EntryTime]) := Time). Than when you want to measure the time since then you can extract this label from the current simulation time, e.g. if you want to know the service time of the server, use the following code on the exittrigger of the server: Servicetime := Time - label([EntryTime])
Regards,

Bart
Post Reply