Multiple 'send to' - statements

All topics on the Atoms in any Enterprise Dynamics Library.
Post Reply
iGeneration
Posts: 4
Joined: Wednesday 21 March, 2012 - 21:20

Multiple 'send to' - statements

Post by iGeneration »

Dear sir, madam,

I recently bumped into a problem with ED I can't solve. I have several products going through several servers. Each product has it's unique sequence through the servers. What I'm looking for is to expand the send-to-statement '6. By atom name: if the atom name matches AtomName then send to channel 1, else 2. I want this more like:
Matches atom1, send to channel 4,
Matches atom2, send to channel 1,
Matches atom3, send to channel 3,

Could you please help me?

Kind regards,

Bas
Josie
Posts: 31
Joined: Friday 30 December, 2011 - 09:40

Re: Multiple 'send to' - statements

Post by Josie »

Dear Bas,
Firstly, you can press the small button under the arrow beside the "Send to" blank, to see the 4D Script codes.
And then more specifically, you can realize your intention in either ways:
The first one is using "if" function:

if(
CompareText(Name(Rank(1,c)),[Atom1Name]),
4,
if(
CompareText(Name(Rank(1,c)),[Atom2Name]),
1,
if(
CompareText(Name(Rank(1,c)),[Atom3Name]),
3
)
)

the second solution is to use "Case":
Case(
WhichIsTrue(
CompareText(Name(Rank(1,c)),[Atom1Name]),
CompareText(Name(Rank(1,c)),[Atom2Name]),
CompareText(Name(Rank(1,c)),[Atom3Name])
),
4,
1,
3
)


Hope it helps,
Best regards,
Josie
iGeneration
Posts: 4
Joined: Wednesday 21 March, 2012 - 21:20

Re: Multiple 'send to' - statements

Post by iGeneration »

Dear Josie,

Thanks for your reply. I'm one step closer to the solution!
I tried the if-function. the product will go into the queue, but will not leave the queue to go to another queue (even if I remove all but one if-statement).
Could you please help me?
Josie
Posts: 31
Joined: Friday 30 December, 2011 - 09:40

Re: Multiple 'send to' - statements

Post by Josie »

Dear Bas,
Can you attach here your model or at least the part that went wrong? I cannot judge what happen just basing on the information you gave me...

KR
Josie
iGeneration
Posts: 4
Joined: Wednesday 21 March, 2012 - 21:20

Re: Multiple 'send to' - statements

Post by iGeneration »

I've attached the case.

I'm trying to get 4 products through 5 sets of machines. Every product has his own cycle time and his own route to follow through the machines.
I'm using the lower queue-atoms to sort of 'guide' the product atoms to their next server. Queue 25 is linked to 4 other queues, which queue the atom for going into the server.

I hope my explanation was clear.

KR,

Bas
Attachments
incontrolsim.mod
incontrolsim.mod
(63.92 KiB) Downloaded 556 times
iGeneration
Posts: 4
Joined: Wednesday 21 March, 2012 - 21:20

Re: Multiple 'send to' - statements

Post by iGeneration »

Solved it. Rookie mistake: I didn't give the products a specific name, so the 4ds script was unable to sort.

Thanks for everything!
Post Reply