Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

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 @.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.

1 REPLY
Solution
Solution
Accepted by topic author Jerogaro
‎02-09-2017 01:04 PM

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 @.name = "ThirdWagon" and @.getFrontWagon.full then.....

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