Morristown, N.J.-based Honeywell (NYSE: HON) is buying Rae Systems Inc., which provides gas and radiation detection systems, for $340 million.

Rae’s systems are meant to detect real-time safety problems and security threats. The company is being sold by private equity firm Vector Capital, which took Rae private in 2011 for about $138 million.

The company will be integrated into Honeywell Analytics, which manufactures instrumentation and sensing technology. The deal is expected to close in the second quarter of 2013.

Vector Capital, headquartered in San Francisco, has also invested in Gerber Technologies Inc., SafeNet Inc., Technicolor and WatchGuard Technologies. 

Constant M&A in the oil and gas industry has spurred deals for the industry’s services companies. In April, DXP Enterprises Inc. (Nasdaq: DXPE) closed a deal for National Process Equipment Inc., which distributes pumps and other supplies for repairs needed by oil and gas companies. Also in April, IHS Inc. (NYSE: IHS) bought Fekete Associates, a company that provides software and consulting services that aim to help customers find and develop oil and gas reserves. 

Citigroup Global Markets Inc. is Rae’s financial adviser, while Shearman & Sterling LLP is legal counsel.