Portal-Cran

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
thm2012
Posts: 1
Joined: Wednesday 06 June, 2012 - 09:59

Portal-Cran

Post by thm2012 »

This Portal-Cran gets 4 different kind of products (blue, red, yellow, green) and should split the products on 2 conveyors. One conveyer on the left and one on the right. The blue & the red ones should be transportet to the conveyor on the left and the yellow and green products to the conveyor on the right. What is the 4d script for this? thank you.
MarvinH
Posts: 93
Joined: Tuesday 25 January, 2011 - 11:07
Contact:

Re: Portal-Cran

Post by MarvinH »

Hello!

In what way is the color of the products determined? Do they have different icons? If so, then you can use predefined SendTo strategy 12, and alter it to refer to the different icon numbers (use an Or-statement to combine your two types). Otherwise you could compare the color of the product and base the next channel accordingly:

Code: Select all

If(
  Or(
    Color(Rank(1, c)) = ColorRed,
    Color(Rank(1, c)) = ColorBlue
  ),
  { * Red and blue * }
  1,
  { * Not red nor blue, so yellow and green * }
  2
)
Make sure you connect the conveyors in the way that you refer to them in the SendTo, so (in my example) the left conveyor should be connected to the first output channel of the portal crane.

Good luck!

Kind regards,

Marvin
Post Reply