<PAGE>
                                                                     Exhibit 10M


                            TRANSITION LOAN AGREEMENT


On this the 24th day of May, 2001, James Hoffmaster, an individual with a
residence at Deerpath Road, Dedham, MA 02026, ("Hoffmaster") and Cognex
Corporation, a Massachusetts corporation with an address at One Vision Drive,
Natick, MA 01760 ("Cognex"), hereby enter into this Transition Loan Agreement
("TLA") pursuant to the following terms:

1.    Cognex agrees to provide Hoffmaster an interest free loan in the amount of
      Two Hundred Thousand Dollars ($200 000.00) ("Loan Amount") payable by
      Cognex within ten (10) business days of the later of: a) Hoffmaster's
      signing of all the agreements required by Cognex as a condition of his
      becoming an employee as defined in Cognex's Offer Letter dated May 22nd,
      2001, or b) Hoffmaster's first day of full time, paid employment at
      Cognex.

2.    Hoffmaster shall repay the loan by means of applying Hoffmaster s Net
      Bonus earned at Cognex in future years of his employment toward reduction
      of the Loan Amount until Hoffmaster has repaid the entire Loan Amount. The
      term "Net Bonus as used herein shall mean the cash amount awarded in the
      future to Hoffmaster pursuant to Cognex's standard Executive Bonus Plan,
      less all applicable taxes and deductions. Cognex shall automatically
      deduct the loan repayments from Hoffmaster's Net Bonus and shall then pay
      the remaining bonus amount, if any, to Hoffmaster.

3.    If either (a) Hoffmaster terminates his employment with Cognex for any
      reason before he has repaid the entire Loan Amount, or (b) Cognex
      terminates Hoffmaster's employment for Cause (as defined in the
      Termination Agreement attached to the Offer Letter, whether said agreement
      has been executed by both parties or not), then the remaining balance of
      the Loan Amount shall immediately become due and payable in full.

4.    Hoffmaster hereby authorizes Cognex to deduct from Hoffmaster's wages
      and/or from any other amounts that may be due to Hoffmaster, any and all
      amounts that become due and payable pursuant to this Section 3.

5.    If Cognex terminates Hoffmaster's employment with Cognex for any reason
      other than for Cause, then Cognex shall forgive the unpaid balance of the
      Loan Amount and Hoffmaster shall not be responsible for any further
      payments.




                                                                          Page 1
<PAGE>
6.    Hoffmaster hereby waives presentment, demand, notice, protest, dishonor
      and all other demands and notices in connection with the delivery,
      acceptance performance, default or enforcement of the obligations of
      Hoffmaster under this TLA, and the exercise of and enforcement of any
      rights hereunder by Cognex, and assents without notice to any extension or
      postponement of the time of payment, to the addition or release of any
      party or person in any way liable hereunder, and to the compromise or
      settlement of the liability of any such party or person hereunder which
      may from time to time be agreed to by Cognex.

7.    All of the provisions of this TLA shall be binding upon and inure to the
      benefit of Hoffmaster and Cognex and their respective successors, assigns
      and legal representatives. This TLA shall be governed by and construed in
      accordance with the laws of The Commonwealth of Massachusetts without
      regard to any conflict of laws.

8.    Hoffmaster shall pay all costs and expenses, including legal expenses and
      reasonable attorneys' fees incurred by Cognex in connection with the
      enforcement of Hoffmaster's obligations under this TLA. No delay or
      omission on the part of Cognex in exercising any right hereunder shall
      operate as a waiver of such right or of any other right hereunder, and no
      single or partial exercise of any right hereunder shall preclude other or
      future exercise thereof.

9.    Hoffmaster acknowledges that the providing by Cognex to him of the Loan
      Amount and that the waiving by Cognex of any interest on the loan
      constitute additional consideration for Hoffmaster's agreement to abide by
      Section 4.0 of his Employee Invention, Non-Disclosure and Non-Competition
      Agreement, and the post-termination obligations imposed therein.



The above terms and conditions are hereby agreed and accepted as of the date
first written above by:


Employee:                               COGNEX CORPORATION:


/s/ James Hoffmaster                    /s/ Robert J. Shillman
------------------------------------    ----------------------------------------
James Hoffmaster                        Robert J. Shillman, President and C.E.O.


5/24/01                                 5/24/01
------------------------------------    ----------------------------------------
Date                                    Date




                                                                          Page 2