Hi, I have a road with some wagons, and some sensors on the road, so that when a car(wagon) aproaches a sensor, it triggers an action (load/unload the car).
The problem I found is the following:
When I want to stop the train at a certain wagon (over the sensor) I ask for
If @.name = "SecondWagon" then ....
Then it loads the wagon.
So it moves forward and it comes to a second sensor, which only activates the third wagon by asking:
If @.name = "ThirdWagon" + (Here I want to add a condition that if the second wagon is already full)
What code should I use there? (Since I can not use again "@" because the first wagon is not the one in use)
I Hope the attached image can come handy to understand my problem.
Solved! Go to Solution.
Make use of getFrontWagon & getRearWagon attributes to refer the front & rear wagons of an MU.
In your case,
If @.name = "ThirdWagon" and @.getFrontWagon.full then.....