Just a week after we bought our 2007 DA40 last year my 19 yr old daughter and I were flying from KDTO to KRBD straight through the DFW bravo. This was her first flight in our new airplane. When we closed the canopy we didn't know that the locking pin on the right side was misaligned and that it was actually extended outside of the frame. There was enough friction between the pin and the frame that it appeared from the inside to be normally engaged plus the left side was in fact normally engaged.
About 5 minutes after takeoff we were given a vector that was going to take us straight over DFW which we both thought was pretty cool. Almost immediately after the turn the friction on the right pin gave way and the right side popped open. No worries I thought. Let's just unlatch the canopy and pull it shut. Dumb idea but fortunately not a serious problem. I could get my side back down but my daughter who weighs in at a whopping 90 lbs, could not wrestle hers down. So I contacted the TRACON controller and explains that our canopy had popped open and requested vectors back to KDTO. He asked me if it was an emergency and I said no, not at this time. So we got the vector and during the turn the noise level increased dramatically. Well, I thought this could turn into a really bad day if any unusual lateral aerodynamic loads on the loose canopy were translated to the front hinges. So I reconsidered the declaration and went ahead and requested a 7700 beacon.
We were only a couple of miles from the airport and the approach controller and the tower (KDTO is a class D) were calm and professional, offering advice on nearby airports and winds all the way and asking every minute if I needs any help from them. We arrived at KDTO in short order and landed without incident (no trucks were rolled but they were on standby).
I called the TRACON and talked to the duty manager offering compliments to his controller, noting that while I don't know who it was, he had a thick Boston accent so I told him to convey that there may be a new Red Socks fan in Dallas. He laughed, knowing exactly who I was talking about and thanked me for the compliment. He also heartily endorsed my decision to declare an emergency explaining that it puts the system into a better configuration to handle any unexpected events along the way to getting the aircraft back on the ground.
It all turned out well of course and I never heard from anybody at the FAA. It was a good drill for ATC and it was a good reminder for me to just fly the airplane first, then assess the condition of the aircraft, decide where to go, and then communicate those intentions to ATC, all in that order.
We made sure the latch was fully engaged on the next attempt and it all turned out well for our short hop back home.