There was a couple of discussions about integrating the two before
The good news is that for what you want you are OK. The HD500 doesn't send a tempo change that the M9 would recognise, but you can program the tap tempo button:
From phil_m in the second of those threads:
"The M9 can receive MIDI clock, but not send it. The HD500 does neither. Anyway, though, you can assign the correct CC# to the tap tempo switch on the HD500 and send that to the M9. This would sync the M9 whenever you actually tap a tempo on the HD500. CC#64 is what you need to send from the HD500 to the M9. The HD500 Advanced Guide explains how to do this on page B-4."
So set the M9 to listen to a different MIDI channel to the global channel on the HD (so that program change are ignored), then program the hd tap-tempo to sent CC#64 on the channel that the M9 listens to. The bad news is that you will need to set this up separately for every HD patch.