2 servers with multiple different cycle times

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
thassi
Posts: 2
Joined: Tuesday 14 April, 2015 - 19:41

2 servers with multiple different cycle times

Post by thassi »

Hi!

I have huge problem. I have 12 sources making stuff to two queues. Sources gives every item its own label and label value. Advanced transporter takes them to floor storage and another transporter takes them to two different servers. My problem is that I need to set cycle times for each product for both servers. one of the servers is slower than the other. I have tried different things I found from this forum and I just can't get on. I have tried to make a table where is all the cycle times for both servers, but i just Can't get the server to pick the cycle times from the table. Product labels are 1hm...6hm and 1sh...6sh with values 1 to 12. I would be happy if someone could help me out by giving an example of 4ds script either fetch time from the table or how to put the times directly to the 4ds script. I'm not a coder :)
SimonvdW
Posts: 47
Joined: Thursday 06 January, 2011 - 09:52

Re: 2 servers with multiple different cycle times

Post by SimonvdW »

Hi Thassi,

Let's try to solve this without lots of coding !

Your initial idea to use lables and tables is OK. The 12 sources produce 12 different products, each with a typical label value (1 .. 12). Let us assume these labels are called 'product_id' in this example.

A flexible way of assigning process times is using tables. As I did not exacly understand whether all 12 product types can be on both machines I assume it is possible (if not you can reduce the numbers). So we make a table with 12 values. We give it the name 'ProcessTimesServer1', expand the table size to 12 rows AND check the checkbox 'create alias' ! This alias creates our reference to the tabel.
In the table you fill in the values for the process times (in seconds as this is the standard time unit in ED !!) of each of the 12 products on Server1.

In the first server we can now set the proces time (edit field Cycletime) with the code : cell (label([product_id],first(c)) , 1, refProcessTimesServer1 )

The word cell is a function to indicate that you are referring to a table. The first parameters is the row number, which is in this case assigned to the label value 'product_id' of the product in the server. The second parameter is column no. 1, the third parameter refProcessTimesServer1 is the reference to the table with the name 'ProcessTimesServer1'. This is it.

Now do the same for Server 2 and your problem should be tackled. Good luck !

Regards, Simon
thassi
Posts: 2
Joined: Tuesday 14 April, 2015 - 19:41

Re: 2 servers with multiple different cycle times

Post by thassi »

Work like a charm! :D
Smiliej
Posts: 13
Joined: Wednesday 22 April, 2015 - 12:18

Re: 2 servers with multiple different cycle times

Post by Smiliej »

Is it also possible to do this with uniform in minutes? Like I used to code the cycletime "uniform(mins(30),mins(60))"
SimonvdW
Posts: 47
Joined: Thursday 06 January, 2011 - 09:52

Re: 2 servers with multiple different cycle times

Post by SimonvdW »

Yes, it is also possible to use tables to store the parameters of a stochastic distribution, or even the complete distribution.

The easiest way is to store values, so just the the parameters of the distribution. An example with your suggestion of a uniform distribution:
Suppose that table 'Processtimes' has two columns. The first value (30) is stored in cell( n,1), the second in (60) in cell( n,2), where n is the product nr. According to the previous post the cycle times can be written as::

UNIFORM ( Mins ( Cell (Label([product_id],First(c)) , 1, RefProcessTimes )), Mins ( Cell (Label([product_id],First(c)) , 2, RefProcessTimes )) )
___________

When you prefer to store the stochastic expresssion in a table do the following:
- write the string UNIFORM (Mins(30), Mins(60)) in the cell, for example in cell( n,1) of the table ProcessTimes

As it is an expression instead of a value in the table, we need to use function ExecString to execute the command. So the cycle times should be written like:

ExecString ( Cell (Label([product_id],First(c)) , 1, RefProcessTimes ) )
Post Reply