These are simple commands to turn on the relay
use the Contact = 1
|------] [---------------------------( )--|
turn on relay while contact = 1
|------] [-------------------------( S )--|
set relay if contact = 1
|------] [-------------------------( R )--|
reset relay if contact = 1
use the Contact = 0
|------]/[---------------------------( )--|
turn on relay while contact = 0
|------]/[-------------------------( S )--|
set relay if contact = 0
|------]/[-------------------------( R )--|
reset relay if contact = 0
Read the links to learn about ladder.
In the help - Manual the program have more information.
http://www.plcs.net/contents.shtml
http://cq.cx/ladder-tutorial.pl
http://cq.cx/dl/ldmicro.txt
http://cq.cx/dl/hello.ld
http://cq.cx/dl/traffic.ld