Typically, if you get confrontive with police, they reciprocate. If you're cooperative, they reciprocate.
The key is to be polite, respectful and non-confrontational, but maintain your rights at all times.
The decision to inform LEO's that you're armed depends on the law where you're at and the situation. In PA I DO NOT have to inform officers that I'm armed. The first thing I do is respond in a polite non-threatening way, even if they're buttholes... I then ask if I can leave....
BTW, being polite doesn't necessarily mean cooperating, it means not spitting in their face or telling them off...
The worst encounter I've had with a LEO was ended by me simply asking to leave.... He believed I had run a light and was trying to get me to admit it, to the point of screaming at me. That's when I looked at him and said "Are you going to write me a ticket or am I free to go?" He handed me my license and that was the end of it.
The only armed encounter with a LEO was at a former business I had. My partner and I frequently worked late and always forgot to lock the door. The local police would check businesses from time to time and more then once they walked in while I was OC... The only thing that was ever said was an offhand comment like "it looks like you have everything under control"....
I have a friend that drew his gun on an officer. It was about 3am and there had been some break in's in the neighborhood. The police wanted to check/notify residents and a LEO started pounding on the front door; like break the door off the hinges pounding.... So my friend opened the door with his 629 in hand... He said the officer peed himself (not that I believe it, but it might be true)... The only thing that was said? "Thank god you're one of the good guys..." The officer explained why he was knocking and they shoot the breeze about guns for a little and that was it...
I would argue that most LEO's are good guys, but you never know when you're going to run into the bad apple that is "really" excited to be a LEO....