{"id":131484,"date":"2025-10-14T13:49:18","date_gmt":"2025-10-14T05:49:18","guid":{"rendered":"https:\/\/www.tm-robot.com\/docs\/%e6%94%af%e6%8f%b4lua%e8%aa%9e%e8%a8%80%e7%b7%a8%e7%a8%8b\/"},"modified":"2025-10-14T13:59:31","modified_gmt":"2025-10-14T05:59:31","slug":"support-lua-script-programming-zh","status":"publish","type":"docs","link":"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/","title":{"rendered":"\u652f\u63f4Lua\u8a9e\u8a00\u7de8\u7a0b"},"content":{"rendered":"<p>\u7bc4\u4f8b\u9069\u7528\u65bc\uff1a<\/p>\n<p>TMflow\u8edf\u9ad4\u7248\u672c\uff1a2.24 \u6216\u4ee5\u4e0a\u3002<\/p>\n<p>TM Robot \u786c\u9ad4\u7248\u672c\uff1aHW 5.0 \u6216\u4ee5\u4e0a<\/p>\n<p>\u8acb\u6ce8\u610f\uff0c\u8f03\u820a\u6216\u8f03\u65b0\u7684\u8edf\u9ad4\u7248\u672c\u53ef\u80fd\u6703\u7522\u751f\u4e0d\u540c\u7684\u7d50\u679c\u3002<\/p>\n<hr \/>\n<p><strong>Lua<\/strong> \u662f\u4e00\u7a2e\u8f15\u91cf\u7d1a\u3001\u9ad8\u6548\u4e14\u8a9e\u6cd5\u7c21\u6f54\u7684\u8173\u672c\u8a9e\u8a00\uff0c\u5176\u6613\u65bc\u5b78\u7fd2\u548c\u4f7f\u7528\u7684\u7279\u6027\u4f7f\u5176\u5728\u696d\u754c\u88ab\u5ee3\u6cdb\u63a1\u7528\u3002TMflow 2.24 \u65b0\u589e\u4e86<strong>HPScript Node<\/strong>\u529f\u80fd\uff0c\u8b93\u4f7f\u7528\u8005\u80fd\u76f4\u63a5\u5728\u7bc0\u9ede\u5167\u4ee5Lua\u8a9e\u8a00\u7de8\u5beb\u6a5f\u5668\u624b\u81c2\u7684\u884c\u52d5\u8173\u672c\u3002<\/p>\n<p><a href=\"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/pictab-1.png\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-131473\" src=\"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/pictab-1.png\" alt=\"\" width=\"1946\" height=\"806\" srcset=\"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/pictab-1.png 1946w, https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/pictab-1-300x124.png 300w, https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/pictab-1-1024x424.png 1024w, https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/pictab-1-768x318.png 768w, https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/pictab-1-360x149.png 360w, https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/pictab-1-1536x636.png 1536w\" sizes=\"(max-width: 1946px) 100vw, 1946px\" \/><\/a><\/p>\n<p>\u9664\u4e86Lua\u539f\u751f\u7684\u6a19\u6e96\u51fd\u5f0f\u5eab\uff08\u5982\uff1astring\u3001math\uff09\u4e4b\u5916\uff0cHPScript Node \u9084\u6574\u5408\u4e86\u5c08\u70ba\u9054\u660e\u6a5f\u5668\u624b\u81c2\u8a2d\u8a08\u7684\u51fd\u5f0f\u5eab\uff0c\u5982\u4e0b\uff1a<\/p>\n<p><a href=\"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/table.png\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-131479\" src=\"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/table.png\" alt=\"\" width=\"688\" height=\"712\" srcset=\"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/table.png 688w, https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/table-290x300.png 290w, https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/table-360x373.png 360w\" sizes=\"(max-width: 688px) 100vw, 688px\" \/><\/a><\/p>\n<ul>\n<li><strong>Servo<\/strong>\uff1a\u63d0\u4f9b\u5404\u7a2e\u624b\u81c2\u904b\u52d5\u76f8\u95dc\u7684\u51fd\u5f0f\u3002<\/li>\n<li><strong>Controller<\/strong>\uff1a\u63d0\u4f9b\u8207\u96fb\u63a7\u7bb1\u76f8\u95dc\u7684\u51fd\u5f0f\uff0c\u5982 I\/O\u63a7\u5236\uff0c\u9ede\u4f4d\u8cc7\u8a0a\uff0c<\/li>\n<li><strong>System<\/strong>\uff1a\u63d0\u4f9b\u7cfb\u7d71\u76f8\u95dc\u51fd\u5f0f\uff0c\u5982\uff1a\u6642\u9593\u9593\u9694\u540c\u6b65\u3001\u689d\u4ef6\u7b49\u5f85\u3001\u65bc\u8a18\u9304\u6a94\u88e1\u5beb\u4e0b\u8a0a\u606f\uff0c\u7b49<\/li>\n<li><strong>Memory<\/strong>\uff1a\u7531\u65bcHPScript Node\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528\u5c08\u6848\u8b8a\u6578\u548c\u5168\u57df\u8b8a\u6578\uff0c\u9700\u900f\u904e\u7279\u6b8a\u8a18\u61b6\u5340\u8207\u5c08\u6848\u9032\u884c\u8cc7\u8a0a\u4e92\u52d5\u3002\u8209\u4f8b\u4f86\u8aaa\uff0cHPScript Node\u53ef\u4ee5\u5728\u57f7\u884c\u904e\u7a0b\u4e2d\u628a\u8cc7\u8a0a\u8a18\u9304\u5230\u7279\u6b8a\u8a18\u61b6\u5340\uff0c\u4f7f\u7528\u8005\u53ef\u4ee5\u5728\u5f8c\u7e8c\u6d41\u7a0b\u88e1\u900f\u904eTMscript\u76f8\u95dc\u51fd\u5f0f\uff08\u5982\uff1aHPScript_GetMemByte\uff09\u53d6\u5f97\u76f8\u95dc\u8cc7\u6599<\/li>\n<li><strong>Com<\/strong><strong>\uff1a<\/strong>\u4f7f\u7528\u8005\u53ef\u4ee5\u5728I\/O\u8a2d\u5b9a\u628aCOM2\u6307\u5b9a\u70baHPScript Node\u5c08\u7528\uff0c\u63a5\u4e0b\u4f86\u5c31\u53ef\u4ee5\u5728\u7bc0\u9ede\u88e1\u900f\u904eCom\u51fd\u5f0f\u4f86\u64cd\u4f5cCOM2\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>\u53e6\u5916\uff0c\u900f\u904eHPScript\u7de8\u5beb\u7684\u8173\u672c\u6703\u4ee5<strong>1\u6beb\u79d2\u7684\u4f4e\u5ef6\u9072<\/strong>\u57f7\u884c\uff0c\u7279\u5225\u9069\u5408\u9700\u8981\u8a0a\u865f\u8207\u904b\u52d5\u5feb\u901f\u53cd\u61c9\u7684\u61c9\u7528\uff0c\u8b93\u6a5f\u5668\u624b\u81c2\u63a7\u5236\u66f4\u52a0\u7cbe\u6e96\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7bc4\u4f8b\u9069\u7528\u65bc\uff1a TMflow\u8edf\u9ad4\u7248\u672c\uff1a2.24 \u6216\u4ee5\u4e0a\u3002 TM Robot \u786c\u9ad4\u7248\u672c\uff1aHW 5.0 \u6216\u4ee5\u4e0a \u8acb\u6ce8 [&hellip;]<\/p>\n","protected":false},"author":8760,"featured_media":0,"parent":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"doc_category":[4198,4701],"doc_tag":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u652f\u63f4Lua\u8a9e\u8a00\u7de8\u7a0b | Techman Robot<\/title>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"zh_TW\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u652f\u63f4Lua\u8a9e\u8a00\u7de8\u7a0b | Techman Robot\" \/>\n<meta property=\"og:description\" content=\"\u7bc4\u4f8b\u9069\u7528\u65bc\uff1a TMflow\u8edf\u9ad4\u7248\u672c\uff1a2.24 \u6216\u4ee5\u4e0a\u3002 TM Robot \u786c\u9ad4\u7248\u672c\uff1aHW 5.0 \u6216\u4ee5\u4e0a \u8acb\u6ce8 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/\" \/>\n<meta property=\"og:site_name\" content=\"Techman Robot\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-14T05:59:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/pictab-1.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.tm-robot.com\/en\/#organization\",\"name\":\"Techman Robot\",\"url\":\"https:\/\/www.tm-robot.com\/en\/\",\"sameAs\":[],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.tm-robot.com\/en\/#logo\",\"inLanguage\":\"zh-TW\",\"url\":\"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2018\/09\/logo.png\",\"contentUrl\":\"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2018\/09\/logo.png\",\"width\":221,\"height\":196,\"caption\":\"Techman Robot\"},\"image\":{\"@id\":\"https:\/\/www.tm-robot.com\/en\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.tm-robot.com\/en\/#website\",\"url\":\"https:\/\/www.tm-robot.com\/en\/\",\"name\":\"Techman Robot\",\"description\":\"Intelligent Cobots for a World of Applications\",\"publisher\":{\"@id\":\"https:\/\/www.tm-robot.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.tm-robot.com\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-TW\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/#primaryimage\",\"inLanguage\":\"zh-TW\",\"url\":\"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/pictab-1.png\",\"contentUrl\":\"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/pictab-1.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/#webpage\",\"url\":\"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/\",\"name\":\"\\u652f\\u63f4Lua\\u8a9e\\u8a00\\u7de8\\u7a0b | Techman Robot\",\"isPartOf\":{\"@id\":\"https:\/\/www.tm-robot.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/#primaryimage\"},\"datePublished\":\"2025-10-14T05:49:18+00:00\",\"dateModified\":\"2025-10-14T05:59:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/#breadcrumb\"},\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.tm-robot.com\/zh-hant\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Docs\",\"item\":\"https:\/\/www.tm-robot.com\/zh-hant\/docs\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\\u652f\\u63f4Lua\\u8a9e\\u8a00\\u7de8\\u7a0b\"}]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u652f\u63f4Lua\u8a9e\u8a00\u7de8\u7a0b | Techman Robot","robots":{"index":"noindex","follow":"follow"},"og_locale":"zh_TW","og_type":"article","og_title":"\u652f\u63f4Lua\u8a9e\u8a00\u7de8\u7a0b | Techman Robot","og_description":"\u7bc4\u4f8b\u9069\u7528\u65bc\uff1a TMflow\u8edf\u9ad4\u7248\u672c\uff1a2.24 \u6216\u4ee5\u4e0a\u3002 TM Robot \u786c\u9ad4\u7248\u672c\uff1aHW 5.0 \u6216\u4ee5\u4e0a \u8acb\u6ce8 [&hellip;]","og_url":"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/","og_site_name":"Techman Robot","article_modified_time":"2025-10-14T05:59:31+00:00","og_image":[{"url":"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/pictab-1.png"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/www.tm-robot.com\/en\/#organization","name":"Techman Robot","url":"https:\/\/www.tm-robot.com\/en\/","sameAs":[],"logo":{"@type":"ImageObject","@id":"https:\/\/www.tm-robot.com\/en\/#logo","inLanguage":"zh-TW","url":"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2018\/09\/logo.png","contentUrl":"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2018\/09\/logo.png","width":221,"height":196,"caption":"Techman Robot"},"image":{"@id":"https:\/\/www.tm-robot.com\/en\/#logo"}},{"@type":"WebSite","@id":"https:\/\/www.tm-robot.com\/en\/#website","url":"https:\/\/www.tm-robot.com\/en\/","name":"Techman Robot","description":"Intelligent Cobots for a World of Applications","publisher":{"@id":"https:\/\/www.tm-robot.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.tm-robot.com\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-TW"},{"@type":"ImageObject","@id":"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/#primaryimage","inLanguage":"zh-TW","url":"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/pictab-1.png","contentUrl":"https:\/\/tm-robot.oss-cn-hongkong.aliyuncs.com\/wp-content\/uploads\/2025\/10\/pictab-1.png"},{"@type":"WebPage","@id":"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/#webpage","url":"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/","name":"\u652f\u63f4Lua\u8a9e\u8a00\u7de8\u7a0b | Techman Robot","isPartOf":{"@id":"https:\/\/www.tm-robot.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/#primaryimage"},"datePublished":"2025-10-14T05:49:18+00:00","dateModified":"2025-10-14T05:59:31+00:00","breadcrumb":{"@id":"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/#breadcrumb"},"inLanguage":"zh-TW","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.tm-robot.com\/zh-hant\/docs\/support-lua-script-programming-zh\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.tm-robot.com\/zh-hant\/"},{"@type":"ListItem","position":2,"name":"Docs","item":"https:\/\/www.tm-robot.com\/zh-hant\/docs\/"},{"@type":"ListItem","position":3,"name":"\u652f\u63f4Lua\u8a9e\u8a00\u7de8\u7a0b"}]}]}},"_links":{"self":[{"href":"https:\/\/www.tm-robot.com\/zh-hant\/wp-json\/wp\/v2\/docs\/131484"}],"collection":[{"href":"https:\/\/www.tm-robot.com\/zh-hant\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.tm-robot.com\/zh-hant\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.tm-robot.com\/zh-hant\/wp-json\/wp\/v2\/users\/8760"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tm-robot.com\/zh-hant\/wp-json\/wp\/v2\/comments?post=131484"}],"version-history":[{"count":3,"href":"https:\/\/www.tm-robot.com\/zh-hant\/wp-json\/wp\/v2\/docs\/131484\/revisions"}],"predecessor-version":[{"id":131488,"href":"https:\/\/www.tm-robot.com\/zh-hant\/wp-json\/wp\/v2\/docs\/131484\/revisions\/131488"}],"wp:attachment":[{"href":"https:\/\/www.tm-robot.com\/zh-hant\/wp-json\/wp\/v2\/media?parent=131484"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.tm-robot.com\/zh-hant\/wp-json\/wp\/v2\/doc_category?post=131484"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.tm-robot.com\/zh-hant\/wp-json\/wp\/v2\/doc_tag?post=131484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}