XML Question- How to drive a loco forward for sure Topic is solved

Post Reply
Johnjeanb
Posts: 130
Joined: 04.01.2014, 10:55
Location: Paris Gebiet

XML Question- How to drive a loco forward for sure

Post by Johnjeanb » 27.03.2019, 11:14

Hi Forum friends

My name is Jean and in my project I have included some XML small programs to couple, uncouple trains, control a marshalling yard, etc.

When dealing with a locomotive and its direction I have found only one command : "SWAP" (change direction not knowing which it is).
Ideally, apart from the SWAP command, if there was a FORWARD and REVERSE commands it would be great.

So my question is this: how with XML can I make sure I drive a given loco forward or reverse even if going first with a test:
IF loco xyz = forward THEN swap

Your help with this would be mighty appreciated by a beginer in XML
Cheers
Jean

rjversluis
Site Admin
Posts: 41736
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: XML Question- How to drive a loco forward for sure

Post by rjversluis » 27.03.2019, 11:38

Hi Jean,

normally the direction of a loco movement is set by the dir attribute:

Code: Select all

<lc id="xyz" V="22" dir=true"/>
<lc id="xyz" V="22" dir=false"/>

Johnjeanb
Posts: 130
Joined: 04.01.2014, 10:55
Location: Paris Gebiet

Re: XML Question- How to drive a loco forward for sure

Post by Johnjeanb » 27.03.2019, 12:17

Hi Rob

Thanks a lot for your precise answer. Its exactly what I was looking for.
Cheers
Jean

Post Reply

Return to “Automatic mode”