To define a switch to pulse in the shape of a square signal, see the diagram below. You need to define the time that the switch will close, the time that it will open again, and the timeframe that this pulse will repeat: