24v Motor Reversing

Hi,
I have used two relays (the ones that come with the Arduino starter kit) in order to reverse the movement of a 24v motor.
As you can see from the attachment, the circuit is very basic but when I run the program - simply changing the relay every 5 seconds, it seems to continue in the same direction and doesn’t change.

Is it because I need a diode on the motor feeds, or something else that I am missing.
If it is a diode that I need, which would be best to get. The power is 24v and up to 600w.

Thank you

#define relayON 1
#define relayOFF 0
#define relay1 22
#define relay2 24
#define LED1 31
#define LED2 33

void setup() {
// put your setup code here, to run once:
digitalWrite(relay1, relayOFF);
digitalWrite(relay2, relayOFF);

pinMode(relay1, OUTPUT);
pinMode(relay2, OUTPUT);
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
delay(1000);

}

void loop() {
// put your main code here, to run repeatedly:
digitalWrite(relay1, relayON);
digitalWrite(relay2, relayON);
delay(5000);

digitalWrite(relay1, relayOFF);
digitalWrite(relay2, relayOFF);
delay(5000);
}

That pic tells us nothing about the relay are wired up.

You need it like this, this is a DPDT relay, you can configure the same with two SPDT relays.

Or like this with 3rd relay (coils not shown) so you have a power on/off also.

Unfortunately i do not know what the relay types are.
All I can tell you is that it is a two relay module; I have included a picture of it - I hope this helps?

Thank you - I worked it out!!! I had got the wires muddled up!!! :S

Cool.