{"id":5232,"date":"2024-07-12T16:10:28","date_gmt":"2024-07-12T07:10:28","guid":{"rendered":"https:\/\/blog.smartlight.co.jp\/?p=5232"},"modified":"2024-07-12T17:48:12","modified_gmt":"2024-07-12T08:48:12","slug":"node-red%e3%81%a7modbus%e3%81%ae%e9%80%9a%e4%bf%a1%e3%82%92%e8%a9%a6%e3%81%97%e3%81%a6%e3%81%bf%e3%82%88%e3%81%86","status":"publish","type":"post","link":"https:\/\/blog.smartlight.co.jp\/?p=5232","title":{"rendered":"Node-RED\u3067Modbus\u306e\u901a\u4fe1\u3092\u8a66\u3057\u3066\u307f\u3088\u3046"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u306f\u3058\u3081\u306b<\/h2>\n\n\n\n<p class=\"has-medium-font-size\">\u4eca\u56de\u306f\u524d\u56de\u306b\u3084\u3063\u305fModbus\u901a\u4fe1\u3092Node-RED\u3067\u3082\u52d5\u304b\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059<\/p>\n\n\n\n<p>\u524d\u56de\uff1a<a href=\"https:\/\/blog.smartlight.co.jp\/?p=5184&amp;_thumbnail_id=5202\">https:\/\/blog.smartlight.co.jp\/?p=5184&amp;_thumbnail_id=5202<\/a><\/p>\n\n\n\n<div class=\"wp-block-jin-gb-block-box concept-box5\">\n<p class=\"has-medium-font-size\">\u4eca\u56de\u53c2\u8003\u306b\u3055\u305b\u3066\u9802\u304f\u30d6\u30ed\u30b0<\/p>\n\n\n\n<p><a href=\"https:\/\/digital-light.jp\/2022\/06\/19\/tested-modbus-master-slave-with-node-red\/\">Node-RED\u3092\u4f7f\u3063\u3066Modbus\u306eMaster\u3068Slave\u306e\u691c\u8a3c\u3092\u3057\u3066\u307f\u305f\uff5c\u30c7\u30b8\u30bf\u30eb\u30e9\u30a4\u30c8(Digital-light.jp)<\/a><\/p>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u76ee\u6b21<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"has-medium-font-size\"><a href=\"#a1\">\u30d5\u30ed\u30fc\u5168\u4f53<\/a><\/li>\n\n\n\n<li class=\"has-medium-font-size\"><a href=\"#a2\">\u30d5\u30ed\u30fc\u89e3\u8aac<\/a><\/li>\n\n\n\n<li class=\"has-medium-font-size\"><a href=\"#a3\">\u52d5\u4f5c<\/a><\/li>\n\n\n\n<li class=\"has-medium-font-size\"><a href=\"#a4\">\u307e\u3068\u3081<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a1\">\u30d5\u30ed\u30fc\u5168\u4f53<\/h2>\n\n\n\n<div class=\"wp-block-jin-gb-block-box simple-box1\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"701\" height=\"430\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-315.png\" alt=\"\" class=\"wp-image-5233\" \/><\/figure>\n<\/div>\n\n\n\n<p class=\"has-medium-font-size\">\u30ce\u30fc\u30c9\u66f8\u304d\u51fa\u3057<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>[{&quot;id&quot;:&quot;ae1b6df3bb9c4b5a&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;9847d11a04b36646&quot;,&quot;name&quot;:&quot;&quot;,&quot;props&quot;:[{&quot;p&quot;:&quot;payload&quot;},{&quot;p&quot;:&quot;topic&quot;,&quot;vt&quot;:&quot;str&quot;}],&quot;repeat&quot;:&quot;&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:false,&quot;onceDelay&quot;:0.1,&quot;topic&quot;:&quot;&quot;,&quot;payload&quot;:&quot;&quot;,&quot;payloadType&quot;:&quot;str&quot;,&quot;x&quot;:340,&quot;y&quot;:300,&quot;wires&quot;:[[&quot;a93effa614da2604&quot;]]},{&quot;id&quot;:&quot;f8ed3667788a4fd0&quot;,&quot;type&quot;:&quot;debug&quot;,&quot;z&quot;:&quot;9847d11a04b36646&quot;,&quot;name&quot;:&quot;&quot;,&quot;active&quot;:false,&quot;tosidebar&quot;:true,&quot;console&quot;:false,&quot;tostatus&quot;:false,&quot;complete&quot;:&quot;payload&quot;,&quot;targetType&quot;:&quot;msg&quot;,&quot;statusVal&quot;:&quot;&quot;,&quot;statusType&quot;:&quot;auto&quot;,&quot;x&quot;:800,&quot;y&quot;:340,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;922ed923301accb7&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;9847d11a04b36646&quot;,&quot;name&quot;:&quot;&quot;,&quot;props&quot;:[{&quot;p&quot;:&quot;payload&quot;},{&quot;p&quot;:&quot;topic&quot;,&quot;vt&quot;:&quot;str&quot;}],&quot;repeat&quot;:&quot;&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:false,&quot;onceDelay&quot;:0.1,&quot;topic&quot;:&quot;&quot;,&quot;payload&quot;:&quot;&quot;,&quot;payloadType&quot;:&quot;str&quot;,&quot;x&quot;:330,&quot;y&quot;:460,&quot;wires&quot;:[[&quot;9c6490e8241964b4&quot;]]},{&quot;id&quot;:&quot;9c6490e8241964b4&quot;,&quot;type&quot;:&quot;function&quot;,&quot;z&quot;:&quot;9847d11a04b36646&quot;,&quot;name&quot;:&quot;FC3 0<img decoding=\"async\" class=\"ranking-number\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/themes\/jin\/img\/rank04.png\" \/>&quot;,&quot;func&quot;:&quot;msg.payload = { \\n &#039;fc&#039;: 3,\\n &#039;unitid&#039;: 0,\\n &#039;address&#039;: 0 ,\\n &#039;quantity&#039;: 4\\n};\\n\\nreturn msg;&quot;,&quot;outputs&quot;:1,&quot;noerr&quot;:0,&quot;initialize&quot;:&quot;&quot;,&quot;finalize&quot;:&quot;&quot;,&quot;libs&quot;:[],&quot;x&quot;:480,&quot;y&quot;:500,&quot;wires&quot;:[[&quot;edc21ae6596480ce&quot;]]},{&quot;id&quot;:&quot;826b7a0cae32b0c2&quot;,&quot;type&quot;:&quot;function&quot;,&quot;z&quot;:&quot;9847d11a04b36646&quot;,&quot;name&quot;:&quot;FC16 0<img decoding=\"async\" class=\"ranking-number\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/themes\/jin\/img\/rank02.png\" \/>&quot;,&quot;func&quot;:&quot;msg.payload = {\\n value : msg.payload,\\n &#039;fc&#039;: 16,\\n &#039;unitid&#039;: 0,\\n &#039;address&#039;: 0 ,\\n &#039;quantity&#039;: 2\\n};\\n\\nreturn msg;&quot;,&quot;outputs&quot;:1,&quot;noerr&quot;:0,&quot;initialize&quot;:&quot;&quot;,&quot;finalize&quot;:&quot;&quot;,&quot;libs&quot;:[],&quot;x&quot;:660,&quot;y&quot;:820,&quot;wires&quot;:[[&quot;98fa71a376265232&quot;]]},{&quot;id&quot;:&quot;602494bf34f00e32&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;9847d11a04b36646&quot;,&quot;name&quot;:&quot;&quot;,&quot;props&quot;:[{&quot;p&quot;:&quot;payload&quot;},{&quot;p&quot;:&quot;topic&quot;,&quot;vt&quot;:&quot;str&quot;}],&quot;repeat&quot;:&quot;&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:false,&quot;onceDelay&quot;:0.1,&quot;topic&quot;:&quot;&quot;,&quot;payload&quot;:&quot;0&quot;,&quot;payloadType&quot;:&quot;num&quot;,&quot;x&quot;:350,&quot;y&quot;:720,&quot;wires&quot;:[[&quot;5c419a49d91c4cba&quot;]]},{&quot;id&quot;:&quot;5c419a49d91c4cba&quot;,&quot;type&quot;:&quot;join&quot;,&quot;z&quot;:&quot;9847d11a04b36646&quot;,&quot;name&quot;:&quot;&quot;,&quot;mode&quot;:&quot;custom&quot;,&quot;build&quot;:&quot;array&quot;,&quot;property&quot;:&quot;payload&quot;,&quot;propertyType&quot;:&quot;msg&quot;,&quot;key&quot;:&quot;topic&quot;,&quot;joiner&quot;:&quot;\\\\n&quot;,&quot;joinerType&quot;:&quot;str&quot;,&quot;accumulate&quot;:false,&quot;timeout&quot;:&quot;&quot;,&quot;count&quot;:&quot;2&quot;,&quot;reduceRight&quot;:false,&quot;reduceExp&quot;:&quot;&quot;,&quot;reduceInit&quot;:&quot;&quot;,&quot;reduceInitType&quot;:&quot;&quot;,&quot;reduceFixup&quot;:&quot;&quot;,&quot;x&quot;:490,&quot;y&quot;:820,&quot;wires&quot;:[[&quot;826b7a0cae32b0c2&quot;]]},{&quot;id&quot;:&quot;ecb171afe55be84e&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;9847d11a04b36646&quot;,&quot;name&quot;:&quot;&quot;,&quot;props&quot;:[{&quot;p&quot;:&quot;payload&quot;},{&quot;p&quot;:&quot;topic&quot;,&quot;vt&quot;:&quot;str&quot;}],&quot;repeat&quot;:&quot;&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:false,&quot;onceDelay&quot;:0.1,&quot;topic&quot;:&quot;&quot;,&quot;payload&quot;:&quot;100&quot;,&quot;payloadType&quot;:&quot;num&quot;,&quot;x&quot;:350,&quot;y&quot;:820,&quot;wires&quot;:[[&quot;5c419a49d91c4cba&quot;]]},{&quot;id&quot;:&quot;a4e6a3afceb67fea&quot;,&quot;type&quot;:&quot;modbus-response&quot;,&quot;z&quot;:&quot;9847d11a04b36646&quot;,&quot;name&quot;:&quot;&quot;,&quot;registerShowMax&quot;:20,&quot;x&quot;:880,&quot;y&quot;:620,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;edc21ae6596480ce&quot;,&quot;type&quot;:&quot;modbus-flex-getter&quot;,&quot;z&quot;:&quot;9847d11a04b36646&quot;,&quot;name&quot;:&quot;FlexGetter&quot;,&quot;showStatusActivities&quot;:false,&quot;showErrors&quot;:false,&quot;showWarnings&quot;:true,&quot;logIOActivities&quot;:false,&quot;server&quot;:&quot;b62d434859b22bc4&quot;,&quot;useIOFile&quot;:false,&quot;ioFile&quot;:&quot;&quot;,&quot;useIOForPayload&quot;:false,&quot;emptyMsgOnFail&quot;:false,&quot;keepMsgProperties&quot;:false,&quot;delayOnStart&quot;:false,&quot;startDelayTime&quot;:&quot;&quot;,&quot;x&quot;:650,&quot;y&quot;:600,&quot;wires&quot;:[[&quot;496afddf78deab13&quot;],[&quot;a4e6a3afceb67fea&quot;,&quot;496afddf78deab13&quot;]]},{&quot;id&quot;:&quot;98fa71a376265232&quot;,&quot;type&quot;:&quot;modbus-flex-write&quot;,&quot;z&quot;:&quot;9847d11a04b36646&quot;,&quot;name&quot;:&quot;FlexWrite&quot;,&quot;showStatusActivities&quot;:false,&quot;showErrors&quot;:false,&quot;showWarnings&quot;:true,&quot;server&quot;:&quot;b62d434859b22bc4&quot;,&quot;emptyMsgOnFail&quot;:false,&quot;keepMsgProperties&quot;:false,&quot;delayOnStart&quot;:false,&quot;startDelayTime&quot;:&quot;&quot;,&quot;x&quot;:840,&quot;y&quot;:820,&quot;wires&quot;:[[],[]]},{&quot;id&quot;:&quot;a93effa614da2604&quot;,&quot;type&quot;:&quot;modbus-server&quot;,&quot;z&quot;:&quot;9847d11a04b36646&quot;,&quot;name&quot;:&quot;&quot;,&quot;logEnabled&quot;:false,&quot;hostname&quot;:&quot;0.0.0.0&quot;,&quot;serverPort&quot;:&quot;502&quot;,&quot;responseDelay&quot;:100,&quot;delayUnit&quot;:&quot;ms&quot;,&quot;coilsBufferSize&quot;:10000,&quot;holdingBufferSize&quot;:10000,&quot;inputBufferSize&quot;:10000,&quot;discreteBufferSize&quot;:10000,&quot;showErrors&quot;:false,&quot;showStatusActivities&quot;:false,&quot;x&quot;:550,&quot;y&quot;:320,&quot;wires&quot;:[[&quot;f8ed3667788a4fd0&quot;],[&quot;f8ed3667788a4fd0&quot;],[&quot;f8ed3667788a4fd0&quot;],[&quot;f8ed3667788a4fd0&quot;],[&quot;f8ed3667788a4fd0&quot;]]},{&quot;id&quot;:&quot;496afddf78deab13&quot;,&quot;type&quot;:&quot;debug&quot;,&quot;z&quot;:&quot;9847d11a04b36646&quot;,&quot;name&quot;:&quot;debug 7&quot;,&quot;active&quot;:true,&quot;tosidebar&quot;:true,&quot;console&quot;:false,&quot;tostatus&quot;:false,&quot;complete&quot;:&quot;false&quot;,&quot;statusVal&quot;:&quot;&quot;,&quot;statusType&quot;:&quot;auto&quot;,&quot;x&quot;:830,&quot;y&quot;:520,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;b62d434859b22bc4&quot;,&quot;type&quot;:&quot;modbus-client&quot;,&quot;name&quot;:&quot;&quot;,&quot;clienttype&quot;:&quot;tcp&quot;,&quot;bufferCommands&quot;:true,&quot;stateLogEnabled&quot;:false,&quot;queueLogEnabled&quot;:false,&quot;failureLogEnabled&quot;:false,&quot;tcpHost&quot;:&quot;127.0.0.1&quot;,&quot;tcpPort&quot;:&quot;502&quot;,&quot;tcpType&quot;:&quot;DEFAULT&quot;,&quot;serialPort&quot;:&quot;\/dev\/ttyUSB&quot;,&quot;serialType&quot;:&quot;RTU-BUFFERD&quot;,&quot;serialBaudrate&quot;:&quot;9600&quot;,&quot;serialDatabits&quot;:&quot;8&quot;,&quot;serialStopbits&quot;:&quot;1&quot;,&quot;serialParity&quot;:&quot;none&quot;,&quot;serialConnectionDelay&quot;:&quot;100&quot;,&quot;serialAsciiResponseStartDelimiter&quot;:&quot;0x3A&quot;,&quot;unit_id&quot;:&quot;1&quot;,&quot;commandDelay&quot;:&quot;1&quot;,&quot;clientTimeout&quot;:&quot;1000&quot;,&quot;reconnectOnTimeout&quot;:true,&quot;reconnectTimeout&quot;:&quot;2000&quot;,&quot;parallelUnitIdsAllowed&quot;:true,&quot;showErrors&quot;:false,&quot;showWarnings&quot;:true,&quot;showLogs&quot;:true}]\n<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a2\">\u30d5\u30ed\u30fc\u89e3\u8aac<\/h2>\n\n\n\n<p class=\"has-large-font-size\">\u2460<span style=\"text-decoration: underline\"><span class=\"marker\"><span class=\"marker2\">Modbus\u30b5\u30fc\u30d0\u3092\u8d77\u52d5<\/span><\/span><\/span><\/p>\n\n\n\n<p class=\"has-medium-font-size\">\u3053\u306e\u30d5\u30ed\u30fc\u306einject\u30ce\u30fc\u30c9\u3092\u8d77\u52d5\u3059\u308b\u3068ModbusServer\u304c\u8d77\u52d5\u3057\u307e\u3059<br>\u3053\u308c\u306fSlave\u306b\u5024\u3059\u308b\u3082\u306e\u3067\u3059<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"582\" height=\"181\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-318.png\" alt=\"\" class=\"wp-image-5236\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">Modbus Server\u306e\u8a2d\u5b9a\u306fport\u3092502\u306b\u3057\u305f\u3060\u3051\u3067\u3059<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"417\" height=\"486\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-319.png\" alt=\"\" class=\"wp-image-5240\" \/><\/figure>\n\n\n\n<p class=\"has-large-font-size\">\u2461<span style=\"text-decoration: underline\"><span class=\"marker2\">\u30b5\u30fc\u30d0\u306b\u66f8\u304d\u8fbc\u307f\u3092\u3059\u308b<\/span><\/span><\/p>\n\n\n\n<p class=\"has-medium-font-size\">\u3053\u306e\u30d5\u30ed\u30fc\u3067\u306f\u7acb\u3061\u4e0a\u3052\u305f\u30b5\u30fc\u30d0\u306b\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3057\u307e\u3059<br>\u4e8c\u3064\u306einject\u30ce\u30fc\u30c9(0\/100)\u3001\u3053\u306e\u5024\u3092\u62bc\u3059\u3068\u5024\u3092\u30b5\u30fc\u30d0\u683c\u7d0d\u3057\u307e\u3059<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"570\" height=\"190\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-322.png\" alt=\"\" class=\"wp-image-5243\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">\u30fbjoin\u30ce\u30fc\u30c9<br>\u3053\u306e\u30ce\u30fc\u30c9\u306f\u524d\u306einject\u30ce\u30fc\u30c9\u304b\u3089\u306e\u30c7\u30fc\u30bf\u3092\u9023\u7d50\u3057\u3066\u6b21\u306efunction\u30ce\u30fc\u30c9\u306e\u30c7\u30fc\u30bf\u3092\u9001\u3063\u3066\u3044\u307e\u3059<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"625\" height=\"193\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-326.png\" alt=\"\" class=\"wp-image-5247\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">\u4eca\u56de\u306f\u4e8c\u3064\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9023\u7d50\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067inject\u30ce\u30fc\u30c9\u304c\u4e8c\u56de\u62bc\u3055\u308c\u305f\u3089\u6b21\u306e\u30d5\u30ed\u30fc\u306b\u9001\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"413\" height=\"377\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-330.png\" alt=\"\" class=\"wp-image-5251\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">\u30fbfunction\u30ce\u30fc\u30c9<\/p>\n\n\n\n<p class=\"has-medium-font-size\">join\u30ce\u30fc\u30c9\u304b\u3089\u6765\u305f\u30c7\u30fc\u30bf\u306b\u4ed6\u306e\u8981\u7d20\u3092\u4ed8\u5c5e\u3059\u308b\u3088\u3046\u306a\u30b3\u30fc\u30c9\u306b\u306a\u3063\u3066\u3044\u307e\u3059<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"625\" height=\"193\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-327.png\" alt=\"\" class=\"wp-image-5248\" \/><\/figure>\n\n\n\n<div class=\"wp-block-jin-gb-block-box simple-box1\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"530\" height=\"362\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-332.png\" alt=\"\" class=\"wp-image-5253\" \/><\/figure>\n\n\n\n<p><code>fc: 16<\/code> \u306f\u3001Modbus\u306e\u66f8\u304d\u8fbc\u307f\u30b3\u30de\u30f3\u30c9\uff08Function Code 16\uff09\u3092\u610f\u5473\u3057\u307e\u3059\u3002\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u3001\u8907\u6570\u306e\u30ec\u30b8\u30b9\u30bf\u306b\u30c7\u30fc\u30bf\u3092\u66f8\u304d\u8fbc\u3080\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<p><code>unitid: 0<\/code> \u306f\u3001\u30bf\u30fc\u30b2\u30c3\u30c8\u3068\u306a\u308b\u30c7\u30d0\u30a4\u30b9\u306e\u30e6\u30cb\u30c3\u30c8ID\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306fID\u304c0\u306e\u30c7\u30d0\u30a4\u30b9\u306b\u5bfe\u3057\u3066\u64cd\u4f5c\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>address: 0<\/code> \u306f\u3001\u66f8\u304d\u8fbc\u307f\u3092\u958b\u59cb\u3059\u308b\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u30a2\u30c9\u30ec\u30b90\u304b\u3089\u66f8\u304d\u8fbc\u307f\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>quantity: 2<\/code> \u306f\u3001\u66f8\u304d\u8fbc\u3080\u30ec\u30b8\u30b9\u30bf\u306e\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f2\u3064\u306e\u30ec\u30b8\u30b9\u30bf\u306b\u30c7\u30fc\u30bf\u3092\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>value: msg.payload<\/code> \u306f\u3001\u5b9f\u969b\u306b\u66f8\u304d\u8fbc\u3080\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u5165\u529b\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u30da\u30a4\u30ed\u30fc\u30c9\u304c\u305d\u306e\u307e\u307e\u66f8\u304d\u8fbc\u307e\u308c\u307e\u3059<\/p>\n<\/div>\n\n\n\n<p class=\"has-medium-font-size\">\u30fbModeles-Flex-Write\u30ce\u30fc\u30c9<br>\u3053\u3053\u3067\u306ffunction\u30ce\u30fc\u30c9\u304b\u3089\u6765\u305fmsg.payload\u306b\u5165\u3063\u3066\u3044\u308b\u60c5\u5831\u901a\u308a\u306bServer\u306b\u66f8\u304d\u8fbc\u307f\u3092\u3057\u307e\u3059<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"625\" height=\"193\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-328.png\" alt=\"\" class=\"wp-image-5249\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">\u5148\u7a0b\u7acb\u3061\u4e0a\u3052\u305f\u30b5\u30fc\u30d0\u3092\u5bfe\u8c61\u3068\u3057\u3066\u3044\u307e\u3059<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"532\" height=\"327\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-335.png\" alt=\"\" class=\"wp-image-5256\" \/><\/figure>\n\n\n\n<p class=\"has-large-font-size\"><span style=\"text-decoration: underline\"><span class=\"marker2\">\u2462\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u53d6\u308a<\/span><\/span><\/p>\n\n\n\n<p>\u3053\u306e\u30d5\u30ed\u30fc\u3067\u306finject\u30ce\u30fc\u30c9\u3092\u62bc\u3059\u3068\u30b5\u30fc\u30d0\u306b\u767b\u9332\u3057\u3066\u3044\u308b\u30c7\u30fc\u30bf\u3092\u53d6\u3063\u3066\u6765\u307e\u3059<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"803\" height=\"225\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-336.png\" alt=\"\" class=\"wp-image-5257\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">\u30fbfunction\u30ce\u30fc\u30c9<br>\u3053\u306e\u30ce\u30fc\u30c9\u3067\u306f\u30c7\u30fc\u30bf\u3092\u53d6\u3063\u3066\u304f\u308b\u305f\u3081\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6b21\u306e\u30ce\u30fc\u30c9\u306b\u6e21\u3057\u3066\u3044\u307e\u3059<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"811\" height=\"212\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-339.png\" alt=\"\" class=\"wp-image-5260\" \/><\/figure>\n\n\n\n<div class=\"wp-block-jin-gb-block-box simple-box1\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"532\" height=\"436\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-344.png\" alt=\"\" class=\"wp-image-5265\" \/><\/figure>\n\n\n\n<p><code>fc: 3<\/code> \u306f\u3001Modbus\u306e\u8aad\u307f\u53d6\u308a\u30b3\u30de\u30f3\u30c9\uff08Function Code 3\uff09\u3092\u610f\u5473\u3057\u307e\u3059\u3002\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u3001\u4fdd\u6301\u30ec\u30b8\u30b9\u30bf\uff08Holding Registers\uff09\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u53d6\u308b\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<p><code>unitid: 0<\/code> \u306f\u3001\u30bf\u30fc\u30b2\u30c3\u30c8\u3068\u306a\u308b\u30c7\u30d0\u30a4\u30b9\u306e\u30e6\u30cb\u30c3\u30c8ID\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306fID\u304c0\u306e\u30c7\u30d0\u30a4\u30b9\u306b\u5bfe\u3057\u3066\u64cd\u4f5c\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>address: 0<\/code> \u306f\u3001\u8aad\u307f\u53d6\u308a\u3092\u958b\u59cb\u3059\u308b\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u30a2\u30c9\u30ec\u30b90\u304b\u3089\u8aad\u307f\u53d6\u308a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>quantity: 4<\/code> \u306f\u3001\u8aad\u307f\u53d6\u308b\u30ec\u30b8\u30b9\u30bf\u306e\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f4\u3064\u306e\u30ec\u30b8\u30b9\u30bf\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u53d6\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<p class=\"has-medium-font-size\">\u30fbFlexGetter\u30ce\u30fc\u30c9<br>function\u30ce\u30fc\u30c9\u304b\u3089\u6765\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3067\u30b5\u30fc\u30d0\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u3063\u3066\u304d\u307e\u3059<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"811\" height=\"212\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-341.png\" alt=\"\" class=\"wp-image-5262\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">\u30b5\u30fc\u30d0\u304c\u30bf\u30fc\u30b2\u30c3\u30c8\u306b\u6210\u3063\u3066\u3044\u308b<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"532\" height=\"262\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-345.png\" alt=\"\" class=\"wp-image-5266\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">\u30fbResponse\u30ce\u30fc\u30c9<br>\u524d\u306e\u30b5\u30fc\u30d0\u304b\u3089\u53d6\u3063\u3066\u304d\u305f\u30c7\u30fc\u30bf\u3092\u898b\u3084\u3059\u304f\u30ce\u30fc\u30c9\u306e\u4e0b\u306b\u8868\u793a\u3059\u308b<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"811\" height=\"218\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-342.png\" alt=\"\" class=\"wp-image-5263\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a3\">\u52d5\u4f5c<\/h2>\n\n\n\n<p class=\"has-medium-font-size\">\u2460\u521d\u671f\u72b6\u614b<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"881\" height=\"592\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-346.png\" alt=\"\" class=\"wp-image-5267\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-346.png 881w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-346-300x202.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-346-768x516.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-346.png 856w\" sizes=\"auto, (max-width: 881px) 100vw, 881px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">\u2461\u30b5\u30fc\u30d0\u8d77\u52d5<br>\u4e00\u756a\u4e0a\u306einject\u30ce\u30fc\u30c9\u3092\u62bc\u3057\u305f\u3089\u3001windowlog\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u307e\u3059<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"673\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-347-1024x673.png\" alt=\"\" class=\"wp-image-5268\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-347-1024x673.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-347-300x197.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-347-768x505.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-347.png 1243w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-347-1024x673.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">\u2462\u5408\u8a08\u4e8c\u56de\u62bc\u3059<br>\u30b5\u30fc\u30d0\u306b\u5024\u3092\u66f8\u304d\u8fbc\u3093\u3067\u3044\u304d\u307e\u3059(0\u30fb100\u306e\u9806\u756a\u3067\u62bc\u3057\u307e\u3057\u305f)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"614\" height=\"185\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-348.png\" alt=\"\" class=\"wp-image-5270\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">\u2463\u30b5\u30fc\u30d0\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u3063\u3066\u6765\u308b<br>inject\u30ce\u30fc\u30c9\u3092\u62bc\u3059\u3068\u30b5\u30fc\u30d0\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u3063\u3066\u6765\u307e\u3059<br>(Respon\u30ce\u30fc\u30c9\u306e\u4e0b\u306e\u90e8\u5206\u304c\u5909\u5316\u3057\u3066\u3044\u308b)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"877\" height=\"561\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-350.png\" alt=\"\" class=\"wp-image-5272\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-350.png 877w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-350-300x192.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-350-768x491.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-350.png 856w\" sizes=\"auto, (max-width: 877px) 100vw, 877px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">\u7121\u4e8b\u306b\u66f8\u304d\u8fbc\u3093\u3060\u5024\u3092\u8aad\u307f\u51fa\u3057\u51fa\u6765\u3066\u3044\u308b\u4e8b\u304c\u78ba\u8a8d\u304c\u53d6\u308c\u305f<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a4\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p class=\"has-medium-font-size\">\u524d\u56de\u306b\u7d9a\u304d\u3001Modbus\u3092\u52c9\u5f37\u3057\u307e\u3057\u305f<br>Node-red\u3067\u52d5\u4f5c\u30d5\u30ed\u30fc\u3092\u7406\u89e3\u3059\u308b\u306e\u306b\u4e2d\u3005\u306b\u6642\u9593\u304c\u639b\u304b\u308a\u307e\u3057\u305f<br>\u6b21\u56de\u306fComfortClick\u306b\u3082Modbus\u3042\u308b\u306e\u3067\u3001Win\u4e0a\u306eModbus\u30b7\u30df\u30e5\u30ec\u30fc\u30bf\u30fc\u3068\u3064\u306a\u304c\u308b\u304b\u8a66\u3057\u3066\u307f\u307e\u3059<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b \u4eca\u56de\u306f\u524d\u56de\u306b\u3084\u3063\u305fModbus\u901a\u4fe1\u3092Node-RED\u3067\u3082\u52d5\u304b\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059 \u524d\u56de\uff1ahttps:\/\/blog.smartlight.co.jp\/?p=5184amp;_thumbnail_id=5202 <\/p>\n","protected":false},"author":15,"featured_media":5290,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jin_ogp_image_url":"","_jin_last_featured_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-5232","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-intern"],"jetpack_featured_media_url":"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/07\/image-355.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/5232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5232"}],"version-history":[{"count":5,"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/5232\/revisions"}],"predecessor-version":[{"id":5284,"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/5232\/revisions\/5284"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=\/wp\/v2\/media\/5290"}],"wp:attachment":[{"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}