Do you want it to go forward for X seconds, or when you press a stop button?
To create it, you'd first make the object in Java.
Code:
Relay myRelay = new Relay(int moduleNumber, int channel);
Now that we created the Relay object, we can tell it what to do. If you want it to go forward, you could do something like this:
Code:
myRelay.set(kForward);
To turn it off, you would instead use:
Where and how you use those pieces of code is dependent on when or how you want the values to change. Will it be time based? Do you want a button to turn it off, or maybe a sensor instead?