Showing results for 
Search instead for 
Did you mean: 

how to refer to an MU that is not the one on my sensor?


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 = "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 = "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.


Re: how to refer to an MU that is not the one on my sensor?


Hello Jerogaro,


Make use of getFrontWagon & getRearWagon attributes to refer the front & rear wagons of an MU.

In your case, 

If = "ThirdWagon" and @.getFrontWagon.full then.....

Thanks & Best Regards,
Abhilash Sridhar
Mercedes Benz R&D India, Daimler AG