<PAGE>   1


                                  EXHIBIT 10.40

                               NINTH AMENDMENT TO
                       REVOLVING CREDIT AND LOAN AGREEMENT


        This NINTH AMENDMENT TO REVOLVING CREDIT AND LOAN AGREEMENT
("Ninth Amendment") is dated as of March 9, 1998, and is among MEDAR, INC., a
Michigan corporation (the "Company"), and INTEGRAL VISION LTD., a corporation
established under the laws of the United Kingdom ("Integral"), as Borrowers, and
NBD BANK, a Michigan banking corporation ("NBD"). This Ninth Amendment amends
the Revolving Credit and Loan Agreement dated as of August 10, 1995 (as amended,
the "Loan Agreement"), as amended by the First Amendment to Revolving Credit and
Loan Agreement dated October 12, 1995 (the "First Amendment"), the Second
Amendment to Revolving Credit and Loan Agreement dated October 31, 1995 (the
"Second Amendment"), the Third Amendment to Revolving Credit and Loan Agreement
dated as of March 29, 1996 ("Third Amendment"), the Fourth Amendment to
Revolving Credit and Loan Agreement dated as of August 11, 1996 ("Fourth
Amendment"), the Fifth Amendment to Revolving Credit and Loan Agreement dated as
of February 27, 1997 ("Fifth Amendment"), the Sixth Amendment to Revolving
Credit and Loan Agreement dated as of March 28, 1997 ("Sixth Amendment"), the
Seventh Amendment to Revolving Credit and Loan Agreement dated as of June 27,
1997 ("Seventh Amendment"), and the Eighth Amendment to Revolving Credit and
Loan Agreement dated as of July 15, 1997 ("Eighth Amendment"), among the
Company, Integral and NBD. The original Loan Agreement and the first four
amendment also had as a party a former subsidiary of the Company, Integral
Vision-AID, Inc., a Michigan corporation ("AID") (successor by merger to
Integral Vision-Aid, Inc., an Ohio corporation, formerly known as Automatic
Inspection Devices, Inc.). AID has since been merged into the Company and no
longer exists as a separate corporation. The Company and Integral are
collectively referred to as the "Borrowers" and individually as a "Borrower".
Capitalized terms not otherwise defined in this Ninth Amendment shall have the
meanings given to them in the Loan Agreement.

        WHEREAS, the Borrowers have requested that certain financial
covenants in the Loan Agreement be amended and NBD has agreed to such changes on
the terms and conditions set forth herein.

        NOW, THEREFORE, for good and valuable consideration, the receipt and
adequacy of which is hereby acknowledged, the parties agree as follows:

         1.    Revised Definitions.  The following definition contained in
Section 1.1 of the Loan Agreement is hereby amended, effective the date hereof,
to read as follows:

         "Borrowing Base" means the sum of the following:

         a.  80% of the book value of Eligible Accounts Receivables of the
Company and Guarantor; plus

         b.  40% of the lower of costs or market value of Eligible
             Inventory of the Company and Guarantor. Notwithstanding the
             foregoing, in no event will the amount advanced against
             Eligible Inventory exceed $5,000,000 for advances on or after
             December 31, 1997.

         2.  Revised Financial Covenant.  Section 6.2(a) of the Loan Agreement
is hereby amended in its entirety to read as follows:

         a.  Tangible Net Worth. Permit or suffer Tangible Net Worth to be
             less than, (i) on June 30, 1997 and September 30, 1997,
             $9,500,000, (ii) on December 31, 1997, $8,900,000 and (iii) as
             of the end of each fiscal quarter of the Borrowers beginning
             March 31, 1998 and thereafter, less than (x) $9,500,000, plus
             (y) as of the date of determination, 50% of Aggregate Net
             Income.

         3.  Conditions. Notwithstanding any other term of this Ninth Amendment
or the Loan Agreement, NBD will not be required to give effect to this Ninth
Amendment unless the following conditions have been met:

         a.  NBD shall have received a fully executed copy of this Ninth
             Amendment.

         b.  NBD shall have received a reaffirmation of the guaranty from
             Medar Canada Ltd., including a consent to the terms of this
             Ninth Amendment.

         c.  NBD shall have received the fee called for under the letter
             from Glen Ansiel of NBD to Richard Current, dated February 24,
             1998.

         d.  NBD shall have received satisfactory evidence that the holders
             of the Subordinated Note and the Agent for such holders shall
             have waived any existing defaults, or amended their agreements
             with the Company, so that there exists no defaults under the
             Subordinated Note and related loan agreements.







                                    Page 41
<PAGE>   2


         e.  All of the terms and conditions in Section 3.7 of the Loan
Agreement continue to be met.

         4. Reaffirmation of Loan Agreement; Conflicts. The parties hereto
acknowledge and agree that the terms and provisions of this Ninth Amendment,
amend, add to and constitute a part of the Loan Agreement. Except as expressly
modified and amended by the terms of this Ninth Amendment, all of the other
terms and conditions of the Loan Agreement and all of the documents executed in
connection therewith or referred to or incorporated therein, remain in full
force and effect and are hereby ratified, confirmed and approved. If there is an
express conflict between the terms of this Ninth Amendment and the terms of the
Loan Agreement, or any of the other agreements or documents executed in
connection therewith or referred to or incorporated therein, the terms of this
Ninth Amendment shall govern and control. Any reference in any other document or
agreement to the Loan Agreement shall hereafter refer to the Loan Agreement as
amended by this Ninth Amendment.

         5. Representations True. The representations and warranties of the
Borrowers contained in the Loan Agreement are true on the date hereof and, after
giving effect hereto, there does not exist any Default or Event of Default under
the Loan Agreement.

         6. Expenses. Borrowers acknowledge and agree that the Borrowers will
pay all attorneys' fees and out-of-pocket costs of NBD in connection with or
with respect to this Ninth Amendment and the conditions set forth herein.

         IN WITNESS WHEREOF, the Borrowers and NBD have executed the foregoing
document by their duly authorized officers as of the day and year first written
above.

                                           NBD BANK


                                           By:  /S/Glenn Ansiel
                                                ----------------------------
                                                Glenn Ansiel
                                                Its:  Vice President



                                           MEDAR, INC.


                                           By:  /S/Charles Drake
                                                ----------------------------
                                                Charles Drake
                                                Its:  President


                                           INTEGRAL VISION LTD.


                                           By:  /S/Richard Current
                                                ----------------------------
                                                Richard Current
                                                Its: Company Secretary









                                    Page 42
<PAGE>   3


                            REAFFIRMATION OF GUARANTY


         The undersigned, Medar Canada Ltd., hereby acknowledges and agrees to
the terms of this Ninth Amendment to Revolving Credit and Loan Agreement and
hereby reaffirms each and every term of its (i) Guarantee and Postponement of
Claim dated August 10, 1995, given in favor of NBD Bank with respect to the
obligations of Medar, Inc., Automatic Inspection Devices, Inc. (also known as
Integral Vision-AID, Inc. and now merged into Medar, Inc.) and Integral Vision
Ltd., and (ii) General Security Agreement dated as of May 1, 1996, given in
favor of NBD Bank.


                                        MEDAR CANADA LTD.


                                        By:  /S/Charles Drake
                                             ---------------------------
                                             Charles Drake
                                             Its:  President











                                    Page 43