Do you have the values for what you system is running ie what is the high and low pressures when at idle and when at 3000 free rev with ac on. You want around 30-50 on the low side and 230-270 on the high side this will vary with engine rev. At idle ur looking on the high end of the low side so 50 and low end of high side so 230, then at 300 ur looking more around 30 on low and 270+ on high. These numbers will vary with altitude, humidity and temperature outside.
As for diagnostics if you high side is too high then its probably something condenser related so check your ac fan and normal fan and check for blockage of airflow through condenser. Next if you high side is low and low side is high your most likely looking at a compressor issue, or a low charge. If you high side is low and low side is low, most likely low charge or could be a restriction or could be a thermal expansion valve problem. And if you high side is high and low side is low, look for a blockage in the liquid line, probably at the orifice tube. And thats about the cut and dry of it there could be other problems but these are the most common. And one last thing make sure the compressor clutch comes on and stays on, if it only comes on for a second then you could have a bad low pressure sensor or a low charge, if pressures on low side are above 25 and the compressor is cycling off then check sensor and check clutch coil.
And the code 51 could be a lot of things like ac is on when you start the car or your pressing the peddle when u start it or other things.