Using Loksound's DriveHold feature:

Product Review - 50321 Speaker and Enclosure:

Installing a LokSound L Decoder in an Atlas Locomotive: