reading content in queue every minute

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
Isa
Posts: 2
Joined: Saturday 29 May, 2021 - 12:28

reading content in queue every minute

Post by Isa »

Hello ,
I'm a student who is working on a school project. I want to know how much products are in a queue. I would like to read this value every minute and write it to excel. So if i run the simulation for a hour, I want to have 60 numbers in my excel sheet. Can you help me with the code that takes care of the reading in the queue every minute.

Kind regards,

Isa
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: reading content in queue every minute

Post by HarryBunnik »

Hi Isa,

There are a few options to do create a trigger every 60 seconds.

The first one is to create a small model Source - Sink to the side where the source is releasing every 60 seconds a product and to use the entry trigger of the Sink to execute the command.

The second one, which is a more advanced way is to use the User Event atom that you can find in the library (TIME => User Events).

Under the ...\Documents\Enterprise Dynamics\10.4\Models\Examples\Data\Writing Data To Table.mod a small example model can be found, which might be useful.

I hope this helps you further!

Regards,

Harry
Isa
Posts: 2
Joined: Saturday 29 May, 2021 - 12:28

Re: reading content in queue every minute

Post by Isa »

Hello Harry,

thank you very much for your very quick Answer, you helped me a lot. I followed your advise and it works.

Kind Regard,

Isa
Post Reply