Time Label by entering a atom

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
Medo
Posts: 4
Joined: Wednesday 16 October, 2013 - 21:29

Time Label by entering a atom

Post by Medo »

Hi,

I have difficulties to put a timelabel by entering a atom.

I want to know how late the last product has entered the atom.
And where can i find the information of this label? Can i build in a monitor?

Thanks a lot,


BR,

Medo
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Time Label by entering a atom

Post by marlies »

Hi Medo,

See attached for a small example:

- In the trigger on entry of the server you will find code that assigns a label named LastEntry to the server. The label contains the time of the last entry. The label is assigned to the server by using the reference 'c'.
- The monitor atom can be found in the category Results of the library. I added it to the model and it shows you the current value of the label. You could also check label values by selecting an atom in the model layout and then go to: Tools > View Atom Labels (or Shift + F10).

Regards, Marlies
Attachments
monitorlastentry.mod
(14.8 KiB) Downloaded 265 times
Medo
Posts: 4
Joined: Wednesday 16 October, 2013 - 21:29

Re: Time Label by entering a atom

Post by Medo »

Hi Marlies,

Thank you for your clear answer. It is clear how to use the script.
In this case: Setting a time label, is this Always the last product?
And, in the tabel there is a time, i think it is in seconds. Is this the time in seconds after the begin/start of the simulation?

Looking forward for your reaction,

Bedankt.

Medo
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Time Label by entering a atom

Post by marlies »

Hi Medo,

The code is written in the Trigger On Entry, therefore: every time a product enters, the label on the server atom gets an update and every time you read the label value, it will return the last time a product entered the server.

Yes, the command time returns the simulation time that elapsed during start of the simulation. The time is in seconds.

Regards, Marlies
Medo
Posts: 4
Joined: Wednesday 16 October, 2013 - 21:29

Re: Time Label by entering a atom

Post by Medo »

Hi Marlies,

Thank you! It works fine.


Regars,

Medo
Post Reply