It sounds like performance anxiety since you can get an erection. This comes from putting too much pressure on yourself, and nervousness. Pay close attention to how you feel at the moment, I'm sure you are nervous or afraid you won't perform well. Seeing a therapist would help you to overcome this, and also talk to your doctor about the anxiety. Ask your girlfriend to be patient while you work on this. Take care.
Sorry, but I don't understand your response. Perhaps you could explain it to me.
See a urologist. The problem could be physical rather than mental.
Peace
Greenlydia