Page 1 of 1

send to logical function if

Posted: Thursday 18 February, 2016 - 18:05
by mgalic
Hi,

I'm having problems with a simple function in ED - send to strategy with if logical function! I need to structure a code by which each product (or batch) will go through a test: if product's time from EntryTime (in Server) till leaving the queue is < or = to 2 hours go to channel 1, else channel 2!
Meaning that if product spends more than 2 hours in server + waiting in queue send it to channel 2.
I've tried and tried, but with no results! Please help me and it is not necessary to appoint me to F1 (I'm fully aware of it and its confusing and misleading English!).
My last try obviously doesn’t solve my problem and is attached. Can anybody give me an advice?
Thank you,
Mario

Re: send to logical function if

Posted: Thursday 18 February, 2016 - 18:29
by mgalic
sorry, I've uploaded a wrong model

this is the right one

Re: send to logical function if

Posted: Friday 19 February, 2016 - 10:13
by HarryBunnik
Ha Mario,

If you set (on the OnExit trigger of your first server) a label on the leaving product that contains the time that a product is busy in the server:

Code: Select all

Label([TimeBeingServed], i) := Time - EntryTime(i)
And then check this on the SendTo statement that is on the Queue:

Code: Select all

If(
  Label([TimeBeingServed], first(c)) > hr(2), 
  2, 
  1
)
I think it's doing what you want. I've updated your model so you can have a look.I hope it helps you!
sendto - problem_vHB.mod
(10.47 KiB) Downloaded 305 times
Cheers,

Harry

Re: send to logical function if

Posted: Friday 19 February, 2016 - 13:47
by mgalic
Hi Harry,

so far so good! Works like a charm :D

Thanks mate,
Mario