Why is it not working?
It will work, it's not working because I made a mistake on my schematic, can you guess what it is?
Hint: I missed out a component.
Look at the datasheet for the TL431 and the LM431 for more information.
I'll tell you in a day or so, if no one can figure it out.