<?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-->
<link:linkbase xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd">
  <link:roleRef roleURI="http://cognex.com/role/CONSOLIDATEDSTATEMENTSOFOPERATIONS" xlink:type="simple" xlink:href="cgnx-20211231.xsd#CONSOLIDATEDSTATEMENTSOFOPERATIONS"/>
  <link:calculationLink xlink:role="http://cognex.com/role/CONSOLIDATEDSTATEMENTSOFOPERATIONS" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GrossProfit_55d40a88-fb0d-4b1f-8650-8f52d489541b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GrossProfit"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_1514b511-d69e-4b10-8f23-5d74693b8a32" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_GrossProfit_55d40a88-fb0d-4b1f-8650-8f52d489541b" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_1514b511-d69e-4b10-8f23-5d74693b8a32" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostOfGoodsAndServicesSold_ea7868d5-335b-47a0-81f8-b2b81d7d895d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CostOfGoodsAndServicesSold"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_GrossProfit_55d40a88-fb0d-4b1f-8650-8f52d489541b" xlink:to="loc_us-gaap_CostOfGoodsAndServicesSold_ea7868d5-335b-47a0-81f8-b2b81d7d895d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_bd04339d-546a-4a68-b048-8f9664592084" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GrossProfit_c1e60b8a-234b-485e-a468-333972408ef8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GrossProfit"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingIncomeLoss_bd04339d-546a-4a68-b048-8f9664592084" xlink:to="loc_us-gaap_GrossProfit_c1e60b8a-234b-485e-a468-333972408ef8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResearchAndDevelopmentExpense_54fb4b86-24c7-402b-bd0c-45c8f6728b4c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ResearchAndDevelopmentExpense"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingIncomeLoss_bd04339d-546a-4a68-b048-8f9664592084" xlink:to="loc_us-gaap_ResearchAndDevelopmentExpense_54fb4b86-24c7-402b-bd0c-45c8f6728b4c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SellingGeneralAndAdministrativeExpense_087a2e1a-1d0e-4217-af2c-79110231850b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SellingGeneralAndAdministrativeExpense"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingIncomeLoss_bd04339d-546a-4a68-b048-8f9664592084" xlink:to="loc_us-gaap_SellingGeneralAndAdministrativeExpense_087a2e1a-1d0e-4217-af2c-79110231850b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCharges_0d07b032-77fc-4e33-a224-2ffa819ee714" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringCharges"/>
    <link:calculationArc order="4" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingIncomeLoss_bd04339d-546a-4a68-b048-8f9664592084" xlink:to="loc_us-gaap_RestructuringCharges_0d07b032-77fc-4e33-a224-2ffa819ee714" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ImpairmentOfIntangibleAssetsExcludingGoodwill_b20dcaad-39a4-4085-94fb-7e653fda41d0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ImpairmentOfIntangibleAssetsExcludingGoodwill"/>
    <link:calculationArc order="5" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingIncomeLoss_bd04339d-546a-4a68-b048-8f9664592084" xlink:to="loc_us-gaap_ImpairmentOfIntangibleAssetsExcludingGoodwill_b20dcaad-39a4-4085-94fb-7e653fda41d0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_57eb1e31-43f8-4a84-8764-13396c9fef42" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetIncomeLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_1d916c9b-08c6-4b39-9d23-9282a7863a91" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLoss_57eb1e31-43f8-4a84-8764-13396c9fef42" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_1d916c9b-08c6-4b39-9d23-9282a7863a91" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_3acd7a0f-271a-45af-a2e1-4c4fffe8e1f5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLoss_57eb1e31-43f8-4a84-8764-13396c9fef42" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_3acd7a0f-271a-45af-a2e1-4c4fffe8e1f5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_f695afe0-546e-433e-ae37-1be1d63e2513" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_f5e96878-5342-453a-8419-9514308612f9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_f695afe0-546e-433e-ae37-1be1d63e2513" xlink:to="loc_us-gaap_OperatingIncomeLoss_f5e96878-5342-453a-8419-9514308612f9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignCurrencyTransactionGainLossBeforeTax_f1a9cdb3-feb1-4360-b88c-ec06d23957ef" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ForeignCurrencyTransactionGainLossBeforeTax"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_f695afe0-546e-433e-ae37-1be1d63e2513" xlink:to="loc_us-gaap_ForeignCurrencyTransactionGainLossBeforeTax_f1a9cdb3-feb1-4360-b88c-ec06d23957ef" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeNonoperating_df65f41c-4e57-4997-a86a-e870dcc64102" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InvestmentIncomeNonoperating"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_f695afe0-546e-433e-ae37-1be1d63e2513" xlink:to="loc_us-gaap_InvestmentIncomeNonoperating_df65f41c-4e57-4997-a86a-e870dcc64102" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_b1764913-9bd3-4430-97b3-eda0a82d9494" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_f695afe0-546e-433e-ae37-1be1d63e2513" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_b1764913-9bd3-4430-97b3-eda0a82d9494" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/CONSOLIDATEDSTATEMENTSOFCOMPREHENSIVEINCOME" xlink:type="simple" xlink:href="cgnx-20211231.xsd#CONSOLIDATEDSTATEMENTSOFCOMPREHENSIVEINCOME"/>
  <link:calculationLink xlink:role="http://cognex.com/role/CONSOLIDATEDSTATEMENTSOFCOMPREHENSIVEINCOME" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent_6388c913-9ce7-409e-9e2f-76678e09e670" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax_251da69e-28af-4174-a024-5ab0efa409b0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent_6388c913-9ce7-409e-9e2f-76678e09e670" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax_251da69e-28af-4174-a024-5ab0efa409b0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_a4f07237-7789-4fde-afe4-4665c1cbb8a2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_ecf166b5-7927-4c53-b99b-3f0f119de954" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_a4f07237-7789-4fde-afe4-4665c1cbb8a2" xlink:to="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_ecf166b5-7927-4c53-b99b-3f0f119de954" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent_f71f82a3-45f1-46ad-9711-8edda0995bd8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_a4f07237-7789-4fde-afe4-4665c1cbb8a2" xlink:to="loc_us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent_f71f82a3-45f1-46ad-9711-8edda0995bd8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_68110f26-2410-4a8e-8278-d3816bb858b2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_45d11508-cc41-4560-9858-d8cb301f5dca" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_68110f26-2410-4a8e-8278-d3816bb858b2" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_45d11508-cc41-4560-9858-d8cb301f5dca" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_9d236821-7c1f-4b61-a6d9-f694c8e18400" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_68110f26-2410-4a8e-8278-d3816bb858b2" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_9d236821-7c1f-4b61-a6d9-f694c8e18400" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTax_8a6a9eb6-8522-46c5-bef2-f632bce7a5cd" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ComprehensiveIncomeNetOfTax"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_93ee9b65-ff1e-41c5-a048-1125bc00ac4e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetIncomeLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTax_8a6a9eb6-8522-46c5-bef2-f632bce7a5cd" xlink:to="loc_us-gaap_NetIncomeLoss_93ee9b65-ff1e-41c5-a048-1125bc00ac4e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_90625ff7-1120-410d-a0e6-83de527451a1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTax_8a6a9eb6-8522-46c5-bef2-f632bce7a5cd" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_90625ff7-1120-410d-a0e6-83de527451a1" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/CONSOLIDATEDBALANCESHEETS" xlink:type="simple" xlink:href="cgnx-20211231.xsd#CONSOLIDATEDBALANCESHEETS"/>
  <link:calculationLink xlink:role="http://cognex.com/role/CONSOLIDATEDBALANCESHEETS" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_f81f138a-b72d-4d9b-bc13-cd9dc7d77b82" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesAndStockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_b18c5c4b-2378-439f-9ac6-df391007eeba" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Liabilities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_f81f138a-b72d-4d9b-bc13-cd9dc7d77b82" xlink:to="loc_us-gaap_Liabilities_b18c5c4b-2378-439f-9ac6-df391007eeba" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommitmentsAndContingencies_502309b5-4a16-484b-b450-8c27bc0e16b1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommitmentsAndContingencies"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_f81f138a-b72d-4d9b-bc13-cd9dc7d77b82" xlink:to="loc_us-gaap_CommitmentsAndContingencies_502309b5-4a16-484b-b450-8c27bc0e16b1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_331b85fc-0c77-47b7-b8f1-6c493c8b8e8d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockholdersEquity"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_f81f138a-b72d-4d9b-bc13-cd9dc7d77b82" xlink:to="loc_us-gaap_StockholdersEquity_331b85fc-0c77-47b7-b8f1-6c493c8b8e8d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_517eab38-f1a1-4763-abff-1f4a329e5826" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Liabilities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrent_28b15e15-1707-43e0-9f73-f6c3b5f1498f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_517eab38-f1a1-4763-abff-1f4a329e5826" xlink:to="loc_us-gaap_LiabilitiesCurrent_28b15e15-1707-43e0-9f73-f6c3b5f1498f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_d0442754-d70e-44b2-bea0-bac24750cf26" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_517eab38-f1a1-4763-abff-1f4a329e5826" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_d0442754-d70e-44b2-bea0-bac24750cf26" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUncertainTaxPositionsNoncurrent_9c5556cb-a25e-4be6-8603-a54d25b7332b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilityForUncertainTaxPositionsNoncurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_517eab38-f1a1-4763-abff-1f4a329e5826" xlink:to="loc_us-gaap_LiabilityForUncertainTaxPositionsNoncurrent_9c5556cb-a25e-4be6-8603-a54d25b7332b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedIncomeTaxesNoncurrent_094b8c55-9e42-43de-942e-d1af0dd466bb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedIncomeTaxesNoncurrent"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_517eab38-f1a1-4763-abff-1f4a329e5826" xlink:to="loc_us-gaap_AccruedIncomeTaxesNoncurrent_094b8c55-9e42-43de-942e-d1af0dd466bb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilitiesNoncurrent_6cf46ab5-260a-4a95-94e3-9c89b64bf146" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherLiabilitiesNoncurrent"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_517eab38-f1a1-4763-abff-1f4a329e5826" xlink:to="loc_us-gaap_OtherLiabilitiesNoncurrent_6cf46ab5-260a-4a95-94e3-9c89b64bf146" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_4dbb1cc3-113f-413d-aa4b-59adaf160891" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_517eab38-f1a1-4763-abff-1f4a329e5826" xlink:to="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_4dbb1cc3-113f-413d-aa4b-59adaf160891" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_293978bf-2228-4b2c-9b1a-0d104aa2d13d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockValueOutstanding_6488d5e9-06ae-497a-8b83-cf9c768962c8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockValueOutstanding"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_293978bf-2228-4b2c-9b1a-0d104aa2d13d" xlink:to="loc_us-gaap_CommonStockValueOutstanding_6488d5e9-06ae-497a-8b83-cf9c768962c8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapitalCommonStock_1cad0013-5220-43e5-bc14-4a2aee4e901c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AdditionalPaidInCapitalCommonStock"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_293978bf-2228-4b2c-9b1a-0d104aa2d13d" xlink:to="loc_us-gaap_AdditionalPaidInCapitalCommonStock_1cad0013-5220-43e5-bc14-4a2aee4e901c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_f4d60e0d-3465-49d2-917b-83dfa3d375a3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetainedEarningsAccumulatedDeficit"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_293978bf-2228-4b2c-9b1a-0d104aa2d13d" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_f4d60e0d-3465-49d2-917b-83dfa3d375a3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_07343397-9451-4b2c-8f95-967878567632" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_293978bf-2228-4b2c-9b1a-0d104aa2d13d" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_07343397-9451-4b2c-8f95-967878567632" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockValueOutstanding_70694285-8700-4a52-a5b2-099be6cb288c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PreferredStockValueOutstanding"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_293978bf-2228-4b2c-9b1a-0d104aa2d13d" xlink:to="loc_us-gaap_PreferredStockValueOutstanding_70694285-8700-4a52-a5b2-099be6cb288c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrent_e05dc721-d181-458d-9b11-74129e722012" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetsCurrent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_5b5b086a-a1ad-4de6-a2e2-6d1df7d6ddd0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_e05dc721-d181-458d-9b11-74129e722012" xlink:to="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_5b5b086a-a1ad-4de6-a2e2-6d1df7d6ddd0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent_db639ded-8e79-4d2f-95c9-01d946c0d5be" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_e05dc721-d181-458d-9b11-74129e722012" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent_db639ded-8e79-4d2f-95c9-01d946c0d5be" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsReceivableNetCurrent_8af1ec8f-f7ba-446d-bdb8-5c3a28600177" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountsReceivableNetCurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_e05dc721-d181-458d-9b11-74129e722012" xlink:to="loc_us-gaap_AccountsReceivableNetCurrent_8af1ec8f-f7ba-446d-bdb8-5c3a28600177" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryNet_d5d7dcee-3b5b-4a37-903b-f42b96df138f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryNet"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_e05dc721-d181-458d-9b11-74129e722012" xlink:to="loc_us-gaap_InventoryNet_d5d7dcee-3b5b-4a37-903b-f42b96df138f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_e8b4a888-e156-4af7-bc5a-e2281f49af38" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_e05dc721-d181-458d-9b11-74129e722012" xlink:to="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_e8b4a888-e156-4af7-bc5a-e2281f49af38" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnbilledReceivablesCurrent_d5a9318d-5c01-49fd-9829-32b4ca3d8180" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UnbilledReceivablesCurrent"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_e05dc721-d181-458d-9b11-74129e722012" xlink:to="loc_us-gaap_UnbilledReceivablesCurrent_d5a9318d-5c01-49fd-9829-32b4ca3d8180" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrent_a1554b01-baf6-4f35-836e-9e55988fae33" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesCurrent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableCurrent_8f6939c8-4a84-4221-8333-af5b161d9092" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountsPayableCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_a1554b01-baf6-4f35-836e-9e55988fae33" xlink:to="loc_us-gaap_AccountsPayableCurrent_8f6939c8-4a84-4221-8333-af5b161d9092" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrent_1e40b138-c0ca-431e-ad23-a8cabd5dc745" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedLiabilitiesCurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_a1554b01-baf6-4f35-836e-9e55988fae33" xlink:to="loc_us-gaap_AccruedLiabilitiesCurrent_1e40b138-c0ca-431e-ad23-a8cabd5dc745" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedIncomeTaxesCurrent_291a5045-6bc9-4778-8fc6-1cba9a038ca4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedIncomeTaxesCurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_a1554b01-baf6-4f35-836e-9e55988fae33" xlink:to="loc_us-gaap_AccruedIncomeTaxesCurrent_291a5045-6bc9-4778-8fc6-1cba9a038ca4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ContractWithCustomerLiabilityCurrent_c0324511-67ef-4831-8e81-eb331d592237" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ContractWithCustomerLiabilityCurrent"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_a1554b01-baf6-4f35-836e-9e55988fae33" xlink:to="loc_us-gaap_ContractWithCustomerLiabilityCurrent_c0324511-67ef-4831-8e81-eb331d592237" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityCurrent_cfd70ea9-aa27-4a74-acc2-fca311602a54" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseLiabilityCurrent"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_a1554b01-baf6-4f35-836e-9e55988fae33" xlink:to="loc_us-gaap_OperatingLeaseLiabilityCurrent_cfd70ea9-aa27-4a74-acc2-fca311602a54" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets_c2e2d38c-7a87-42e3-91d7-388e0a4e1c0d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Assets"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrent_e45c5b47-9820-4ea4-92e8-591a25ea74b8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetsCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c2e2d38c-7a87-42e3-91d7-388e0a4e1c0d" xlink:to="loc_us-gaap_AssetsCurrent_e45c5b47-9820-4ea4-92e8-591a25ea74b8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermInvestments_5931f10d-afda-4edf-b42e-5927490d1b8a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongTermInvestments"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c2e2d38c-7a87-42e3-91d7-388e0a4e1c0d" xlink:to="loc_us-gaap_LongTermInvestments_5931f10d-afda-4edf-b42e-5927490d1b8a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_29d49021-e2fa-4b0c-b7ce-e12dac1e4c82" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c2e2d38c-7a87-42e3-91d7-388e0a4e1c0d" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_29d49021-e2fa-4b0c-b7ce-e12dac1e4c82" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxAssetsNet_b4f2dc26-d2ae-4672-82bf-c738fa833ae5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxAssetsNet"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c2e2d38c-7a87-42e3-91d7-388e0a4e1c0d" xlink:to="loc_us-gaap_DeferredIncomeTaxAssetsNet_b4f2dc26-d2ae-4672-82bf-c738fa833ae5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_77f8867f-15be-4f4b-8058-6871d6ac0449" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IntangibleAssetsNetExcludingGoodwill"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c2e2d38c-7a87-42e3-91d7-388e0a4e1c0d" xlink:to="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_77f8867f-15be-4f4b-8058-6871d6ac0449" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_b67385b2-41d4-4abd-92a1-3422fe1fd4ee" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Goodwill"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c2e2d38c-7a87-42e3-91d7-388e0a4e1c0d" xlink:to="loc_us-gaap_Goodwill_b67385b2-41d4-4abd-92a1-3422fe1fd4ee" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssetsNoncurrent_9adaed22-71df-48bb-ad18-59083ae63c76" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherAssetsNoncurrent"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c2e2d38c-7a87-42e3-91d7-388e0a4e1c0d" xlink:to="loc_us-gaap_OtherAssetsNoncurrent_9adaed22-71df-48bb-ad18-59083ae63c76" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset_37053f67-dbdb-4261-b2ea-36ede9d1e081" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseRightOfUseAsset"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c2e2d38c-7a87-42e3-91d7-388e0a4e1c0d" xlink:to="loc_us-gaap_OperatingLeaseRightOfUseAsset_37053f67-dbdb-4261-b2ea-36ede9d1e081" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/CONSOLIDATEDSTATEMENTSOFCASHFLOWS" xlink:type="simple" xlink:href="cgnx-20211231.xsd#CONSOLIDATEDSTATEMENTSOFCASHFLOWS"/>
  <link:calculationLink xlink:role="http://cognex.com/role/CONSOLIDATEDSTATEMENTSOFCASHFLOWS" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_384db8db-20c8-4590-9926-d5a77229fc16" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7ebb9882-e432-4ae4-b4e3-dfe2875aeeb1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_384db8db-20c8-4590-9926-d5a77229fc16" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7ebb9882-e432-4ae4-b4e3-dfe2875aeeb1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_08a049fc-f078-4ce0-a318-19c892fa822b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_384db8db-20c8-4590-9926-d5a77229fc16" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_08a049fc-f078-4ce0-a318-19c892fa822b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_ef85fa22-aa4e-44ed-9760-cbfd0186c532" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_384db8db-20c8-4590-9926-d5a77229fc16" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_ef85fa22-aa4e-44ed-9760-cbfd0186c532" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_35f9d8f4-3b39-4a0c-933e-7345920ff5ba" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_384db8db-20c8-4590-9926-d5a77229fc16" xlink:to="loc_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_35f9d8f4-3b39-4a0c-933e-7345920ff5ba" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_97491b3c-e5ad-4ab6-b037-8de0463c5bfa" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_97491b3c-e5ad-4ab6-b037-8de0463c5bfa" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnSaleOfPropertyPlantEquipment_2d2318e5-7e69-4cde-bf5e-5d3920fd711a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GainLossOnSaleOfPropertyPlantEquipment"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_GainLossOnSaleOfPropertyPlantEquipment_2d2318e5-7e69-4cde-bf5e-5d3920fd711a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_8b5fc775-dd32-4f1f-a0b2-dda09c89e9ae" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetIncomeLoss"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_NetIncomeLoss_8b5fc775-dd32-4f1f-a0b2-dda09c89e9ae" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockOptionPlanExpense_3acb2e71-af2d-49a8-8b64-5f87f49cad78" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockOptionPlanExpense"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_StockOptionPlanExpense_3acb2e71-af2d-49a8-8b64-5f87f49cad78" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Depreciation_d28c3cd0-ec51-4706-9984-3af8e136ca9d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Depreciation"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_Depreciation_d28c3cd0-ec51-4706-9984-3af8e136ca9d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationOfIntangibleAssets_c7fd9d7d-d6b5-422d-bcdc-d601613d3f6f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AmortizationOfIntangibleAssets"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_AmortizationOfIntangibleAssets_c7fd9d7d-d6b5-422d-bcdc-d601613d3f6f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ImpairmentOfIntangibleAssetsExcludingGoodwill_c3d401a1-21c1-41ae-b6ac-2707ba0064b5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ImpairmentOfIntangibleAssetsExcludingGoodwill"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_ImpairmentOfIntangibleAssetsExcludingGoodwill_c3d401a1-21c1-41ae-b6ac-2707ba0064b5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseImpairmentLoss_6a9bc051-c1ee-427c-b982-1a7d1cfc672d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseImpairmentLoss"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_OperatingLeaseImpairmentLoss_6a9bc051-c1ee-427c-b982-1a7d1cfc672d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ExcessAndObsoleteInventoryCharges_fa14fe05-e4d1-4d70-bbac-cdd25f36bf75" xlink:href="cgnx-20211231.xsd#cgnx_ExcessAndObsoleteInventoryCharges"/>
    <link:calculationArc order="9" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_cgnx_ExcessAndObsoleteInventoryCharges_fa14fe05-e4d1-4d70-bbac-cdd25f36bf75" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_3ff064b8-e4e8-4c68-9c3b-6f5e2c6b1374" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments"/>
    <link:calculationArc order="10" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_3ff064b8-e4e8-4c68-9c3b-6f5e2c6b1374" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnSaleOfInvestments_ed527913-385b-47c0-858e-190b694dc164" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GainLossOnSaleOfInvestments"/>
    <link:calculationArc order="11" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_GainLossOnSaleOfInvestments_ed527913-385b-47c0-858e-190b694dc164" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1_0da76c3d-ea21-41e0-b851-f86ed4d1ff1d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1"/>
    <link:calculationArc order="12" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1_0da76c3d-ea21-41e0-b851-f86ed4d1ff1d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInDeferredIncomeTaxes_d931973d-2a29-46f3-8ffc-e4155ea03cc6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInDeferredIncomeTaxes"/>
    <link:calculationArc order="13" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_IncreaseDecreaseInDeferredIncomeTaxes_d931973d-2a29-46f3-8ffc-e4155ea03cc6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsReceivable_d743cc6c-cfac-49f4-8080-6f6e6cfa7628" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInAccountsReceivable"/>
    <link:calculationArc order="14" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsReceivable_d743cc6c-cfac-49f4-8080-6f6e6cfa7628" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInContractWithCustomerAsset_64a91650-13d0-402d-bb8b-d2eb5bbabd53" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInContractWithCustomerAsset"/>
    <link:calculationArc order="15" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_IncreaseDecreaseInContractWithCustomerAsset_64a91650-13d0-402d-bb8b-d2eb5bbabd53" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInInventories_5cbb3e93-c878-4bfc-8000-6c209dce707b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInInventories"/>
    <link:calculationArc order="16" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_IncreaseDecreaseInInventories_5cbb3e93-c878-4bfc-8000-6c209dce707b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsPayable_5c725358-ea68-407e-a00f-808ae879f743" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInAccountsPayable"/>
    <link:calculationArc order="17" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsPayable_5c725358-ea68-407e-a00f-808ae879f743" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedLiabilities_3b295de0-2895-48ee-a506-9c5f0b2039e6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInAccruedLiabilities"/>
    <link:calculationArc order="18" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_IncreaseDecreaseInAccruedLiabilities_3b295de0-2895-48ee-a506-9c5f0b2039e6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable_7633306e-eabb-4fff-b9e6-81c2539cffc8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable"/>
    <link:calculationArc order="19" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable_7633306e-eabb-4fff-b9e6-81c2539cffc8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInContractWithCustomerLiability_8a1f90a6-229b-4bd9-838d-f22a1c9aecea" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInContractWithCustomerLiability"/>
    <link:calculationArc order="20" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_IncreaseDecreaseInContractWithCustomerLiability_8a1f90a6-229b-4bd9-838d-f22a1c9aecea" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInOtherOperatingCapitalNet_33f4bb78-b2e1-45fc-90e3-e866ad5c65eb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInOtherOperatingCapitalNet"/>
    <link:calculationArc order="21" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_69bcac7a-8715-40d0-bca3-3286f735aa25" xlink:to="loc_us-gaap_IncreaseDecreaseInOtherOperatingCapitalNet_33f4bb78-b2e1-45fc-90e3-e866ad5c65eb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_28bf318f-8cba-4a84-9598-a03008cb4d6b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireInvestments_84128a75-82cc-41ed-a271-f10dd5496d46" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsToAcquireInvestments"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_28bf318f-8cba-4a84-9598-a03008cb4d6b" xlink:to="loc_us-gaap_PaymentsToAcquireInvestments_84128a75-82cc-41ed-a271-f10dd5496d46" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments_507d9fd6-f916-4183-9c5f-62f5f9e13453" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_28bf318f-8cba-4a84-9598-a03008cb4d6b" xlink:to="loc_us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments_507d9fd6-f916-4183-9c5f-62f5f9e13453" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_3c2c5bce-0322-4cbd-bebd-c150bb7be03a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsToAcquirePropertyPlantAndEquipment"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_28bf318f-8cba-4a84-9598-a03008cb4d6b" xlink:to="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_3c2c5bce-0322-4cbd-bebd-c150bb7be03a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired_5c6b9950-1114-49cd-9161-378453725ba7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired"/>
    <link:calculationArc order="4" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_28bf318f-8cba-4a84-9598-a03008cb4d6b" xlink:to="loc_us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired_5c6b9950-1114-49cd-9161-378453725ba7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_418a0a01-8254-4f49-a8f6-74cd84576b26" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_568f74e3-47d1-46d5-94e6-abb1164c32f6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_418a0a01-8254-4f49-a8f6-74cd84576b26" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_568f74e3-47d1-46d5-94e6-abb1164c32f6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForRepurchaseOfCommonStock_a557d2b8-abdb-42f5-81f0-7f9d2b9255fe" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsForRepurchaseOfCommonStock"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_418a0a01-8254-4f49-a8f6-74cd84576b26" xlink:to="loc_us-gaap_PaymentsForRepurchaseOfCommonStock_a557d2b8-abdb-42f5-81f0-7f9d2b9255fe" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsOfDividendsCommonStock_aa0988e4-9549-4774-b0b4-bb79beed52d2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsOfDividendsCommonStock"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_418a0a01-8254-4f49-a8f6-74cd84576b26" xlink:to="loc_us-gaap_PaymentsOfDividendsCommonStock_aa0988e4-9549-4774-b0b4-bb79beed52d2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentForContingentConsiderationLiabilityFinancingActivities_eeaf7418-0b52-46c1-a828-995dbb03b5a4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentForContingentConsiderationLiabilityFinancingActivities"/>
    <link:calculationArc order="4" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_418a0a01-8254-4f49-a8f6-74cd84576b26" xlink:to="loc_us-gaap_PaymentForContingentConsiderationLiabilityFinancingActivities_eeaf7418-0b52-46c1-a828-995dbb03b5a4" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/CashCashEquivalentsandInvestmentsComponentsofCashCashEquivalentsandInvestmentsDetail" xlink:type="simple" xlink:href="cgnx-20211231.xsd#CashCashEquivalentsandInvestmentsComponentsofCashCashEquivalentsandInvestmentsDetail"/>
  <link:calculationLink xlink:role="http://cognex.com/role/CashCashEquivalentsandInvestmentsComponentsofCashCashEquivalentsandInvestmentsDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_b8c2a53e-0382-45bd-a273-0590d3342376" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Cash_4284b9e1-7ed7-4a57-9e5e-6729e4110b4a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Cash"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_b8c2a53e-0382-45bd-a273-0590d3342376" xlink:to="loc_us-gaap_Cash_4284b9e1-7ed7-4a57-9e5e-6729e4110b4a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MoneyMarketFundsAtCarryingValue_6b59a141-43e9-4973-b995-f77bbe5bdefe" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_MoneyMarketFundsAtCarryingValue"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_b8c2a53e-0382-45bd-a273-0590d3342376" xlink:to="loc_us-gaap_MoneyMarketFundsAtCarryingValue_6b59a141-43e9-4973-b995-f77bbe5bdefe" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments_7c7ccdc9-5f00-4b33-9522-eb86445b4eb2" xlink:href="cgnx-20211231.xsd#cgnx_CashCashEquivalentsShortTermAndLongTermInvestments"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_b4ba9c17-1a06-4591-8193-923f5e510b5c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments_7c7ccdc9-5f00-4b33-9522-eb86445b4eb2" xlink:to="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_b4ba9c17-1a06-4591-8193-923f5e510b5c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent_5e94ea41-e5fc-4a79-9243-289d7de155a7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments_7c7ccdc9-5f00-4b33-9522-eb86445b4eb2" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent_5e94ea41-e5fc-4a79-9243-289d7de155a7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermInvestments_e15c23fc-a571-4ac0-b4f0-413e664869d2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongTermInvestments"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments_7c7ccdc9-5f00-4b33-9522-eb86445b4eb2" xlink:to="loc_us-gaap_LongTermInvestments_e15c23fc-a571-4ac0-b4f0-413e664869d2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermInvestments_66ce4269-96cf-493b-b9df-dae6b295b8a3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongTermInvestments"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesNoncurrent_bc67725d-b1e4-497d-86d0-4e78bf76442f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecuritiesNoncurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LongTermInvestments_66ce4269-96cf-493b-b9df-dae6b295b8a3" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesNoncurrent_bc67725d-b1e4-497d-86d0-4e78bf76442f" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/CashCashEquivalentsandInvestmentsAmortizedCosttoFairValueDetail" xlink:type="simple" xlink:href="cgnx-20211231.xsd#CashCashEquivalentsandInvestmentsAmortizedCosttoFairValueDetail"/>
  <link:calculationLink xlink:role="http://cognex.com/role/CashCashEquivalentsandInvestmentsAmortizedCosttoFairValueDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_464995c8-c1be-4c92-8681-7ada9402fc7b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_e22ebdc2-7bcc-4081-9a2f-ea671149b713" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_464995c8-c1be-4c92-8681-7ada9402fc7b" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_e22ebdc2-7bcc-4081-9a2f-ea671149b713" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_0858e604-25dc-4620-b4bd-14d9c63a1381" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_464995c8-c1be-4c92-8681-7ada9402fc7b" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_0858e604-25dc-4620-b4bd-14d9c63a1381" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_705e8a0f-d69c-469e-a575-102928bc6837" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_464995c8-c1be-4c92-8681-7ada9402fc7b" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_705e8a0f-d69c-469e-a575-102928bc6837" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/CashCashEquivalentsandInvestmentsGrossUnrealizedLossesandFairValueforAvailableforSaleInvestmentsDetail" xlink:type="simple" xlink:href="cgnx-20211231.xsd#CashCashEquivalentsandInvestmentsGrossUnrealizedLossesandFairValueforAvailableforSaleInvestmentsDetail"/>
  <link:calculationLink xlink:role="http://cognex.com/role/CashCashEquivalentsandInvestmentsGrossUnrealizedLossesandFairValueforAvailableforSaleInvestmentsDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_f9b792a9-fad0-441f-9b2e-76d829b75ea4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_50be013f-e1ed-464b-ad78-67d37bc5e49e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_f9b792a9-fad0-441f-9b2e-76d829b75ea4" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_50be013f-e1ed-464b-ad78-67d37bc5e49e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_152f7f19-da99-44ee-9af0-72e124e0cc2e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_f9b792a9-fad0-441f-9b2e-76d829b75ea4" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_152f7f19-da99-44ee-9af0-72e124e0cc2e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_1df31821-c5ab-4253-a388-c79e02324147" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_327e7254-17d0-4c4d-ac6d-8b0336fa75eb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_1df31821-c5ab-4253-a388-c79e02324147" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_327e7254-17d0-4c4d-ac6d-8b0336fa75eb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_8aa984e8-5e72-47c4-85a4-4daef9bca86f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_1df31821-c5ab-4253-a388-c79e02324147" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_8aa984e8-5e72-47c4-85a4-4daef9bca86f" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/CashCashEquivalentsandInvestmentsEffectiveMaturityDatesofAvailableforSaleInvestmentsDetail" xlink:type="simple" xlink:href="cgnx-20211231.xsd#CashCashEquivalentsandInvestmentsEffectiveMaturityDatesofAvailableforSaleInvestmentsDetail"/>
  <link:calculationLink xlink:role="http://cognex.com/role/CashCashEquivalentsandInvestmentsEffectiveMaturityDatesofAvailableforSaleInvestmentsDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_f43fd93a-7ddf-411a-a6fd-22ec59643cdb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue_4ab556f6-df2b-47dc-a364-188cfa6b4686" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_f43fd93a-7ddf-411a-a6fd-22ec59643cdb" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue_4ab556f6-df2b-47dc-a364-188cfa6b4686" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue_5395eea0-b21b-4949-80cf-bdf6487a924d" xlink:href="cgnx-20211231.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_f43fd93a-7ddf-411a-a6fd-22ec59643cdb" xlink:to="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue_5395eea0-b21b-4949-80cf-bdf6487a924d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue_5c78e303-efbb-486c-9e91-5a87b589587b" xlink:href="cgnx-20211231.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_f43fd93a-7ddf-411a-a6fd-22ec59643cdb" xlink:to="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue_5c78e303-efbb-486c-9e91-5a87b589587b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue_5fc88ad7-7011-43ce-9407-124024bc2c06" xlink:href="cgnx-20211231.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_f43fd93a-7ddf-411a-a6fd-22ec59643cdb" xlink:to="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue_5fc88ad7-7011-43ce-9407-124024bc2c06" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue_5ca2ade8-9c26-4bf8-86b2-f3fb97317933" xlink:href="cgnx-20211231.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_f43fd93a-7ddf-411a-a6fd-22ec59643cdb" xlink:to="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue_5ca2ade8-9c26-4bf8-86b2-f3fb97317933" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/InventoriesInventoriesDetail" xlink:type="simple" xlink:href="cgnx-20211231.xsd#InventoriesInventoriesDetail"/>
  <link:calculationLink xlink:role="http://cognex.com/role/InventoriesInventoriesDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryNet_ad903542-ee9a-4665-9ff0-44846bfe2a83" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryRawMaterialsNetOfReserves_7874e7c6-2e3f-482a-962e-1561f651b2f4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryRawMaterialsNetOfReserves"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_InventoryNet_ad903542-ee9a-4665-9ff0-44846bfe2a83" xlink:to="loc_us-gaap_InventoryRawMaterialsNetOfReserves_7874e7c6-2e3f-482a-962e-1561f651b2f4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryWorkInProcessNetOfReserves_a0217bb9-f17b-4da7-b4a7-3a44c67eb5d4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryWorkInProcessNetOfReserves"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_InventoryNet_ad903542-ee9a-4665-9ff0-44846bfe2a83" xlink:to="loc_us-gaap_InventoryWorkInProcessNetOfReserves_a0217bb9-f17b-4da7-b4a7-3a44c67eb5d4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryFinishedGoodsNetOfReserves_0f518cdb-77ed-4072-aff7-742d590d4097" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryFinishedGoodsNetOfReserves"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_InventoryNet_ad903542-ee9a-4665-9ff0-44846bfe2a83" xlink:to="loc_us-gaap_InventoryFinishedGoodsNetOfReserves_0f518cdb-77ed-4072-aff7-742d590d4097" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/PropertyPlantandEquipmentPropertyPlantandEquipmentDetail" xlink:type="simple" xlink:href="cgnx-20211231.xsd#PropertyPlantandEquipmentPropertyPlantandEquipmentDetail"/>
  <link:calculationLink xlink:role="http://cognex.com/role/PropertyPlantandEquipmentPropertyPlantandEquipmentDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_6d2546bc-b1ea-4f36-b9ce-49444e97aed5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentGross_e137a658-9b7b-44b7-9e36-70852d8620f8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentGross"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentNet_6d2546bc-b1ea-4f36-b9ce-49444e97aed5" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentGross_e137a658-9b7b-44b7-9e36-70852d8620f8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_aa50633a-f3bf-4677-afb8-744af8fc0482" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentNet_6d2546bc-b1ea-4f36-b9ce-49444e97aed5" xlink:to="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_aa50633a-f3bf-4677-afb8-744af8fc0482" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/LeasesScheduleofPaymentsDetails" xlink:type="simple" xlink:href="cgnx-20211231.xsd#LeasesScheduleofPaymentsDetails"/>
  <link:calculationLink xlink:role="http://cognex.com/role/LeasesScheduleofPaymentsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_9eb39d62-9a99-43e4-9601-c51704eb7761" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_66f15b99-f383-4328-98f4-d77cdce449ed" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_9eb39d62-9a99-43e4-9601-c51704eb7761" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_66f15b99-f383-4328-98f4-d77cdce449ed" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_9b7e4667-97d7-48c7-ae1b-6b1164ec6c49" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_9eb39d62-9a99-43e4-9601-c51704eb7761" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_9b7e4667-97d7-48c7-ae1b-6b1164ec6c49" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree_a71ac393-0604-4407-bd16-d8f4c43e6bcf" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_9eb39d62-9a99-43e4-9601-c51704eb7761" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree_a71ac393-0604-4407-bd16-d8f4c43e6bcf" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour_24215e09-465d-4833-a82b-46cbfb39bc7a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_9eb39d62-9a99-43e4-9601-c51704eb7761" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour_24215e09-465d-4833-a82b-46cbfb39bc7a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive_017f4b0c-287a-4139-9294-352f1da477e1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_9eb39d62-9a99-43e4-9601-c51704eb7761" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive_017f4b0c-287a-4139-9294-352f1da477e1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive_178f202d-e385-4e83-aa66-e63c71dc8c9f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_9eb39d62-9a99-43e4-9601-c51704eb7761" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive_178f202d-e385-4e83-aa66-e63c71dc8c9f" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/IntangibleAssetsAmortizedIntangibleAssetsDetail" xlink:type="simple" xlink:href="cgnx-20211231.xsd#IntangibleAssetsAmortizedIntangibleAssetsDetail"/>
  <link:calculationLink xlink:role="http://cognex.com/role/IntangibleAssetsAmortizedIntangibleAssetsDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsNet_a004e1d8-1ada-4de4-b025-9539ef0e61f3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsGross_68c3b591-bda2-4e94-b9dc-79da36a25066" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsGross"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_a004e1d8-1ada-4de4-b025-9539ef0e61f3" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsGross_68c3b591-bda2-4e94-b9dc-79da36a25066" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_91f107fc-b566-4fec-9e90-d3956c72cb82" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_a004e1d8-1ada-4de4-b025-9539ef0e61f3" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_91f107fc-b566-4fec-9e90-d3956c72cb82" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/IntangibleAssetsEstimatedAmortizationExpenseSucceedingFiscalYearsDetail" xlink:type="simple" xlink:href="cgnx-20211231.xsd#IntangibleAssetsEstimatedAmortizationExpenseSucceedingFiscalYearsDetail"/>
  <link:calculationLink xlink:role="http://cognex.com/role/IntangibleAssetsEstimatedAmortizationExpenseSucceedingFiscalYearsDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsNet_2da5bd58-cfe1-49e7-a3bf-3e9464424eff" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths_ef523ee8-bed1-4988-8b98-8322fbc23d73" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_2da5bd58-cfe1-49e7-a3bf-3e9464424eff" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths_ef523ee8-bed1-4988-8b98-8322fbc23d73" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo_6c0e33bb-13fd-4167-a039-3d060b4ced0d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_2da5bd58-cfe1-49e7-a3bf-3e9464424eff" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo_6c0e33bb-13fd-4167-a039-3d060b4ced0d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree_022996b3-bd19-4c42-90bb-35d0010b7a7b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_2da5bd58-cfe1-49e7-a3bf-3e9464424eff" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree_022996b3-bd19-4c42-90bb-35d0010b7a7b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour_86d43253-10c9-43ad-b764-a96bb504bfb5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_2da5bd58-cfe1-49e7-a3bf-3e9464424eff" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour_86d43253-10c9-43ad-b764-a96bb504bfb5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive_e3c0f426-525f-4ede-a207-8a5c3d7d885c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_2da5bd58-cfe1-49e7-a3bf-3e9464424eff" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive_e3c0f426-525f-4ede-a207-8a5c3d7d885c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive_002db9a0-02ea-4f72-880c-c756a026c504" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_2da5bd58-cfe1-49e7-a3bf-3e9464424eff" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive_002db9a0-02ea-4f72-880c-c756a026c504" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/AccruedExpensesConstituentsofAccruedExpensesDetail" xlink:type="simple" xlink:href="cgnx-20211231.xsd#AccruedExpensesConstituentsofAccruedExpensesDetail"/>
  <link:calculationLink xlink:role="http://cognex.com/role/AccruedExpensesConstituentsofAccruedExpensesDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrent_f1a933fb-9333-4004-b712-6a1e459b8997" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedLiabilitiesCurrent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedSalariesCurrent_5d431793-b7cb-480a-9d1a-54f61b6806d4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedSalariesCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AccruedLiabilitiesCurrent_f1a933fb-9333-4004-b712-6a1e459b8997" xlink:to="loc_us-gaap_AccruedSalariesCurrent_5d431793-b7cb-480a-9d1a-54f61b6806d4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_RetirementAllowance_385ed54f-adf5-44f5-ae8e-428551b051c1" xlink:href="cgnx-20211231.xsd#cgnx_RetirementAllowance"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AccruedLiabilitiesCurrent_f1a933fb-9333-4004-b712-6a1e459b8997" xlink:to="loc_cgnx_RetirementAllowance_385ed54f-adf5-44f5-ae8e-428551b051c1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProductWarrantyAccrualClassifiedCurrent_b0e74ab8-a08b-45a6-8a99-d764b66b5ab5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProductWarrantyAccrualClassifiedCurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AccruedLiabilitiesCurrent_f1a933fb-9333-4004-b712-6a1e459b8997" xlink:to="loc_us-gaap_ProductWarrantyAccrualClassifiedCurrent_b0e74ab8-a08b-45a6-8a99-d764b66b5ab5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedVacationCurrent_0aa28045-a47a-418c-b7bc-3349df1f3524" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedVacationCurrent"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AccruedLiabilitiesCurrent_f1a933fb-9333-4004-b712-6a1e459b8997" xlink:to="loc_us-gaap_AccruedVacationCurrent_0aa28045-a47a-418c-b7bc-3349df1f3524" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedBonusesCurrent_deb27eb4-5703-4fbb-b5ca-cd325633d341" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedBonusesCurrent"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AccruedLiabilitiesCurrent_f1a933fb-9333-4004-b712-6a1e459b8997" xlink:to="loc_us-gaap_AccruedBonusesCurrent_deb27eb4-5703-4fbb-b5ca-cd325633d341" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAccruedLiabilitiesCurrent_711d2bd9-eb28-49a0-98d8-17e394ef3040" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherAccruedLiabilitiesCurrent"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AccruedLiabilitiesCurrent_f1a933fb-9333-4004-b712-6a1e459b8997" xlink:to="loc_us-gaap_OtherAccruedLiabilitiesCurrent_711d2bd9-eb28-49a0-98d8-17e394ef3040" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/DerivativeInstrumentsAssetsandliabilitiespresentedonanetbasisduetotherightofoffsetDetails" xlink:type="simple" xlink:href="cgnx-20211231.xsd#DerivativeInstrumentsAssetsandliabilitiespresentedonanetbasisduetotherightofoffsetDetails"/>
  <link:calculationLink xlink:role="http://cognex.com/role/DerivativeInstrumentsAssetsandliabilitiespresentedonanetbasisduetotherightofoffsetDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilities_a0fd9b5a-c926-465d-ad75-70f663390b43" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeLiabilities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeFairValueOfDerivativeLiability_704f6abd-53ee-4c03-8f6c-aa24a004501e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeFairValueOfDerivativeLiability"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DerivativeLiabilities_a0fd9b5a-c926-465d-ad75-70f663390b43" xlink:to="loc_us-gaap_DerivativeFairValueOfDerivativeLiability_704f6abd-53ee-4c03-8f6c-aa24a004501e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilityCollateralRightToReclaimCashOffset_4161f8f2-b47d-4b2b-829b-caeda5e4e84f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeLiabilityCollateralRightToReclaimCashOffset"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DerivativeLiabilities_a0fd9b5a-c926-465d-ad75-70f663390b43" xlink:to="loc_us-gaap_DerivativeLiabilityCollateralRightToReclaimCashOffset_4161f8f2-b47d-4b2b-829b-caeda5e4e84f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssets_99b76d7b-1c1c-4853-99a5-d42c22f4cad3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeAssets"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeFairValueOfDerivativeAsset_7651457c-2f0e-4ee7-b501-7ff4f8ebe6cd" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeFairValueOfDerivativeAsset"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DerivativeAssets_99b76d7b-1c1c-4853-99a5-d42c22f4cad3" xlink:to="loc_us-gaap_DerivativeFairValueOfDerivativeAsset_7651457c-2f0e-4ee7-b501-7ff4f8ebe6cd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssetCollateralObligationToReturnCashOffset_45a4418b-b3d3-4381-99fb-a1bc88d41c5f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeAssetCollateralObligationToReturnCashOffset"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DerivativeAssets_99b76d7b-1c1c-4853-99a5-d42c22f4cad3" xlink:to="loc_us-gaap_DerivativeAssetCollateralObligationToReturnCashOffset_45a4418b-b3d3-4381-99fb-a1bc88d41c5f" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/EmployeeSavingsPlanAdditionalInformationDetail" xlink:type="simple" xlink:href="cgnx-20211231.xsd#EmployeeSavingsPlanAdditionalInformationDetail"/>
  <link:calculationLink xlink:role="http://cognex.com/role/EmployeeSavingsPlanAdditionalInformationDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CompanyContributionsVestAtEndOfFourYears_fc807a6c-d884-4acf-a485-7b79c830ade3" xlink:href="cgnx-20211231.xsd#cgnx_CompanyContributionsVestAtEndOfFourYears"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CompanyContributionsVestAtEndOfOneYear_dde8ea03-eba1-4567-9f67-948282198496" xlink:href="cgnx-20211231.xsd#cgnx_CompanyContributionsVestAtEndOfOneYear"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_CompanyContributionsVestAtEndOfFourYears_fc807a6c-d884-4acf-a485-7b79c830ade3" xlink:to="loc_cgnx_CompanyContributionsVestAtEndOfOneYear_dde8ea03-eba1-4567-9f67-948282198496" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CompanyContributionsVestAtEndOfTwoYear_7c731bec-eb9f-4364-9e9c-0c661c2e0c7f" xlink:href="cgnx-20211231.xsd#cgnx_CompanyContributionsVestAtEndOfTwoYear"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_CompanyContributionsVestAtEndOfFourYears_fc807a6c-d884-4acf-a485-7b79c830ade3" xlink:to="loc_cgnx_CompanyContributionsVestAtEndOfTwoYear_7c731bec-eb9f-4364-9e9c-0c661c2e0c7f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CompanyContributionsVestAtEndOfThreeYears_bfc0f0ee-a755-44e5-8126-c517d3cab43f" xlink:href="cgnx-20211231.xsd#cgnx_CompanyContributionsVestAtEndOfThreeYears"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_CompanyContributionsVestAtEndOfFourYears_fc807a6c-d884-4acf-a485-7b79c830ade3" xlink:to="loc_cgnx_CompanyContributionsVestAtEndOfThreeYears_bfc0f0ee-a755-44e5-8126-c517d3cab43f" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/IncomeTaxesConstituentsofProvisionforIncomeTaxesDetails" xlink:type="simple" xlink:href="cgnx-20211231.xsd#IncomeTaxesConstituentsofProvisionforIncomeTaxesDetails"/>
  <link:calculationLink xlink:role="http://cognex.com/role/IncomeTaxesConstituentsofProvisionforIncomeTaxesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CurrentIncomeTaxExpenseBenefit_d084d76e-24c9-46e8-b2da-e9baccb8b91b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentIncomeTaxExpenseBenefit"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CurrentFederalTaxExpenseBenefit_6f59653c-c8df-44cf-bc1e-d8cae444bdb0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentFederalTaxExpenseBenefit"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CurrentIncomeTaxExpenseBenefit_d084d76e-24c9-46e8-b2da-e9baccb8b91b" xlink:to="loc_us-gaap_CurrentFederalTaxExpenseBenefit_6f59653c-c8df-44cf-bc1e-d8cae444bdb0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CurrentStateAndLocalTaxExpenseBenefit_7b05401f-1738-402c-9a1e-9c4240e4c73b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentStateAndLocalTaxExpenseBenefit"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CurrentIncomeTaxExpenseBenefit_d084d76e-24c9-46e8-b2da-e9baccb8b91b" xlink:to="loc_us-gaap_CurrentStateAndLocalTaxExpenseBenefit_7b05401f-1738-402c-9a1e-9c4240e4c73b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CurrentForeignTaxExpenseBenefit_0195692c-5569-4fc9-9754-0dc1929d4010" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentForeignTaxExpenseBenefit"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CurrentIncomeTaxExpenseBenefit_d084d76e-24c9-46e8-b2da-e9baccb8b91b" xlink:to="loc_us-gaap_CurrentForeignTaxExpenseBenefit_0195692c-5569-4fc9-9754-0dc1929d4010" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxExpenseBenefit_7d3f6b7b-b44e-499b-9bd1-c60f2d31101a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxExpenseBenefit"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredFederalIncomeTaxExpenseBenefit_81137d39-880c-4775-8789-cccaa84d409e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredFederalIncomeTaxExpenseBenefit"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredIncomeTaxExpenseBenefit_7d3f6b7b-b44e-499b-9bd1-c60f2d31101a" xlink:to="loc_us-gaap_DeferredFederalIncomeTaxExpenseBenefit_81137d39-880c-4775-8789-cccaa84d409e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit_9fcb47b4-0aca-4075-843a-f73469ee5ebb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredIncomeTaxExpenseBenefit_7d3f6b7b-b44e-499b-9bd1-c60f2d31101a" xlink:to="loc_us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit_9fcb47b4-0aca-4075-843a-f73469ee5ebb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredForeignIncomeTaxExpenseBenefit_b97cc7d4-1f9b-4698-a7e6-c3fa872626b3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredForeignIncomeTaxExpenseBenefit"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredIncomeTaxExpenseBenefit_7d3f6b7b-b44e-499b-9bd1-c60f2d31101a" xlink:to="loc_us-gaap_DeferredForeignIncomeTaxExpenseBenefit_b97cc7d4-1f9b-4698-a7e6-c3fa872626b3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_4e11ea41-8f3e-4d2f-8c38-a007799d873d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CurrentIncomeTaxExpenseBenefit_43fc80c7-ed93-4ecf-8100-1fe041d90ff3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentIncomeTaxExpenseBenefit"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeTaxExpenseBenefit_4e11ea41-8f3e-4d2f-8c38-a007799d873d" xlink:to="loc_us-gaap_CurrentIncomeTaxExpenseBenefit_43fc80c7-ed93-4ecf-8100-1fe041d90ff3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxExpenseBenefit_bd3d1b5d-dcd9-4a9f-8673-88d5bb1b2f7b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxExpenseBenefit"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeTaxExpenseBenefit_4e11ea41-8f3e-4d2f-8c38-a007799d873d" xlink:to="loc_us-gaap_DeferredIncomeTaxExpenseBenefit_bd3d1b5d-dcd9-4a9f-8673-88d5bb1b2f7b" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/IncomeTaxesReconciliationoftheUnitedStatesFederalStatutoryCorporateTaxRatetoCompanysEffectiveTaxRateorIncomeTaxProvisionDetails" xlink:type="simple" xlink:href="cgnx-20211231.xsd#IncomeTaxesReconciliationoftheUnitedStatesFederalStatutoryCorporateTaxRatetoCompanysEffectiveTaxRateorIncomeTaxProvisionDetails"/>
  <link:calculationLink xlink:role="http://cognex.com/role/IncomeTaxesReconciliationoftheUnitedStatesFederalStatutoryCorporateTaxRatetoCompanysEffectiveTaxRateorIncomeTaxProvisionDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_b0ac5754-f600-4fde-b628-8ec7fb6b330c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateContinuingOperations"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_68eea53a-f9f5-4daf-9530-0b1fda65259e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_b0ac5754-f600-4fde-b628-8ec7fb6b330c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_68eea53a-f9f5-4daf-9530-0b1fda65259e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes_62982980-cfd9-45b4-932d-4510dbbc4e8c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_b0ac5754-f600-4fde-b628-8ec7fb6b330c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes_62982980-cfd9-45b4-932d-4510dbbc4e8c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential_5e107471-73b8-424b-b28e-c50371c7fa7f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_b0ac5754-f600-4fde-b628-8ec7fb6b330c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential_5e107471-73b8-424b-b28e-c50371c7fa7f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxCredits_3ccd583d-2fd6-4b2b-b0ba-d6cf4c3336f9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationTaxCredits"/>
    <link:calculationArc order="4" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_b0ac5754-f600-4fde-b628-8ec7fb6b330c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxCredits_3ccd583d-2fd6-4b2b-b0ba-d6cf4c3336f9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent_01add7df-aa05-4ffa-a27f-c4adf18b3694" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent"/>
    <link:calculationArc order="5" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_b0ac5754-f600-4fde-b628-8ec7fb6b330c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent_01add7df-aa05-4ffa-a27f-c4adf18b3694" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty_b35a2cd3-48f6-432a-a407-55c1fc67c12e" xlink:href="cgnx-20211231.xsd#cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_b0ac5754-f600-4fde-b628-8ec7fb6b330c" xlink:to="loc_cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty_b35a2cd3-48f6-432a-a407-55c1fc67c12e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate_ef1cc1e5-89ae-492b-b69b-06d37304b530" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_b0ac5754-f600-4fde-b628-8ec7fb6b330c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate_ef1cc1e5-89ae-492b-b69b-06d37304b530" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent_9c334e27-73ce-46cc-b6ae-3bf627b0f36f" xlink:href="cgnx-20211231.xsd#cgnx_EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_b0ac5754-f600-4fde-b628-8ec7fb6b330c" xlink:to="loc_cgnx_EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent_9c334e27-73ce-46cc-b6ae-3bf627b0f36f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherReconcilingItemsPercent_db7c5684-87cf-4039-a84c-3e5b0198587b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationOtherReconcilingItemsPercent"/>
    <link:calculationArc order="9" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_b0ac5754-f600-4fde-b628-8ec7fb6b330c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherReconcilingItemsPercent_db7c5684-87cf-4039-a84c-3e5b0198587b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments_b0458e3c-15c4-420f-b0bd-347e60618242" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments"/>
    <link:calculationArc order="10" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_b0ac5754-f600-4fde-b628-8ec7fb6b330c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments_b0458e3c-15c4-420f-b0bd-347e60618242" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlements_ff522dfc-eebd-44a6-9312-88150e3d008e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlements"/>
    <link:calculationArc order="11" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_b0ac5754-f600-4fde-b628-8ec7fb6b330c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlements_ff522dfc-eebd-44a6-9312-88150e3d008e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlementsForeign_6a612bc2-df08-48e5-85d2-2aea591c2abe" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlementsForeign"/>
    <link:calculationArc order="12" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_b0ac5754-f600-4fde-b628-8ec7fb6b330c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlementsForeign_6a612bc2-df08-48e5-85d2-2aea591c2abe" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/IncomeTaxesConstituentsofDeferredTaxAssetsDetails" xlink:type="simple" xlink:href="cgnx-20211231.xsd#IncomeTaxesConstituentsofDeferredTaxAssetsDetails"/>
  <link:calculationLink xlink:role="http://cognex.com/role/IncomeTaxesConstituentsofDeferredTaxAssetsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet_0ee2201a-edf9-493c-b666-af9dc5f15909" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsLiabilitiesNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross_af07f9c8-454d-47c9-bcb5-6addadc9f95f" xlink:href="cgnx-20211231.xsd#cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet_0ee2201a-edf9-493c-b666-af9dc5f15909" xlink:to="loc_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross_af07f9c8-454d-47c9-bcb5-6addadc9f95f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsValuationAllowance_2a5332ea-08d0-49a5-a85e-d8b98016c152" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsValuationAllowance"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet_0ee2201a-edf9-493c-b666-af9dc5f15909" xlink:to="loc_us-gaap_DeferredTaxAssetsValuationAllowance_2a5332ea-08d0-49a5-a85e-d8b98016c152" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross_a8ab8a99-9d20-4e84-90e9-d760a1601515" xlink:href="cgnx-20211231.xsd#cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DeferredTaxAssetsIntangibleAssetChangeinTaxStructure_14f8340d-385f-4781-80bd-edf9f786461f" xlink:href="cgnx-20211231.xsd#cgnx_DeferredTaxAssetsIntangibleAssetChangeinTaxStructure"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross_a8ab8a99-9d20-4e84-90e9-d760a1601515" xlink:to="loc_cgnx_DeferredTaxAssetsIntangibleAssetChangeinTaxStructure_14f8340d-385f-4781-80bd-edf9f786461f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_635d97d8-2bc1-4ddb-9af6-011dcdea103a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross_a8ab8a99-9d20-4e84-90e9-d760a1601515" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_635d97d8-2bc1-4ddb-9af6-011dcdea103a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsDomestic_52a3545c-634f-43c6-8c90-d99962ef0d48" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsDomestic"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross_a8ab8a99-9d20-4e84-90e9-d760a1601515" xlink:to="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsDomestic_52a3545c-634f-43c6-8c90-d99962ef0d48" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsForeign_5ed3bd75-5dfd-42b6-9ad7-01a788b6b145" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsForeign"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross_a8ab8a99-9d20-4e84-90e9-d760a1601515" xlink:to="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsForeign_5ed3bd75-5dfd-42b6-9ad7-01a788b6b145" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_NoncurrentDeferredTaxAssetsDeprecation_7a4a948d-ba43-4666-b373-eda36d38c8ab" xlink:href="cgnx-20211231.xsd#cgnx_NoncurrentDeferredTaxAssetsDeprecation"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross_a8ab8a99-9d20-4e84-90e9-d760a1601515" xlink:to="loc_cgnx_NoncurrentDeferredTaxAssetsDeprecation_7a4a948d-ba43-4666-b373-eda36d38c8ab" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsInventory_0dbdc907-dc55-4c1b-8710-7457b5626ae0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsInventory"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross_a8ab8a99-9d20-4e84-90e9-d760a1601515" xlink:to="loc_us-gaap_DeferredTaxAssetsInventory_0dbdc907-dc55-4c1b-8710-7457b5626ae0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsOther_7013b878-01e7-4dc6-ae12-d01b5ecef778" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsOther"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross_a8ab8a99-9d20-4e84-90e9-d760a1601515" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsOther_7013b878-01e7-4dc6-ae12-d01b5ecef778" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DeferredTaxAssetsOtherNoncurrent_f11ac176-ddbd-4016-93fe-845321555f8f" xlink:href="cgnx-20211231.xsd#cgnx_DeferredTaxAssetsOtherNoncurrent"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross_a8ab8a99-9d20-4e84-90e9-d760a1601515" xlink:to="loc_cgnx_DeferredTaxAssetsOtherNoncurrent_f11ac176-ddbd-4016-93fe-845321555f8f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DeferredIncomeTaxAssetsLiabilitiesNet_ad30bd8d-6147-496e-a0ec-1bfb3ef3afab" xlink:href="cgnx-20211231.xsd#cgnx_DeferredIncomeTaxAssetsLiabilitiesNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome_2fb1f877-9646-430c-bd82-0bbd5d31ae4a" xlink:href="cgnx-20211231.xsd#cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_DeferredIncomeTaxAssetsLiabilitiesNet_ad30bd8d-6147-496e-a0ec-1bfb3ef3afab" xlink:to="loc_cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome_2fb1f877-9646-430c-bd82-0bbd5d31ae4a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet_6716a018-db33-45f2-8c87-19c54e535064" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsLiabilitiesNet"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_DeferredIncomeTaxAssetsLiabilitiesNet_ad30bd8d-6147-496e-a0ec-1bfb3ef3afab" xlink:to="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet_6716a018-db33-45f2-8c87-19c54e535064" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://cognex.com/role/WeightedAverageSharesCalculationofWeightedAverageSharesDetail" xlink:type="simple" xlink:href="cgnx-20211231.xsd#WeightedAverageSharesCalculationofWeightedAverageSharesDetail"/>
  <link:calculationLink xlink:role="http://cognex.com/role/WeightedAverageSharesCalculationofWeightedAverageSharesDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_c39eebe7-d030-45be-846e-a7ec637dc378" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_850ec61f-1649-4a49-9617-fb542cb7ecac" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_c39eebe7-d030-45be-846e-a7ec637dc378" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_850ec61f-1649-4a49-9617-fb542cb7ecac" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_6bca5040-fc97-43b7-bbcf-3e71da469489" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_c39eebe7-d030-45be-846e-a7ec637dc378" xlink:to="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_6bca5040-fc97-43b7-bbcf-3e71da469489" xlink:type="arc"/>
  </link:calculationLink>
</link:linkbase>
