Please support me

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
Duuzel
Posts: 4
Joined: Friday 19 October, 2012 - 15:19

Please support me

Post by Duuzel »

Hi, I'm quite new with ED and I hope you can help:

I've got a system where 2 different products arrive, there is one queue, and there are 2 workstations. Each producttype has its own cycle time and can be processed in both stations 1 and 2. So, the workstation has to recognize which product it is, and then assign a specific cycle time according to the product type.

I've trouble with forming the right syntax. Can someone help me? Thnx!
vincent1989
Posts: 15
Joined: Friday 19 October, 2012 - 15:18

Re: Please support me

Post by vincent1989 »

Hello,

Two different products results in two different sources. On the exit trigger of the source (double click on the source) you can give your product a name, so ( Name(i) := [?], click on the little arrow ).

In the server you can subsequently, at the service time, enter the if-statement. The result would then for example be:

If( Name(i) = [?], ''servicetime product 1'', ''servicetime product 2'')

Where the first time holds if the conditional statement is true and the second if false.

Regards,

Vincent.
Last edited by vincent1989 on Tuesday 23 October, 2012 - 15:27, edited 1 time in total.
Duuzel
Posts: 4
Joined: Friday 19 October, 2012 - 15:19

Re: Please support me

Post by Duuzel »

I guess you mean two sources at the beginning?

I've got now two products connected to a source. Each source has one of the following output triggers:

Name(i):=[product1]
Name(i):=[product2]

And on both servers I have:

if(Name(i):=[product1],NegExp(19.8),NegExp(39,6))

So this is what you mean? Thnx!
vincent1989
Posts: 15
Joined: Friday 19 October, 2012 - 15:18

Re: Please support me

Post by vincent1989 »

Fixed my mistake. Thanks for correcting me!

That's what i mean, though in a comparison you should use "=" instead of ":=" (set) and NegExp only uses one parameter.

Regards,

Vincent.
Duuzel
Posts: 4
Joined: Friday 19 October, 2012 - 15:19

Re: Please support me

Post by Duuzel »

Hi.

I've got the model running. Though I have a follow-up question. I need to know the average waiting times of product 1 and 2. This is thus the average time product 1 and 2 spend in the queue. How can I get these results?

Thanks in advance for responding.

Kind regards,
Duuzel
vincent1989
Posts: 15
Joined: Friday 19 October, 2012 - 15:18

Re: Please support me

Post by vincent1989 »

Hello Duuzel,

By going to the 'Experiment Wizard' under 'Experimentation' you can do an Experiment.
Under the performance measures you can add measurements, including the average waiting time.

So click 'add', enter the queue and select 'avgstay'. Give a name and run the experiment.

Does this help to answer your question?

Regards,

Vincent.
Duuzel
Posts: 4
Joined: Friday 19 October, 2012 - 15:19

Re: Please support me

Post by Duuzel »

Thanks Vincent for quick respons. I don't get it. With your tip I get the overall staytime in the queue. I need to know:
- avg staytime in queue of product 1
- avg staytime in queue of product 2

I think I need to do something with syntax... Help?
vincent1989
Posts: 15
Joined: Friday 19 October, 2012 - 15:18

Re: Please support me

Post by vincent1989 »

Hello Duuzel,

Indeed, to achieve what you want 4Dscript needs to be used. Steps in short:

1. Set either a name or a lable on the two products (to keep them apart).
2. Add 2 attributes (totstay1 and totstay2) to the queue.
3. Note 'time' at entry trigger for each product in a label (say [beginstay]).
4. Increase attribute for the appropriate product with time - [beginstay]

This way totstay1 and totstay2 will contain the total stay time for all products. By dividing this time by the amount of products processed one gets the average stay time.

Of course, by running the model for a significant amount of time one will observe that the average stay time for both products in the same queue is nearly identical. (and also nearly identical to the average stay time for all products)

Regards,

Vincent.
Post Reply