Shares of Cognex (CGNX 0.53%) slumped this morning and were trading 21% lower as of 11:40 a.m. ET. Cognex is a world leader in machine vision systems and solutions used to automate manufacturing and distribution processes. Therefore, it extensively uses technologies like artificial intelligence (AI). AI-driven businesses have tremendous growth potential, but things haven't been so easy for Cognex lately, as its latest numbers prove.

Cognex reported a sharp drop in its margins for the second quarter and issued soft guidance for the third quarter, which is why the stock is dropping like a stone today.

Weak auto and electric vehicle markets are hurting Cognex

Here are some of the most important numbers from Cognex's Q2 report:

  • Revenue down 1% year over year
  • Operating margin down to 16.1% from 26.9% in the year-ago quarter
  • Earnings per share down 37% year over year

Right now, automotive is turning out to be the biggest growth hurdle for Cognex given the global slowdown in auto sales, especially electric vehicles. Its Q2 revenue fell primarily because of a soft auto market and slow demand for factory automation systems. Region-wise, cyclical softness in the consumer electronics market hit sales from China. Cognex's largest end markets are automotive, consumer electronics, and logistics; and it also serves other important markets like semiconductors. Demand from logistics and semiconductors remained strong in Q2.

Cognex's margins took an even bigger hit as it booked some costs related to Moritex, an optical components company that Cognex acquired last year in an all-cash deal worth around $275 million.

An opportunity to buy Cognex stock

Cognex expects third-quarter revenue to be between $225 million and $240 million versus $197 million in Q3 2023. While that would mean a double-digit growth year over year, the guidance calls for a 6% drop to flat revenue sequentially.

So should you be worried about Cognex? I'd say no, because one weak quarter doesn't signal a downtrend or justify panic-selling in a stock. Cognex has solid growth potential and counts some of the world's largest companies among its customers.

In fact, Cognex's Q2 numbers may have disappointed, but it expects 15% compound annual growth in revenue in the long term. 2024 may not be a banner year for Cognex, but the long-term story for the company is so strong that today's large drop in the stock price is an opportunity to buy.