NEW YORK (TheStreet) -- Cognex (CGNX - Get Report) shares are down by 21.11% to $35.01 in afternoon trading on Tuesday, after the company beat analysts' 2015 second quarter earnings expectations but provided weak guidance for the third quarter.

The Natick, MA-based manufacturing inspection device provider reported earnings of 52 cents per share, a 79% increase over the previous year, which topped analysts' 47 cents per share expectations.

Revenue for the period increased by 56% to $143.8 million, but fell short of analysts' $150 million expectations.

For the current quarter, the company expects to generate revenue of $107.5 million, well short of analysts' $144 million expectations for the period.

Additionally, the company declared a quarterly cash dividend of 7 cents per share payable September 18 to shareholders of record as of September 4.

Separately, TheStreet Ratings team rates COGNEX CORP as a Buy with a ratings score of B. TheStreet Ratings Team has this to say about their recommendation:

"We rate COGNEX CORP (CGNX) a BUY. This is driven by several positive factors, which we believe should have a greater impact than any weaknesses, and should give investors a better performance opportunity than most stocks we cover. The company's strengths can be seen in multiple areas, such as its robust revenue growth, largely solid financial position with reasonable debt levels by most measures, notable return on equity, growth in earnings per share and increase in net income. We feel its strengths outweigh the fact that the company is trading at a premium valuation based on our review of its current price compared to such things as earnings and book value."

CGNX Chart CGNX data by YCharts