<?xml version="1.0" encoding="UTF-8"?>

<!--XBRL Document Created with Wdesk from Workiva-->
<!--Copyright 2022 Workiva-->
<!--r:4878a129-9b80-4a38-a303-2b34e8ac6131,g:f27b0d4b-0a26-4a3f-9754-6435629f6abe-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:cgnx="http://cognex.com/20211231" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:dtr-types="http://www.xbrl.org/dtr/type/2020-01-21" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://cognex.com/20211231">
  <xs:import namespace="http://fasb.org/srt/2021-01-31" schemaLocation="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd"/>
  <xs:import namespace="http://fasb.org/us-gaap/2021-01-31" schemaLocation="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd"/>
  <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="http://www.xbrl.org/2003/xlink-2003-12-31.xsd"/>
  <xs:import namespace="http://www.xbrl.org/2003/instance" schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd"/>
  <xs:import namespace="http://www.xbrl.org/2003/linkbase" schemaLocation="http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd"/>
  <xs:import namespace="http://www.xbrl.org/dtr/type/2020-01-21" schemaLocation="https://www.xbrl.org/dtr/type/2020-01-21/types.xsd"/>
  <xs:import namespace="http://xbrl.org/2005/xbrldt" schemaLocation="http://www.xbrl.org/2005/xbrldt-2005.xsd"/>
  <xs:import namespace="http://xbrl.sec.gov/country/2021" schemaLocation="https://xbrl.sec.gov/country/2021/country-2021.xsd"/>
  <xs:import namespace="http://xbrl.sec.gov/currency/2021" schemaLocation="https://xbrl.sec.gov/currency/2021/currency-2021.xsd"/>
  <xs:import namespace="http://xbrl.sec.gov/dei/2021q4" schemaLocation="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd"/>
  <xs:annotation>
    <xs:appinfo>
      <link:linkbaseRef xmlns:xlink="http://www.w3.org/1999/xlink" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="cgnx-20211231_lab.xml" xlink:role="http://www.xbrl.org/2003/role/labelLinkbaseRef" xlink:type="simple"/>
      <link:linkbaseRef xmlns:xlink="http://www.w3.org/1999/xlink" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="cgnx-20211231_pre.xml" xlink:role="http://www.xbrl.org/2003/role/presentationLinkbaseRef" xlink:type="simple"/>
      <link:linkbaseRef xmlns:xlink="http://www.w3.org/1999/xlink" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="cgnx-20211231_cal.xml" xlink:role="http://www.xbrl.org/2003/role/calculationLinkbaseRef" xlink:type="simple"/>
      <link:linkbaseRef xmlns:xlink="http://www.w3.org/1999/xlink" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="cgnx-20211231_def.xml" xlink:role="http://www.xbrl.org/2003/role/definitionLinkbaseRef" xlink:type="simple"/>
      <link:roleType id="CoverPage" roleURI="http://cognex.com/role/CoverPage">
        <link:definition>000010001 - Document - Cover Page</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="AuditInformation" roleURI="http://cognex.com/role/AuditInformation">
        <link:definition>000020002 - Document - Audit Information</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CONSOLIDATEDSTATEMENTSOFOPERATIONS" roleURI="http://cognex.com/role/CONSOLIDATEDSTATEMENTSOFOPERATIONS">
        <link:definition>100010003 - Statement - CONSOLIDATED STATEMENTS OF OPERATIONS</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CONSOLIDATEDSTATEMENTSOFCOMPREHENSIVEINCOME" roleURI="http://cognex.com/role/CONSOLIDATEDSTATEMENTSOFCOMPREHENSIVEINCOME">
        <link:definition>100020004 - Statement - CONSOLIDATED STATEMENTS OF COMPREHENSIVE INCOME</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CONSOLIDATEDSTATEMENTSOFCOMPREHENSIVEINCOMEParenthetical" roleURI="http://cognex.com/role/CONSOLIDATEDSTATEMENTSOFCOMPREHENSIVEINCOMEParenthetical">
        <link:definition>100030005 - Statement - CONSOLIDATED STATEMENTS OF COMPREHENSIVE INCOME (Parenthetical)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CONSOLIDATEDBALANCESHEETS" roleURI="http://cognex.com/role/CONSOLIDATEDBALANCESHEETS">
        <link:definition>100040006 - Statement - CONSOLIDATED BALANCE SHEETS</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CONSOLIDATEDBALANCESHEETSParenthetical" roleURI="http://cognex.com/role/CONSOLIDATEDBALANCESHEETSParenthetical">
        <link:definition>100050007 - Statement - CONSOLIDATED BALANCE SHEETS (Parenthetical)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CONSOLIDATEDSTATEMENTSOFCASHFLOWS" roleURI="http://cognex.com/role/CONSOLIDATEDSTATEMENTSOFCASHFLOWS">
        <link:definition>100060008 - Statement - CONSOLIDATED STATEMENTS OF CASH FLOWS</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CONSOLIDATEDSTATEMENTSOFSHAREHOLDERSEQUITY" roleURI="http://cognex.com/role/CONSOLIDATEDSTATEMENTSOFSHAREHOLDERSEQUITY">
        <link:definition>100070009 - Statement - CONSOLIDATED STATEMENTS OF SHAREHOLDERS' EQUITY</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CONSOLIDATEDSTATEMENTSOFSHAREHOLDERSEQUITYParenthetical" roleURI="http://cognex.com/role/CONSOLIDATEDSTATEMENTSOFSHAREHOLDERSEQUITYParenthetical">
        <link:definition>100080010 - Statement - CONSOLIDATED STATEMENTS OF SHAREHOLDERS' EQUITY (Parenthetical)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPolicies" roleURI="http://cognex.com/role/SummaryofSignificantAccountingPolicies">
        <link:definition>210011001 - Disclosure - Summary of Significant Accounting Policies</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPoliciesPolicies" roleURI="http://cognex.com/role/SummaryofSignificantAccountingPoliciesPolicies">
        <link:definition>220022001 - Disclosure - Summary of Significant Accounting Policies (Policies)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPoliciesAdditionalInformationDetail" roleURI="http://cognex.com/role/SummaryofSignificantAccountingPoliciesAdditionalInformationDetail">
        <link:definition>240034001 - Disclosure - Summary of Significant Accounting Policies - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPoliciesIntangibleAssetsDetails" roleURI="http://cognex.com/role/SummaryofSignificantAccountingPoliciesIntangibleAssetsDetails">
        <link:definition>240044002 - Disclosure - Summary of Significant Accounting Policies - Intangible Assets (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPoliciesWarrantyDetails" roleURI="http://cognex.com/role/SummaryofSignificantAccountingPoliciesWarrantyDetails">
        <link:definition>240054003 - Disclosure - Summary of Significant Accounting Policies - Warranty (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPoliciesSummaryofSignificantAccountingPoliciesRevenueRecognitionDetails" roleURI="http://cognex.com/role/SummaryofSignificantAccountingPoliciesSummaryofSignificantAccountingPoliciesRevenueRecognitionDetails">
        <link:definition>240064004 - Disclosure - Summary of Significant Accounting Policies Summary of Significant Accounting Policies - Revenue Recognition (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPoliciesAdvertisingCostsDetails" roleURI="http://cognex.com/role/SummaryofSignificantAccountingPoliciesAdvertisingCostsDetails">
        <link:definition>240074005 - Disclosure - Summary of Significant Accounting Policies - Advertising Costs (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPoliciesComprehensiveIncomeDetails" roleURI="http://cognex.com/role/SummaryofSignificantAccountingPoliciesComprehensiveIncomeDetails">
        <link:definition>240084006 - Disclosure - Summary of Significant Accounting Policies - Comprehensive Income (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="NewPronouncements" roleURI="http://cognex.com/role/NewPronouncements">
        <link:definition>210091002 - Disclosure - New Pronouncements</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="NewPronouncementsPolicies" roleURI="http://cognex.com/role/NewPronouncementsPolicies">
        <link:definition>220102002 - Disclosure - New Pronouncements (Policies)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueMeasurements" roleURI="http://cognex.com/role/FairValueMeasurements">
        <link:definition>210111003 - Disclosure - Fair Value Measurements</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueMeasurementsTables" roleURI="http://cognex.com/role/FairValueMeasurementsTables">
        <link:definition>230123001 - Disclosure - Fair Value Measurements (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueMeasurementsAssetsandLiabilitiesMeasuredatFairValueonaRecurringBasisDetail" roleURI="http://cognex.com/role/FairValueMeasurementsAssetsandLiabilitiesMeasuredatFairValueonaRecurringBasisDetail">
        <link:definition>240134007 - Disclosure - Fair Value Measurements - Assets and Liabilities Measured at Fair Value on a Recurring Basis (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueMeasurementsLiabilitiesMeasuredonRecurringBasisUnobservableInputReconciliationDetails" roleURI="http://cognex.com/role/FairValueMeasurementsLiabilitiesMeasuredonRecurringBasisUnobservableInputReconciliationDetails">
        <link:definition>240144008 - Disclosure - Fair Value Measurements - Liabilities Measured on Recurring Basis, Unobservable Input Reconciliation (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueMeasurementsAdditionalInformationDetails" roleURI="http://cognex.com/role/FairValueMeasurementsAdditionalInformationDetails">
        <link:definition>240154009 - Disclosure - Fair Value Measurements - Additional Information (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestments" roleURI="http://cognex.com/role/CashCashEquivalentsandInvestments">
        <link:definition>210161004 - Disclosure - Cash, Cash Equivalents, and Investments</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestmentsTables" roleURI="http://cognex.com/role/CashCashEquivalentsandInvestmentsTables">
        <link:definition>230173002 - Disclosure - Cash, Cash Equivalents, and Investments (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestmentsComponentsofCashCashEquivalentsandInvestmentsDetail" roleURI="http://cognex.com/role/CashCashEquivalentsandInvestmentsComponentsofCashCashEquivalentsandInvestmentsDetail">
        <link:definition>240184010 - Disclosure - Cash, Cash Equivalents and Investments - Components of Cash, Cash Equivalents and Investments (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestmentsAdditionalInformationDetail" roleURI="http://cognex.com/role/CashCashEquivalentsandInvestmentsAdditionalInformationDetail">
        <link:definition>240194011 - Disclosure - Cash, Cash Equivalents and Investments - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestmentsAmortizedCosttoFairValueDetail" roleURI="http://cognex.com/role/CashCashEquivalentsandInvestmentsAmortizedCosttoFairValueDetail">
        <link:definition>240204012 - Disclosure - Cash, Cash Equivalents and Investments - Amortized Cost to Fair Value (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestmentsGrossUnrealizedLossesandFairValueforAvailableforSaleInvestmentsDetail" roleURI="http://cognex.com/role/CashCashEquivalentsandInvestmentsGrossUnrealizedLossesandFairValueforAvailableforSaleInvestmentsDetail">
        <link:definition>240214013 - Disclosure - Cash, Cash Equivalents and Investments - Gross Unrealized Losses and Fair Value for Available-for-Sale Investments (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestmentsAllowanceforCreditLossDetails" roleURI="http://cognex.com/role/CashCashEquivalentsandInvestmentsAllowanceforCreditLossDetails">
        <link:definition>240224014 - Disclosure - Cash, Cash Equivalents, and Investments - Allowance for Credit Loss (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CashCashEquivalentsandInvestmentsEffectiveMaturityDatesofAvailableforSaleInvestmentsDetail" roleURI="http://cognex.com/role/CashCashEquivalentsandInvestmentsEffectiveMaturityDatesofAvailableforSaleInvestmentsDetail">
        <link:definition>240234015 - Disclosure - Cash, Cash Equivalents and Investments - Effective Maturity Dates of Available-for-Sale Investments (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="Inventories" roleURI="http://cognex.com/role/Inventories">
        <link:definition>210241005 - Disclosure - Inventories</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="InventoriesTables" roleURI="http://cognex.com/role/InventoriesTables">
        <link:definition>230253003 - Disclosure - Inventories (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="InventoriesInventoriesDetail" roleURI="http://cognex.com/role/InventoriesInventoriesDetail">
        <link:definition>240264016 - Disclosure - Inventories - Inventories (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="PropertyPlantandEquipment" roleURI="http://cognex.com/role/PropertyPlantandEquipment">
        <link:definition>210271006 - Disclosure - Property, Plant, and Equipment</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="PropertyPlantandEquipmentTables" roleURI="http://cognex.com/role/PropertyPlantandEquipmentTables">
        <link:definition>230283004 - Disclosure - Property, Plant, and Equipment (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="PropertyPlantandEquipmentPropertyPlantandEquipmentDetail" roleURI="http://cognex.com/role/PropertyPlantandEquipmentPropertyPlantandEquipmentDetail">
        <link:definition>240294017 - Disclosure - Property, Plant, and Equipment - Property, Plant, and Equipment (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="PropertyPlantandEquipmentAdditionalInformationDetails" roleURI="http://cognex.com/role/PropertyPlantandEquipmentAdditionalInformationDetails">
        <link:definition>240304018 - Disclosure - Property, Plant and Equipment - Additional Information (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LeasesLeases" roleURI="http://cognex.com/role/LeasesLeases">
        <link:definition>210311007 - Disclosure - Leases Leases</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LeasesTables" roleURI="http://cognex.com/role/LeasesTables">
        <link:definition>230323005 - Disclosure - Leases (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LeasesDetails" roleURI="http://cognex.com/role/LeasesDetails">
        <link:definition>240334019 - Disclosure - Leases (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LeasesScheduleofPaymentsDetails" roleURI="http://cognex.com/role/LeasesScheduleofPaymentsDetails">
        <link:definition>240344020 - Disclosure - Leases - Schedule of Payments (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="Goodwill" roleURI="http://cognex.com/role/Goodwill">
        <link:definition>210351008 - Disclosure - Goodwill</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="GoodwillTables" roleURI="http://cognex.com/role/GoodwillTables">
        <link:definition>230363006 - Disclosure - Goodwill (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="GoodwillChangesintheCarryingValueofGoodwillDetail" roleURI="http://cognex.com/role/GoodwillChangesintheCarryingValueofGoodwillDetail">
        <link:definition>240374021 - Disclosure - Goodwill - Changes in the Carrying Value of Goodwill (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="GoodwillAdditionalInformationDetail" roleURI="http://cognex.com/role/GoodwillAdditionalInformationDetail">
        <link:definition>240384022 - Disclosure - Goodwill - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IntangibleAssets" roleURI="http://cognex.com/role/IntangibleAssets">
        <link:definition>210391009 - Disclosure - Intangible Assets</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IntangibleAssetsTables" roleURI="http://cognex.com/role/IntangibleAssetsTables">
        <link:definition>230403007 - Disclosure - Intangible Assets (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IntangibleAssetsAmortizedIntangibleAssetsDetail" roleURI="http://cognex.com/role/IntangibleAssetsAmortizedIntangibleAssetsDetail">
        <link:definition>240414023 - Disclosure - Intangible Assets - Amortized Intangible Assets (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IntangibleAssetsEstimatedAmortizationExpenseSucceedingFiscalYearsDetail" roleURI="http://cognex.com/role/IntangibleAssetsEstimatedAmortizationExpenseSucceedingFiscalYearsDetail">
        <link:definition>240424024 - Disclosure - Intangible Assets - Estimated Amortization Expense Succeeding Fiscal Years (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IntangibleAssetsNarrativeDetails" roleURI="http://cognex.com/role/IntangibleAssetsNarrativeDetails">
        <link:definition>240434025 - Disclosure - Intangible Assets - Narrative (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="AccruedExpenses" roleURI="http://cognex.com/role/AccruedExpenses">
        <link:definition>210441010 - Disclosure - Accrued Expenses</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="AccruedExpensesTables" roleURI="http://cognex.com/role/AccruedExpensesTables">
        <link:definition>230453008 - Disclosure - Accrued Expenses (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="AccruedExpensesConstituentsofAccruedExpensesDetail" roleURI="http://cognex.com/role/AccruedExpensesConstituentsofAccruedExpensesDetail">
        <link:definition>240464026 - Disclosure - Accrued Expenses - Constituents of Accrued Expenses (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="AccruedExpensesChangesinWarrantyObligationsDetail" roleURI="http://cognex.com/role/AccruedExpensesChangesinWarrantyObligationsDetail">
        <link:definition>240474027 - Disclosure - Accrued Expenses - Changes in Warranty Obligations (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CommitmentsandContingencies" roleURI="http://cognex.com/role/CommitmentsandContingencies">
        <link:definition>210481011 - Disclosure - Commitments and Contingencies</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CommitmentsandContingenciesAdditionalInformationDetail" roleURI="http://cognex.com/role/CommitmentsandContingenciesAdditionalInformationDetail">
        <link:definition>240494028 - Disclosure - Commitments and Contingencies - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IndemnificationProvisions" roleURI="http://cognex.com/role/IndemnificationProvisions">
        <link:definition>210501012 - Disclosure - Indemnification Provisions</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="DerivativeInstruments" roleURI="http://cognex.com/role/DerivativeInstruments">
        <link:definition>210511013 - Disclosure - Derivative Instruments</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="DerivativeInstrumentsTables" roleURI="http://cognex.com/role/DerivativeInstrumentsTables">
        <link:definition>230523009 - Disclosure - Derivative Instruments (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="DerivativeInstrumentsAdditionalDetailsDetails" roleURI="http://cognex.com/role/DerivativeInstrumentsAdditionalDetailsDetails">
        <link:definition>240534029 - Disclosure - Derivative Instruments - Additional Details (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="DerivativeInstrumentsOutstandingForwardContractsDetails" roleURI="http://cognex.com/role/DerivativeInstrumentsOutstandingForwardContractsDetails">
        <link:definition>240544030 - Disclosure - Derivative Instruments - Outstanding Forward Contracts (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="DerivativeInstrumentsBalanceSheetLocationDetails" roleURI="http://cognex.com/role/DerivativeInstrumentsBalanceSheetLocationDetails">
        <link:definition>240554031 - Disclosure - Derivative Instruments - Balance Sheet Location (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="DerivativeInstrumentsAssetsandliabilitiespresentedonanetbasisduetotherightofoffsetDetails" roleURI="http://cognex.com/role/DerivativeInstrumentsAssetsandliabilitiespresentedonanetbasisduetotherightofoffsetDetails">
        <link:definition>240564032 - Disclosure - Derivative Instruments - Assets and liabilities presented on a net basis due to the right of offset (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="DerivativeInstrumentsGainLossRecognizedinOtherComprehensiveIncomeLossDetails" roleURI="http://cognex.com/role/DerivativeInstrumentsGainLossRecognizedinOtherComprehensiveIncomeLossDetails">
        <link:definition>240574033 - Disclosure - Derivative Instruments - Gain (Loss) Recognized in Other Comprehensive Income (Loss) (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RevenueRecognition" roleURI="http://cognex.com/role/RevenueRecognition">
        <link:definition>210581014 - Disclosure - Revenue Recognition</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RevenueRecognitionTables" roleURI="http://cognex.com/role/RevenueRecognitionTables">
        <link:definition>230593010 - Disclosure - Revenue Recognition (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RevenueRecognitionNarrativesDetails" roleURI="http://cognex.com/role/RevenueRecognitionNarrativesDetails">
        <link:definition>240604034 - Disclosure - Revenue Recognition - Narratives (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RevenueRecognitionDisaggregationbyGeographyandTypeDetails" roleURI="http://cognex.com/role/RevenueRecognitionDisaggregationbyGeographyandTypeDetails">
        <link:definition>240614035 - Disclosure - Revenue Recognition - Disaggregation by Geography and Type (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RevenueRecognitionAllowanceforCreditLossDetails" roleURI="http://cognex.com/role/RevenueRecognitionAllowanceforCreditLossDetails">
        <link:definition>240624036 - Disclosure - Revenue Recognition - Allowance for Credit Loss (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RevenueRecognitionDeferredRevenueandCustomerDepositsRollforwardDetails" roleURI="http://cognex.com/role/RevenueRecognitionDeferredRevenueandCustomerDepositsRollforwardDetails">
        <link:definition>240634037 - Disclosure - Revenue Recognition - Deferred Revenue and Customer Deposits Rollforward (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="ShareholdersEquity" roleURI="http://cognex.com/role/ShareholdersEquity">
        <link:definition>210641015 - Disclosure - Shareholders' Equity</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="ShareholdersEquityAdditionalInformationDetail" roleURI="http://cognex.com/role/ShareholdersEquityAdditionalInformationDetail">
        <link:definition>240654038 - Disclosure - Shareholders' Equity - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensation" roleURI="http://cognex.com/role/StockBasedCompensation">
        <link:definition>210661016 - Disclosure - Stock-Based Compensation</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationTables" roleURI="http://cognex.com/role/StockBasedCompensationTables">
        <link:definition>230673011 - Disclosure - Stock-Based Compensation (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationExpenseAdditionalInformationDetail" roleURI="http://cognex.com/role/StockBasedCompensationExpenseAdditionalInformationDetail">
        <link:definition>240684039 - Disclosure - Stock-Based Compensation Expense - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationExpenseSummaryofStockOptionActivityDetail" roleURI="http://cognex.com/role/StockBasedCompensationExpenseSummaryofStockOptionActivityDetail">
        <link:definition>240694040 - Disclosure - Stock-Based Compensation Expense - Summary of Stock Option Activity (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationExpenseWeightedAverageAssumptionsUsedinEstimatingFairValuesofStockOptionsGrantedDetail" roleURI="http://cognex.com/role/StockBasedCompensationExpenseWeightedAverageAssumptionsUsedinEstimatingFairValuesofStockOptionsGrantedDetail">
        <link:definition>240704041 - Disclosure - Stock-Based Compensation Expense - Weighted-Average Assumptions Used in Estimating Fair Values of Stock Options Granted (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationExpenseSummaryofRestrictedStockOptionActivityDetail" roleURI="http://cognex.com/role/StockBasedCompensationExpenseSummaryofRestrictedStockOptionActivityDetail">
        <link:definition>240714042 - Disclosure - Stock-Based Compensation Expense - Summary of Restricted Stock Option Activity (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationExpenseStockBasedCompensationExpenseDetail" roleURI="http://cognex.com/role/StockBasedCompensationExpenseStockBasedCompensationExpenseDetail">
        <link:definition>240724043 - Disclosure - Stock-Based Compensation Expense - Stock-Based Compensation Expense (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="EmployeeSavingsPlan" roleURI="http://cognex.com/role/EmployeeSavingsPlan">
        <link:definition>210731017 - Disclosure - Employee Savings Plan</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="EmployeeSavingsPlanAdditionalInformationDetail" roleURI="http://cognex.com/role/EmployeeSavingsPlanAdditionalInformationDetail">
        <link:definition>240744044 - Disclosure - Employee Savings Plan - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IncomeTaxes" roleURI="http://cognex.com/role/IncomeTaxes">
        <link:definition>210751018 - Disclosure - Income Taxes</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IncomeTaxesTables" roleURI="http://cognex.com/role/IncomeTaxesTables">
        <link:definition>230763012 - Disclosure - Income Taxes (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IncomeTaxesAdditionalInformationDetails" roleURI="http://cognex.com/role/IncomeTaxesAdditionalInformationDetails">
        <link:definition>240774045 - Disclosure - Income Taxes - Additional Information (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IncomeTaxesConstituentsofProvisionforIncomeTaxesDetails" roleURI="http://cognex.com/role/IncomeTaxesConstituentsofProvisionforIncomeTaxesDetails">
        <link:definition>240784046 - Disclosure - Income Taxes - Constituents of Provision for Income Taxes (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IncomeTaxesReconciliationoftheUnitedStatesFederalStatutoryCorporateTaxRatetoCompanysEffectiveTaxRateorIncomeTaxProvisionDetails" roleURI="http://cognex.com/role/IncomeTaxesReconciliationoftheUnitedStatesFederalStatutoryCorporateTaxRatetoCompanysEffectiveTaxRateorIncomeTaxProvisionDetails">
        <link:definition>240794047 - Disclosure - Income Taxes - Reconciliation of the United States Federal Statutory Corporate Tax Rate to Company's Effective Tax Rate or Income Tax Provision (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IncomeTaxesScheduleofChangeinAccountingPolicyDetails" roleURI="http://cognex.com/role/IncomeTaxesScheduleofChangeinAccountingPolicyDetails">
        <link:definition>240804048 - Disclosure - Income Taxes - Schedule of Change in Accounting Policy (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IncomeTaxesChangesintheReserveforIncomeTaxesExcludingInterestandPenaltiesDetails" roleURI="http://cognex.com/role/IncomeTaxesChangesintheReserveforIncomeTaxesExcludingInterestandPenaltiesDetails">
        <link:definition>240814049 - Disclosure - Income Taxes - Changes in the Reserve for Income Taxes, Excluding Interest and Penalties (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IncomeTaxesConstituentsofDeferredTaxAssetsDetails" roleURI="http://cognex.com/role/IncomeTaxesConstituentsofDeferredTaxAssetsDetails">
        <link:definition>240824050 - Disclosure - Income Taxes - Constituents of Deferred Tax Assets (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="WeightedAverageShares" roleURI="http://cognex.com/role/WeightedAverageShares">
        <link:definition>210831019 - Disclosure - Weighted Average Shares</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="WeightedAverageSharesTables" roleURI="http://cognex.com/role/WeightedAverageSharesTables">
        <link:definition>230843013 - Disclosure - Weighted Average Shares (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="WeightedAverageSharesCalculationofWeightedAverageSharesDetail" roleURI="http://cognex.com/role/WeightedAverageSharesCalculationofWeightedAverageSharesDetail">
        <link:definition>240854051 - Disclosure - Weighted Average Shares - Calculation of Weighted Average Shares (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="WeightedAverageSharesAdditionalInformationDetail" roleURI="http://cognex.com/role/WeightedAverageSharesAdditionalInformationDetail">
        <link:definition>240864052 - Disclosure - Weighted Average Shares - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SegmentandGeographicInformation" roleURI="http://cognex.com/role/SegmentandGeographicInformation">
        <link:definition>210871020 - Disclosure - Segment and Geographic Information</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SegmentandGeographicInformationTables" roleURI="http://cognex.com/role/SegmentandGeographicInformationTables">
        <link:definition>230883014 - Disclosure - Segment and Geographic Information (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SegmentandGeographicInformationAdditionalInformationDetail" roleURI="http://cognex.com/role/SegmentandGeographicInformationAdditionalInformationDetail">
        <link:definition>240894053 - Disclosure - Segment and Geographic Information - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SegmentandGeographicInformationScheduleofRevenuefromExternalCustomersandLongLivedAssetsbyGeographicalAreasDetail" roleURI="http://cognex.com/role/SegmentandGeographicInformationScheduleofRevenuefromExternalCustomersandLongLivedAssetsbyGeographicalAreasDetail">
        <link:definition>240904054 - Disclosure - Segment and Geographic Information - Schedule of Revenue from External Customers and Long-Lived Assets, by Geographical Areas (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="BusinessAcquisitions" roleURI="http://cognex.com/role/BusinessAcquisitions">
        <link:definition>210911021 - Disclosure - Business Acquisitions</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="BusinessAcquisitionsSualabCoLtdNarrativeDetails" roleURI="http://cognex.com/role/BusinessAcquisitionsSualabCoLtdNarrativeDetails">
        <link:definition>240924055 - Disclosure - Business Acquisitions - Sualab Co., Ltd. Narrative (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RestructuringCharges" roleURI="http://cognex.com/role/RestructuringCharges">
        <link:definition>210931022 - Disclosure - Restructuring Charges</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RestructuringChargesTables" roleURI="http://cognex.com/role/RestructuringChargesTables">
        <link:definition>230943015 - Disclosure - Restructuring Charges (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RestructuringChargesAdditionalInformationDetails" roleURI="http://cognex.com/role/RestructuringChargesAdditionalInformationDetails">
        <link:definition>240954056 - Disclosure - Restructuring Charges - Additional Information (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RestructuringChargesScheduleofRestructuringandRelatedCostsDetails" roleURI="http://cognex.com/role/RestructuringChargesScheduleofRestructuringandRelatedCostsDetails">
        <link:definition>240964057 - Disclosure - Restructuring Charges - Schedule of Restructuring and Related Costs (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="RestructuringChargesScheduleofRestructuringReservebyTypeofCostDetails" roleURI="http://cognex.com/role/RestructuringChargesScheduleofRestructuringReservebyTypeofCostDetails">
        <link:definition>240974058 - Disclosure - Restructuring Charges - Schedule of Restructuring Reserve by Type of Cost (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SubsequentEvents" roleURI="http://cognex.com/role/SubsequentEvents">
        <link:definition>210981023 - Disclosure - Subsequent Events</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SubsequentEventsDetails" roleURI="http://cognex.com/role/SubsequentEventsDetails">
        <link:definition>240994059 - Disclosure - Subsequent Events - (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="ScheduleIIValuationandQualifyingAccounts" roleURI="http://cognex.com/role/ScheduleIIValuationandQualifyingAccounts">
        <link:definition>211001024 - Disclosure - Schedule II - Valuation and Qualifying Accounts</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="ScheduleIIValuationandQualifyingAccountsDetail" roleURI="http://cognex.com/role/ScheduleIIValuationandQualifyingAccountsDetail">
        <link:definition>241014060 - Disclosure - Schedule II -Valuation and Qualifying Accounts (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
    </xs:appinfo>
  </xs:annotation>
  <xs:element id="cgnx_NoncurrentDeferredTaxAssetsDeprecation" abstract="false" name="NoncurrentDeferredTaxAssetsDeprecation" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_MinimumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" abstract="false" name="MinimumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" nillable="true" xbrli:periodType="duration" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_CompanyContributionsVestAtEndOfFourYears" abstract="false" name="CompanyContributionsVestAtEndOfFourYears" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:percentItemType"/>
  <xs:element id="cgnx_EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent" abstract="false" name="EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:percentItemType"/>
  <xs:element id="cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableAggregateIntrinsicValue" abstract="false" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableAggregateIntrinsicValue" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_IncreaseDecreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates" abstract="false" name="IncreaseDecreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_AvailableforsaleSecuritiesDebtMaturitiesEffectiveTermMaximum" abstract="false" name="AvailableforsaleSecuritiesDebtMaturitiesEffectiveTermMaximum" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:durationItemType"/>
  <xs:element id="cgnx_ProductCostOfRevenueMember" abstract="true" name="ProductCostOfRevenueMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_MinimumAgeToBeEligibleToDefinedContributionPlan" abstract="false" name="MinimumAgeToBeEligibleToDefinedContributionPlan" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:durationItemType"/>
  <xs:element id="cgnx_OperatingLeaseExpenseNoLiabilityOrAssetRecognized" abstract="false" name="OperatingLeaseExpenseNoLiabilityOrAssetRecognized" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_OtherThanTemporaryImpairmentLossesInvestmentsPortionRecognizedInEarningsNetnoncurrent" abstract="false" name="OtherThanTemporaryImpairmentLossesInvestmentsPortionRecognizedInEarningsNetnoncurrent" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_UnrecognizedTaxBenefitsGross" abstract="false" name="UnrecognizedTaxBenefitsGross" nillable="true" xbrli:periodType="instant" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome" abstract="false" name="DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome" nillable="true" xbrli:periodType="instant" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_ContractWithCustomerLiabilityPeriodIncreaseDecrease" abstract="false" name="ContractWithCustomerLiabilityPeriodIncreaseDecrease" nillable="true" xbrli:periodType="duration" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_AccountsReceivableAllowanceForCreditLossForeignExchangeRateAdjustment" abstract="false" name="AccountsReceivableAllowanceForCreditLossForeignExchangeRateAdjustment" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_GViVenturesInc.Member" abstract="true" name="GViVenturesInc.Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue" abstract="false" name="AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_ExpirationPeriodOfStockOptionPlan" abstract="false" name="ExpirationPeriodOfStockOptionPlan" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:durationItemType"/>
  <xs:element id="cgnx_CorporateBondsFairValueDisclosure" abstract="false" name="CorporateBondsFairValueDisclosure" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_CurrencytranslationadjustmentAbstract" abstract="true" name="CurrencytranslationadjustmentAbstract" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:stringItemType"/>
  <xs:element id="cgnx_ApplicationofCustomerSpecificSolutionsMember" abstract="true" name="ApplicationofCustomerSpecificSolutionsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_AssetBackedSecuritiesFairValueDisclosure" abstract="false" name="AssetBackedSecuritiesFairValueDisclosure" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_ExcessAndObsoleteInventoryCharges" abstract="false" name="ExcessAndObsoleteInventoryCharges" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_SovereignBondsFairValueDisclosure" abstract="false" name="SovereignBondsFairValueDisclosure" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_ComputerHardwareAndSoftwareMember" abstract="true" name="ComputerHardwareAndSoftwareMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue" abstract="false" name="AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_DiscreteTaxItemsAxis" abstract="true" name="DiscreteTaxItemsAxis" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrldt:dimensionItem" type="xbrli:stringItemType"/>
  <xs:element id="cgnx_DeferredTaxAssetsOtherNoncurrent" abstract="false" name="DeferredTaxAssetsOtherNoncurrent" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_IndemnificationProvisionsTextBlock" abstract="false" name="IndemnificationProvisionsTextBlock" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:textBlockItemType"/>
  <xs:element id="cgnx_ConcentrationsOfRiskPolicyPolicyTextBlock" abstract="false" name="ConcentrationsOfRiskPolicyPolicyTextBlock" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:textBlockItemType"/>
  <xs:element id="cgnx_ProductWarrantyPeriod" abstract="false" name="ProductWarrantyPeriod" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:durationItemType"/>
  <xs:element id="cgnx_CustomerContractsAndRelationshipsMember" abstract="true" name="CustomerContractsAndRelationshipsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_SellingGeneralAndAdministrativeMember" abstract="true" name="SellingGeneralAndAdministrativeMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_CashCashEquivalentsShortTermAndLongTermInvestments" abstract="false" name="CashCashEquivalentsShortTermAndLongTermInvestments" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_VoteEntitledForEachCommonShareOutstanding" abstract="false" name="VoteEntitledForEachCommonShareOutstanding" nillable="true" xbrli:periodType="instant" substitutionGroup="xbrli:item" type="xbrli:integerItemType"/>
  <xs:element id="cgnx_SouthboroughMassachusettsMember" abstract="true" name="SouthboroughMassachusettsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_NatureOfOperationsPolicyTextBlock" abstract="false" name="NatureOfOperationsPolicyTextBlock" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:textBlockItemType"/>
  <xs:element id="cgnx_CompanyContributionsVestAtEndOfTwoYear" abstract="false" name="CompanyContributionsVestAtEndOfTwoYear" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:percentItemType"/>
  <xs:element id="cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue" abstract="false" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_MoneyMarketInstrumentsFairValueDisclosure" abstract="false" name="MoneyMarketInstrumentsFairValueDisclosure" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_CompanyContributionsVestAtEndOfOneYear" abstract="false" name="CompanyContributionsVestAtEndOfOneYear" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:percentItemType"/>
  <xs:element id="cgnx_OtherAsiaMember" abstract="true" name="OtherAsiaMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisedIntrinsicValue" abstract="false" name="SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisedIntrinsicValue" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_DeferredTaxAssetsForeignTaxStructureChange" abstract="false" name="DeferredTaxAssetsForeignTaxStructureChange" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_AgencyBondsFairValueDisclosure" abstract="false" name="AgencyBondsFairValueDisclosure" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue" abstract="false" name="AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_CompletedTechnologiesAndOtherIntangibleAssetsMember" abstract="true" name="CompletedTechnologiesAndOtherIntangibleAssetsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_GreaterChinaMember" abstract="true" name="GreaterChinaMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_ContractWithCustomerLiabilityCurrentAndPriorPeriodRevenueRecognized" abstract="false" name="ContractWithCustomerLiabilityCurrentAndPriorPeriodRevenueRecognized" nillable="true" xbrli:periodType="duration" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty" abstract="false" name="EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:percentItemType"/>
  <xs:element id="cgnx_Customer2Member" abstract="true" name="Customer2Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_ChangeinGlobalIntangibleLowTaxedIncomeMember" abstract="true" name="ChangeinGlobalIntangibleLowTaxedIncomeMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_OtherGeographicAreaMember" abstract="true" name="OtherGeographicAreaMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_CompanyContributionsVestAtEndOfThreeYears" abstract="false" name="CompanyContributionsVestAtEndOfThreeYears" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:percentItemType"/>
  <xs:element id="cgnx_RepurchaseProgramMarch2020Member" abstract="true" name="RepurchaseProgramMarch2020Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_ForeignTaxBenefitGainsTaxedOutsideUSMember" abstract="true" name="ForeignTaxBenefitGainsTaxedOutsideUSMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_CustomerContractsLiabilityCurrentRollForward" abstract="true" name="CustomerContractsLiabilityCurrentRollForward" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:stringItemType"/>
  <xs:element id="cgnx_HardwareAndSoftwareMember" abstract="true" name="HardwareAndSoftwareMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_StockRepurchasedDuringPeriodSharesNotYetSettled" abstract="false" name="StockRepurchasedDuringPeriodSharesNotYetSettled" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:sharesItemType"/>
  <xs:element id="cgnx_SualabCo.Ltd.Member" abstract="true" name="SualabCo.Ltd.Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_ContractLiabilityForeignExchangeRateChanges" abstract="false" name="ContractLiabilityForeignExchangeRateChanges" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_RevenuePaymentTerms" abstract="false" name="RevenuePaymentTerms" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:durationItemType"/>
  <xs:element id="cgnx_DeferredIncomeTaxAssetsLiabilitiesNet" abstract="false" name="DeferredIncomeTaxAssetsLiabilitiesNet" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_Customer1Member" abstract="true" name="Customer1Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_NumberOfGroupsWithinEmployeePopulation" abstract="false" name="NumberOfGroupsWithinEmployeePopulation" nillable="true" xbrli:periodType="instant" substitutionGroup="xbrli:item" type="xbrli:integerItemType"/>
  <xs:element id="cgnx_AgencyBondsMember" abstract="true" name="AgencyBondsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_ForeignTaxExpenseTransferPriceAdjustmentMember" abstract="true" name="ForeignTaxExpenseTransferPriceAdjustmentMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_LongTermInvestmentsMember" abstract="true" name="LongTermInvestmentsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross" abstract="false" name="DeferredTaxAssetsWithJurisdictionalNettingGross" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_DiscreteTaxItemsDomain" abstract="true" name="DiscreteTaxItemsDomain" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_MunicipalBondsFairValueDisclosure" abstract="false" name="MunicipalBondsFairValueDisclosure" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_StandardProductandServicesMember" abstract="true" name="StandardProductandServicesMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_DueFromForeignBanks" abstract="false" name="DueFromForeignBanks" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_EnShapeGmbHAbstract" abstract="true" name="EnShapeGmbHAbstract" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:stringItemType"/>
  <xs:element id="cgnx_DiscreteTaxExpenseForeignTaxFilingAdjustmentsMember" abstract="true" name="DiscreteTaxExpenseForeignTaxFilingAdjustmentsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_Unrecognizedtaxbenefitshownasareductiontononcurrentdeferredtaxassets" abstract="false" name="Unrecognizedtaxbenefitshownasareductiontononcurrentdeferredtaxassets" nillable="true" xbrli:periodType="instant" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_TreasuryBillsFairValueDisclosure" abstract="false" name="TreasuryBillsFairValueDisclosure" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_RetirementAllowance" abstract="false" name="RetirementAllowance" nillable="true" xbrli:periodType="instant" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_MaximumInvestmentOfCompanyInPartnership" abstract="false" name="MaximumInvestmentOfCompanyInPartnership" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:percentItemType"/>
  <xs:element id="cgnx_EffectiveIncomeTaxRateReconciliationMigrationOfAcquiredIntellectualPropertyDollar" abstract="false" name="EffectiveIncomeTaxRateReconciliationMigrationOfAcquiredIntellectualPropertyDollar" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_ComponentsOfCashCashEquivalentsAndInvestmentsTableTableTextBlock" abstract="false" name="ComponentsOfCashCashEquivalentsAndInvestmentsTableTableTextBlock" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:textBlockItemType"/>
  <xs:element id="cgnx_AccruedExpensesMember" abstract="true" name="AccruedExpensesMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_StateResearchAndExperimentationMember" abstract="true" name="StateResearchAndExperimentationMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_DeferredTaxAssetsIntangibleAssetChangeinTaxStructure" abstract="false" name="DeferredTaxAssetsIntangibleAssetChangeinTaxStructure" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_MaximumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" abstract="false" name="MaximumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" nillable="true" xbrli:periodType="duration" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount" abstract="false" name="EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue" abstract="false" name="AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_OperatingLeaseRightOfUseAssetCarryingValueOfImpairedAsset" abstract="false" name="OperatingLeaseRightOfUseAssetCarryingValueOfImpairedAsset" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="cgnx_ChiaroTechnologiesLLCMember" abstract="true" name="ChiaroTechnologiesLLCMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement" abstract="false" name="EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement" nillable="true" xbrli:periodType="instant" substitutionGroup="xbrli:item" type="dtr-types:percentItemType"/>
  <xs:element id="cgnx_RepurchaseProgramOctober2018Member" abstract="true" name="RepurchaseProgramOctober2018Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement" abstract="false" name="EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement" nillable="true" xbrli:periodType="instant" substitutionGroup="xbrli:item" type="dtr-types:percentItemType"/>
</xs:schema>
