send to

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
bsk
Posts: 4
Joined: Tuesday 23 June, 2015 - 12:48

send to

Post by bsk »

Hello
Please help me with this issue. I do not know how to write the appropriate command in "send to". I want to apply this:
If inputs of "Queue 18" are at least one then outputs of "Queue16" will be sent to channel 1 otherwise channel 2
Please find the attached ED model.
Thanks
Attachments
amin2.mod
(28.05 KiB) Downloaded 289 times
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: send to

Post by HarryBunnik »

Hello,

Can you expand a bit on your problem? What do you exactly mean with
If inputs of "Queue 18" are at least one


Do you mean the content of that server (Server13)?

Cheers,

Harry
bsk
Posts: 4
Joined: Tuesday 23 June, 2015 - 12:48

Re: send to

Post by bsk »

Hi Harry,
I mean if the number of products entering queue 18 is lower than 1 (n<=1) then inputs of queue 16 will be sent to channel 1 otherwise channel 2.

For example if from 20 products sent from server 13:
No product enters queue 18 then queue 16 will send their products to channel 1
1 product enters queue 18 then queue 16 will send their products to channel 1
2 products enter queue 18 then queue 16 will send their products to channel 2
3 products enter queue 18 then queue 16 will send their products to channel 2
4 products enter queue 18 then queue 16 will send their products to channel 2
So on…
Thank you,
Ali
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: send to

Post by HarryBunnik »

Ha Ali,

If you write on the the SendTo statement of "Server 13" the following code:

Code: Select all

if(
  Input(out(1, c) {Queue18})  < 2, 
  1, 
  2
)
It will check how many products have entered "Queue18". When this is less then 2, the next product will be send to "Queue18", otherwise to "Queue19".

So that would do what you've requested.

If you interested in the current content, replace Input(out(1, c)) with content(out(1, c)).

I hope this helps you further!

Cheers,

Harry
Post Reply