[{"data":1,"prerenderedAt":1107},["ShallowReactive",2],{"docs-nav-docs_en":3,"docs-page-\u002Fen\u002Fexamples\u002Ftcp-client-modbus-master":371,"docs-surround-\u002Fen\u002Fexamples\u002Ftcp-client-modbus-master":1104},[4],{"title":5,"path":6,"stem":7,"children":8},"En","\u002Fen","en",[9,13,45,62,80,107,161,175,194,215,242,287,307],{"title":10,"path":6,"stem":11,"navTitle":12},"QInsight Documentation","en\u002Findex","Overview",{"title":14,"navTitle":15,"path":16,"stem":17,"children":18,"page":44},"Getting Started",null,"\u002Fen\u002Fgetting-started","en\u002F01.getting-started",[19,23,27,31,36,40],{"title":20,"path":21,"stem":22,"navTitle":20},"What is QENEX Suite","\u002Fen\u002Fgetting-started\u002Fwhat-is-qenex-suite","en\u002F01.getting-started\u002F1.what-is-qenex-suite",{"title":24,"path":25,"stem":26,"navTitle":24},"What is QInsight","\u002Fen\u002Fgetting-started\u002Fwhat-is-qinsight","en\u002F01.getting-started\u002F2.what-is-qinsight",{"title":28,"path":29,"stem":30,"navTitle":28},"Installation","\u002Fen\u002Fgetting-started\u002Finstallation","en\u002F01.getting-started\u002F3.installation",{"title":32,"path":33,"stem":34,"navTitle":35},"The QInsight user interface","\u002Fen\u002Fgetting-started\u002Fthe-qinsight-interface","en\u002F01.getting-started\u002F4.the-qinsight-interface","User interface",{"title":37,"path":38,"stem":39,"navTitle":37},"Licensing","\u002Fen\u002Fgetting-started\u002Flicensing","en\u002F01.getting-started\u002F5.licensing",{"title":41,"path":42,"stem":43,"navTitle":41},"Release notes","\u002Fen\u002Fgetting-started\u002Frelease-notes","en\u002F01.getting-started\u002F6.release-notes",false,{"title":46,"navTitle":15,"path":47,"stem":48,"children":49,"page":44},"First Project","\u002Fen\u002Ffirst-project","en\u002F02.first-project",[50,54,58],{"title":51,"path":52,"stem":53,"navTitle":51},"Create a project","\u002Fen\u002Ffirst-project\u002Fcreate-a-project","en\u002F02.first-project\u002F1.create-a-project",{"title":55,"path":56,"stem":57,"navTitle":55},"Project structure","\u002Fen\u002Ffirst-project\u002Fproject-structure","en\u002F02.first-project\u002F2.project-structure",{"title":59,"path":60,"stem":61,"navTitle":59},"Project password","\u002Fen\u002Ffirst-project\u002Fproject-password","en\u002F02.first-project\u002F3.project-password",{"title":63,"navTitle":15,"path":64,"stem":65,"children":66,"page":44},"Connecting a Device","\u002Fen\u002Fconnecting-a-device","en\u002F03.connecting-a-device",[67,71,75],{"title":68,"path":69,"stem":70,"navTitle":68},"Add a driver","\u002Fen\u002Fconnecting-a-device\u002Fadd-a-driver","en\u002F03.connecting-a-device\u002F1.add-a-driver",{"title":72,"path":73,"stem":74,"navTitle":72},"Add a protocol","\u002Fen\u002Fconnecting-a-device\u002Fadd-a-protocol","en\u002F03.connecting-a-device\u002F2.add-a-protocol",{"title":76,"path":77,"stem":78,"navTitle":79},"Link a driver and a protocol","\u002Fen\u002Fconnecting-a-device\u002Flink-driver-and-protocol","en\u002F03.connecting-a-device\u002F3.link-driver-and-protocol","Linking",{"title":81,"navTitle":15,"path":82,"stem":83,"children":84,"page":44},"Variables","\u002Fen\u002Fvariables","en\u002F04.variables",[85,89,94,98,103],{"title":86,"path":87,"stem":88,"navTitle":86},"What is a variable","\u002Fen\u002Fvariables\u002Fwhat-is-a-variable","en\u002F04.variables\u002F1.what-is-a-variable",{"title":90,"path":91,"stem":92,"navTitle":93},"Conversion and presentation","\u002Fen\u002Fvariables\u002Fconversion-and-presentation","en\u002F04.variables\u002F2.conversion-and-presentation","Conversion & presentation",{"title":95,"path":96,"stem":97,"navTitle":95},"Add a variable","\u002Fen\u002Fvariables\u002Fadd-a-variable","en\u002F04.variables\u002F3.add-a-variable",{"title":99,"path":100,"stem":101,"navTitle":102},"Matrix variable (array, curve, map)","\u002Fen\u002Fvariables\u002Fmatrix-variable","en\u002F04.variables\u002F4.matrix-variable","Matrix variable",{"title":104,"path":105,"stem":106,"navTitle":104},"Events","\u002Fen\u002Fvariables\u002Fevents","en\u002F04.variables\u002F5.events",{"title":108,"navTitle":15,"path":109,"stem":110,"children":111,"page":44},"Visualization","\u002Fen\u002Fvisualization","en\u002F05.visualization",[112,117,122,126,131,136,141,146,151,156],{"title":113,"path":114,"stem":115,"navTitle":116},"Create a workspace","\u002Fen\u002Fvisualization\u002Fcreate-a-workspace","en\u002F05.visualization\u002F1.create-a-workspace","Workspace",{"title":118,"path":119,"stem":120,"navTitle":121},"Writing values to the device","\u002Fen\u002Fvisualization\u002Fwrite-to-device","en\u002F05.visualization\u002F10.write-to-device","Writing to the device",{"title":123,"path":124,"stem":125,"navTitle":123},"Add a control","\u002Fen\u002Fvisualization\u002Fadd-a-control","en\u002F05.visualization\u002F2.add-a-control",{"title":127,"path":128,"stem":129,"navTitle":130},"Bind a control to a variable","\u002Fen\u002Fvisualization\u002Fbind-a-control","en\u002F05.visualization\u002F3.bind-a-control","Bind a control",{"title":132,"path":133,"stem":134,"navTitle":135},"Graph — signal time course","\u002Fen\u002Fvisualization\u002Fgraph-control","en\u002F05.visualization\u002F4.graph-control","Graph",{"title":137,"path":138,"stem":139,"navTitle":140},"XY Graph — signal versus signal","\u002Fen\u002Fvisualization\u002Fxy-graph-control","en\u002F05.visualization\u002F5.xy-graph-control","XY Graph",{"title":142,"path":143,"stem":144,"navTitle":145},"Gauge — instantaneous value indicator","\u002Fen\u002Fvisualization\u002Fgauge-control","en\u002F05.visualization\u002F6.gauge-control","Gauge",{"title":147,"path":148,"stem":149,"navTitle":150},"Single-Signal — a value with a caption","\u002Fen\u002Fvisualization\u002Fsignal-control","en\u002F05.visualization\u002F7.signal-control","Single-Signal",{"title":152,"path":153,"stem":154,"navTitle":155},"Watch Table — a table of variables","\u002Fen\u002Fvisualization\u002Fwatch-table-control","en\u002F05.visualization\u002F8.watch-table-control","Watch Table",{"title":157,"path":158,"stem":159,"navTitle":160},"Matrix control — maps and calibration","\u002Fen\u002Fvisualization\u002Fmatrix-control","en\u002F05.visualization\u002F9.matrix-control","Matrix control",{"title":162,"navTitle":15,"path":163,"stem":164,"children":165,"page":44},"Running and Monitoring","\u002Fen\u002Frunning","en\u002F06.running",[166,170],{"title":167,"path":168,"stem":169,"navTitle":167},"Start and stop","\u002Fen\u002Frunning\u002Fstart-and-stop","en\u002F06.running\u002F1.start-and-stop",{"title":171,"path":172,"stem":173,"navTitle":174},"Watching live data","\u002Fen\u002Frunning\u002Fwatching-live-data","en\u002F06.running\u002F2.watching-live-data","Live data",{"title":176,"navTitle":15,"path":177,"stem":178,"children":179,"page":44},"Logging and Replay","\u002Fen\u002Flogging-and-replay","en\u002F07.logging-and-replay",[180,184,189],{"title":181,"path":182,"stem":183,"navTitle":181},"Logging data","\u002Fen\u002Flogging-and-replay\u002Flogging-data","en\u002F07.logging-and-replay\u002F1.logging-data",{"title":185,"path":186,"stem":187,"navTitle":188},"Replaying a log","\u002Fen\u002Flogging-and-replay\u002Freplaying-a-log","en\u002F07.logging-and-replay\u002F2.replaying-a-log","Replay",{"title":190,"path":191,"stem":192,"navTitle":193},"Exporting data","\u002Fen\u002Flogging-and-replay\u002Fexporting-data","en\u002F07.logging-and-replay\u002F3.exporting-data","Export",{"title":195,"navTitle":15,"path":196,"stem":197,"children":198,"page":44},"Python Scripts","\u002Fen\u002Fpython-scripts","en\u002F08.python-scripts",[199,203,207,211],{"title":200,"path":201,"stem":202,"navTitle":12},"Scripts overview","\u002Fen\u002Fpython-scripts\u002Fscripts-overview","en\u002F08.python-scripts\u002F1.scripts-overview",{"title":204,"path":205,"stem":206,"navTitle":204},"Accessing variables","\u002Fen\u002Fpython-scripts\u002Faccessing-variables","en\u002F08.python-scripts\u002F2.accessing-variables",{"title":208,"path":209,"stem":210,"navTitle":208},"Example script","\u002Fen\u002Fpython-scripts\u002Fexample-script","en\u002F08.python-scripts\u002F3.example-script",{"title":212,"path":213,"stem":214,"navTitle":212},"CSV post-processing","\u002Fen\u002Fpython-scripts\u002Fcsv-post-processing","en\u002F08.python-scripts\u002F4.csv-post-processing",{"title":216,"navTitle":15,"path":217,"stem":218,"children":219,"page":44},"Custom extensions","\u002Fen\u002Fcustom-extensions","en\u002F09.custom-extensions",[220,224,228,232,237],{"title":221,"path":222,"stem":223,"navTitle":221},"Custom driver","\u002Fen\u002Fcustom-extensions\u002Fcustom-driver","en\u002F09.custom-extensions\u002F1.custom-driver",{"title":225,"path":226,"stem":227,"navTitle":225},"Custom protocol","\u002Fen\u002Fcustom-extensions\u002Fcustom-protocol","en\u002F09.custom-extensions\u002F2.custom-protocol",{"title":229,"path":230,"stem":231,"navTitle":229},"Custom Control","\u002Fen\u002Fcustom-extensions\u002Fcustom-control","en\u002F09.custom-extensions\u002F3.custom-control",{"title":233,"path":234,"stem":235,"navTitle":236},"Complete example — ISS position","\u002Fen\u002Fcustom-extensions\u002Fiss-example","en\u002F09.custom-extensions\u002F4.iss-example","Example ISS",{"title":238,"path":239,"stem":240,"navTitle":241},"Complete example — temperature sensor","\u002Fen\u002Fcustom-extensions\u002Ftemp-sensor-example","en\u002F09.custom-extensions\u002F5.temp-sensor-example","Example temp sensor",{"title":243,"navTitle":15,"path":244,"stem":245,"children":246,"page":44},"QFW SDK","\u002Fen\u002Fdevice-sdk","en\u002F10.device-sdk",[247,252,257,262,267,272,277,282],{"title":248,"path":249,"stem":250,"navTitle":251},"QFW SDK — introduction","\u002Fen\u002Fdevice-sdk\u002Fintroduction","en\u002F10.device-sdk\u002F1.introduction","Introduction",{"title":253,"path":254,"stem":255,"navTitle":256},"XCP in the QFW SDK","\u002Fen\u002Fdevice-sdk\u002Fxcp","en\u002F10.device-sdk\u002F2.xcp","XCP",{"title":258,"path":259,"stem":260,"navTitle":261},"Integration step by step: XCP on TCP with FreeRTOS + lwIP","\u002Fen\u002Fdevice-sdk\u002Fintegration-tcp","en\u002F10.device-sdk\u002F3.integration-tcp","Integration: XCP on TCP",{"title":263,"path":264,"stem":265,"navTitle":266},"XCP on classic CAN — what changes","\u002Fen\u002Fdevice-sdk\u002Fcan","en\u002F10.device-sdk\u002F4.can","XCP on classic CAN",{"title":268,"path":269,"stem":270,"navTitle":271},"Integration without an RTOS: XCP on TCP from the main loop","\u002Fen\u002Fdevice-sdk\u002Fbaremetal","en\u002F10.device-sdk\u002F5.baremetal","Integration without an RTOS",{"title":273,"path":274,"stem":275,"navTitle":276},"The engine contract","\u002Fen\u002Fdevice-sdk\u002Fengine-contract","en\u002F10.device-sdk\u002F6.engine-contract","Engine contract",{"title":278,"path":279,"stem":280,"navTitle":281},"Variable addresses for QInsight","\u002Fen\u002Fdevice-sdk\u002Fvariable-addresses","en\u002F10.device-sdk\u002F7.variable-addresses","Variable addresses",{"title":283,"path":284,"stem":285,"navTitle":286},"Troubleshooting the SDK integration","\u002Fen\u002Fdevice-sdk\u002Ftroubleshooting","en\u002F10.device-sdk\u002F8.troubleshooting","Troubleshooting",{"title":288,"navTitle":15,"path":289,"stem":290,"children":291,"page":44},"Reference","\u002Fen\u002Freference","en\u002F11.reference",[292,296,300,304],{"title":293,"path":294,"stem":295,"navTitle":293},"Drivers","\u002Fen\u002Freference\u002Fdrivers","en\u002F11.reference\u002F1.drivers",{"title":297,"path":298,"stem":299,"navTitle":297},"Protocols","\u002Fen\u002Freference\u002Fprotocols","en\u002F11.reference\u002F2.protocols",{"title":301,"path":302,"stem":303,"navTitle":301},"Controls","\u002Fen\u002Freference\u002Fcontrols","en\u002F11.reference\u002F3.controls",{"title":286,"path":305,"stem":306,"navTitle":286},"\u002Fen\u002Freference\u002Ftroubleshooting","en\u002F11.reference\u002F4.troubleshooting",{"title":308,"navTitle":15,"path":309,"stem":310,"children":311,"page":44},"Examples","\u002Fen\u002Fexamples","en\u002F12.examples",[312,316,321,326,331,335,339,343,347,351,356,361,366],{"title":313,"path":314,"stem":315,"navTitle":313},"Simulation: all signals","\u002Fen\u002Fexamples\u002Fsimulation-all-signals","en\u002F12.examples\u002F01.simulation-all-signals",{"title":317,"path":318,"stem":319,"navTitle":320},"Modbus RTU master over a serial line","\u002Fen\u002Fexamples\u002Fserial-modbus-master","en\u002F12.examples\u002F02.serial-modbus-master","Modbus RTU master",{"title":322,"path":323,"stem":324,"navTitle":325},"Modbus RTU slave with simulated sensors","\u002Fen\u002Fexamples\u002Fserial-modbus-slave","en\u002F12.examples\u002F03.serial-modbus-slave","Modbus RTU slave",{"title":327,"path":328,"stem":329,"navTitle":330},"Modbus TCP master over a TCP client","\u002Fen\u002Fexamples\u002Ftcp-client-modbus-master","en\u002F12.examples\u002F04.tcp-client-modbus-master","Modbus TCP master",{"title":332,"path":333,"stem":334,"navTitle":332},"Modbus TCP slave on the TCP Server","\u002Fen\u002Fexamples\u002Ftcp-server-modbus-slave","en\u002F12.examples\u002F05.tcp-server-modbus-slave",{"title":336,"path":337,"stem":338,"navTitle":336},"Bit field and a script","\u002Fen\u002Fexamples\u002Fbit-field-script","en\u002F12.examples\u002F08.bit-field-script",{"title":340,"path":341,"stem":342,"navTitle":340},"Two ECUs at once","\u002Fen\u002Fexamples\u002Ftwo-ecus","en\u002F12.examples\u002F09.two-ecus",{"title":344,"path":345,"stem":346,"navTitle":344},"ISS position live","\u002Fen\u002Fexamples\u002Fiss-live-tracking","en\u002F12.examples\u002F10.iss-live-tracking",{"title":348,"path":349,"stem":350,"navTitle":348},"Simulated thermometer","\u002Fen\u002Fexamples\u002Fsimul-temp-measure","en\u002F12.examples\u002F11.simul-temp-measure",{"title":352,"path":353,"stem":354,"navTitle":355},"JSON signals from a Python generator","\u002Fen\u002Fexamples\u002Fjson-signal-python","en\u002F12.examples\u002F12.json-signal-python","JSON signals from Python",{"title":357,"path":358,"stem":359,"navTitle":360},"Raw CAN frames from a Raspberry Pi","\u002Fen\u002Fexamples\u002Fraw-can-python","en\u002F12.examples\u002F13.raw-can-python","Raw CAN from a Raspberry Pi",{"title":362,"path":363,"stem":364,"navTitle":365},"XCP on TCP on a NUCLEO-H723ZG: measurement, stimulation and calibration maps","\u002Fen\u002Fexamples\u002Ftcp-client-xcp-nucleo-maps","en\u002F12.examples\u002F14.tcp-client-xcp-nucleo-maps","XCP on TCP on NUCLEO-H723ZG",{"title":367,"path":368,"stem":369,"navTitle":370},"XCP on CAN on a NUCLEO-H723ZG: measurement, stimulation and calibration maps","\u002Fen\u002Fexamples\u002Fcan-xcp-nucleo-maps","en\u002F12.examples\u002F15.can-xcp-nucleo-maps","XCP on CAN on NUCLEO-H723ZG",{"id":372,"title":327,"body":373,"description":1098,"extension":1099,"meta":1100,"navTitle":330,"navigation":1101,"path":328,"seo":1102,"stem":329,"__hash__":1103},"docs_en\u002Fen\u002F12.examples\u002F04.tcp-client-modbus-master.md",{"type":374,"value":375,"toc":1083},"minimark",[376,380,392,397,432,439,443,483,487,502,507,517,618,630,640,703,742,745,760,763,781,865,894,917,920,923,964,967,971,1038,1042],[377,378,327],"h1",{"id":379},"modbus-tcp-master-over-a-tcp-client",[381,382,383,384,388,389,391],"p",{},"You will find the project ",[385,386,387],"code",{},"Qenex_TcpClient_ModbusMaster_HoldingRegisters.qproj","\nin the ",[385,390,308],{}," folder next to QInsight.exe.",[393,394,396],"h2",{"id":395},"what-the-example-shows","What the example shows",[381,398,399,400,403,404,407,408,411,412,415,416,419,420,423,424,427,428,431],{},"QInsight acts here as a ",[401,402,330],"strong",{},": the ",[401,405,406],{},"TCP Client"," driver\nholds the connection to the slave device and the ",[401,409,410],{},"Modbus Master","\nprotocol in ",[385,413,414],{},"tcp"," mode periodically reads three holding-register items\nover it — two scalars (",[385,417,418],{},"EngTorque",", ",[385,421,422],{},"Torque",") and one 3×2 matrix\n(",[385,425,426],{},"Drivability","). Variables with direction ",[385,429,430],{},"readWrite"," can be written back\nto the slave from the controls.",[381,433,434,435,438],{},"The second topic is ",[401,436,437],{},"connection resilience",": the driver has TCP\nkeepalive and endless reconnection enabled, so a pulled cable or a slave\nrestart is survived without any operator action.",[393,440,442],{"id":441},"what-you-need","What you need",[444,445,446,458,473],"ul",{},[447,448,449,450,453,454,457],"li",{},"A ",[401,451,452],{},"Modbus TCP slave with unit id 2"," listening on port 502 — e.g.\n",[401,455,456],{},"pyModSlave"," in TCP mode with the unit address set to 2. It can run\non the same PC as QInsight or on a second PC in the network.",[447,459,460,461,464,465,468,469,472],{},"The driver in the project is set to ",[385,462,463],{},"ip=192.168.2.208",". ",[401,466,467],{},"Change it to\nyour slave's address"," (",[385,470,471],{},"127.0.0.1"," when it runs on the same PC) —\notherwise the driver stays Faulted and keeps trying to connect forever.",[447,474,475,478,479,482],{},[401,476,477],{},"Firewall:"," the connection is initiated by QInsight (the client), so\nthe rule belongs on the PC running the ",[401,480,481],{},"slave"," — it must allow\ninbound connections on port 502. No inbound rule is needed on the\nQInsight PC.",[393,484,486],{"id":485},"the-project","The project",[381,488,489,490,493,494,497,498,501],{},"In the configuration the project is named ",[401,491,492],{},"Modbus TCP Master",". Its\ndescription mentions a slave at ",[385,495,496],{},"127.0.0.1:502"," and a 500 ms period —\nthe actual values in the settings are ",[385,499,500],{},"192.168.2.208"," and 1000 ms (see\nbelow).",[503,504,506],"h3",{"id":505},"drivers-and-protocols","Drivers and protocols",[381,508,509,510,468,513,516],{},"The ",[401,511,512],{},"TCP Client Driver",[385,514,515],{},"TcpClientDriver","):",[518,519,520,536],"table",{},[521,522,523],"thead",{},[524,525,526,530,533],"tr",{},[527,528,529],"th",{},"Parameter",[527,531,532],{},"Value",[527,534,535],{},"Meaning",[537,538,539,552,565,578,591,606],"tbody",{},[524,540,541,547,549],{},[542,543,544],"td",{},[385,545,546],{},"ip",[542,548,500],{},[542,550,551],{},"slave address — change it to match your network",[524,553,554,559,562],{},[542,555,556],{},[385,557,558],{},"port",[542,560,561],{},"502",[542,563,564],{},"the standard Modbus TCP port",[524,566,567,572,575],{},[542,568,569],{},[385,570,571],{},"connectionTimeoutMs",[542,573,574],{},"5000",[542,576,577],{},"how long to wait for the connection to be established",[524,579,580,585,588],{},[542,581,582],{},[385,583,584],{},"reconnectDelayMs",[542,586,587],{},"1000",[542,589,590],{},"pause between two reconnect attempts",[524,592,593,598,601],{},[542,594,595],{},[385,596,597],{},"reconnectAttempts",[542,599,600],{},"-1",[542,602,603,605],{},[385,604,600],{}," = retry forever, the driver never stops on its own",[524,607,608,613,615],{},[542,609,610],{},[385,611,612],{},"keepAliveMs",[542,614,574],{},[542,616,617],{},"after 5 s of silence the OS probes the connection — a dead cable is detected within seconds",[381,619,620,621,623,624,629],{},"Modbus TCP sends nothing between polls, so a quiet line by itself is not\na fault; it is ",[385,622,612],{}," that makes a pulled cable or a vanished slave\nshow up within seconds instead of after the tens of seconds of the plain\nTCP timeout. Details in ",[625,626,628],"a",{"href":627},"\u002Freference\u002Fdrivers#reconnection","Reconnection",".",[381,631,632,633,636,637,516],{},"Under the driver runs the ",[401,634,635],{},"Modbus Master (RTU\u002FTCP)"," protocol\n(",[385,638,639],{},"ModbusMasterProtocol",[518,641,642,652],{},[521,643,644],{},[524,645,646,648,650],{},[527,647,529],{},[527,649,532],{},[527,651,535],{},[537,653,654,666,679,691],{},[524,655,656,661,663],{},[542,657,658],{},[385,659,660],{},"mode",[542,662,414],{},[542,664,665],{},"MBAP framing — matches the TCP Client driver",[524,667,668,673,676],{},[542,669,670],{},[385,671,672],{},"unitId",[542,674,675],{},"2",[542,677,678],{},"slave address the master addresses",[524,680,681,686,688],{},[542,682,683],{},[385,684,685],{},"requestTimeoutMs",[542,687,587],{},[542,689,690],{},"response timeout per request",[524,692,693,698,700],{},[542,694,695],{},[385,696,697],{},"requestRetries",[542,699,675],{},[542,701,702],{},"two retries on top of the first attempt (up to 3 transmissions)",[381,704,705,706,468,709,712,713,715,716,718,719,722,723,726,727,730,731,468,734,737,738,741],{},"The project also contains two drivers unrelated to Modbus: ",[401,707,708],{},"File data\nlogger",[385,710,711],{},"FileDataLoggerDriver",", enabled — on every run it records\n",[385,714,418],{}," and ",[385,717,422],{}," into the ",[385,720,721],{},"DataLogs"," folder, ",[385,724,725],{},"append=true",",\n",[385,728,729],{},"reorderBufferMs=500",") and ",[401,732,733],{},"File data replay",[385,735,736],{},"FileDataReplayDriver",",\ndisabled — it points to ",[385,739,740],{},"DataLogs\\values.qilog","). Neither is needed for\nthe Modbus demonstration itself; disable the logger if you do not want\nthe recordings.",[503,743,104],{"id":744},"events",[381,746,747,748,751,752,755,756,759],{},"A single periodic event ",[385,749,750],{},"Pool500ms"," with a period of ",[401,753,754],{},"1000 ms",". Despite\nits name the master therefore polls once per second; all three variables\nreference it in ",[385,757,758],{},"eventRef",". Every polled variable is read by its own\nrequest, so three FC03 requests go out per cycle.",[503,761,81],{"id":762},"variables",[381,764,765,766,769,770,773,774,777,778,780],{},"All three variables live in the ",[385,767,768],{},"\u002FModbus"," namespace, type ",[385,771,772],{},"ushort","\n(1 register per value), ",[385,775,776],{},"wordOrder=\"big\"",", event ",[385,779,750],{},":",[518,782,783,805],{},[521,784,785],{},[524,786,787,790,793,796,799,802],{},[527,788,789],{},"Variable",[527,791,792],{},"Type",[527,794,795],{},"Holding register",[527,797,798],{},"Direction",[527,800,801],{},"Event",[527,803,804],{},"Presentation \u002F unit",[537,806,807,826,845],{},[524,808,809,814,816,819,821,823],{},[542,810,811,813],{},[385,812,418],{}," (Engine torque)",[542,815,772],{},[542,817,818],{},"0",[542,820,430],{},[542,822,750],{},[542,824,825],{},"ModbusSImple, ×0.01, Nm",[524,827,828,833,835,838,841,843],{},[542,829,830,832],{},[385,831,422],{}," (Torque)",[542,834,772],{},[542,836,837],{},"1",[542,839,840],{},"read",[542,842,750],{},[542,844,825],{},[524,846,847,852,855,858,860,862],{},[542,848,849,851],{},[385,850,426],{}," (Drivability)",[542,853,854],{},"matrix ushort, big endian",[542,856,857],{},"2–12 (11 registers)",[542,859,430],{},[542,861,750],{},[542,863,864],{},"ModbusSImple on axes and data",[381,866,509,867,869,870,873,874,877,878,881,882,885,886,889,890,629],{},[385,868,426],{}," matrix has an X axis ",[385,871,872],{},"Speed [RPM]"," (3 points), a Y axis\n",[385,875,876],{},"Temp. [K]"," (2 points) and 6 data cells; in memory the block is laid out\n",[401,879,880],{},"X axis → Y axis → data"," (22 B), which the master transfers as a\ncontiguous range of 11 registers starting at address 2 — one FC03 read,\nand on write only the changed cells are sent. ",[385,883,884],{},"wordOrder"," does not apply\nto a matrix; the byte order follows its Endianness (",[385,887,888],{},"be","). See\n",[625,891,893],{"href":892},"\u002Freference\u002Fprotocols#matrix-variables","Matrix variables",[381,895,896,897,900,901,904,905,908,909,912,913,916],{},"The single presentation ",[401,898,899],{},"ModbusSImple"," (range 0–65535, format\n",[385,902,903],{},"{0:F3}",", unit Nm) uses a linear conversion named ",[401,906,907],{},"Pass-through"," which,\nhowever, has ",[385,910,911],{},"multiplier=0.01"," — the engineering value is raw\u002F100.\nRegister value 1234 is shown as ",[385,914,915],{},"12.340 Nm","; on write the entered\nengineering value is multiplied by one hundred and 1234 goes into the\nregister. Both matrix axes share the same presentation (including the\nunit Nm).",[503,918,116],{"id":919},"workspace",[381,921,922],{},"The single workspace contains:",[444,924,925,936,946,954],{},[447,926,449,927,929,930,932,933,935],{},[401,928,135],{}," at the top — ",[385,931,418],{}," (red, left axis) and ",[385,934,422],{},"\n(blue, right axis), 10 s time window, both axes auto-scaled.",[447,937,938,939,941,942,715,944,629],{},"Two ",[401,940,150],{}," controls for ",[385,943,418],{},[385,945,422],{},[447,947,449,948,950,951,953],{},[401,949,160],{}," on ",[385,952,426],{}," — Write on Enter on, write mode\noff.",[447,955,449,956,958,959,715,961,963],{},[401,957,155],{}," with the rows ",[385,960,422],{},[385,962,418],{},", columns Name,\nValue, Unit, Time, Write and Read (no row is in write mode).",[381,965,966],{},"All controls refresh their display every 250 ms.",[393,968,970],{"id":969},"what-you-will-see-and-what-to-try","What you will see and what to try",[444,972,973,979,1014,1028],{},[447,974,975,978],{},[401,976,977],{},"Values every cycle."," Once the runtime starts, both scalars and the\nmatrix update once per second; the graph draws two traces following\nwhatever the slave holds in registers 0 and 1. In pyModSlave just\noverwrite the register values and the change arrives with the next\npoll.",[447,980,981,984,985,988,989,991,992,995,996,998,999,1002,1003,1005,1006,1009,1010,1013],{},[401,982,983],{},"Writing to the readWrite registers."," In the Watch Table tick\n",[401,986,987],{},"Write"," on the ",[385,990,418],{}," row, enter an engineering value (e.g.\n",[385,993,994],{},"12.34",") and send it with the row's ",[401,997,987],{}," button (or with Enter\nwhen ",[401,1000,1001],{},"Write on Enter"," is on in the table's context menu) — 1234 is\nwritten to register 0. The table shows the written value with the next\nread of the register. The box is not active for ",[385,1004,422],{},"\n(",[385,1007,1008],{},"direction=\"read\"","). In the Matrix\ncontrol switch on ",[401,1011,1012],{},"Write Mode"," in the context menu and edit the data\ncells and the axis breakpoints; with Write on Enter each cell is sent\nright after Enter as a write of just the affected register in the\nrange 2–12.",[447,1015,1016,1019,1020,1023,1024,1027],{},[401,1017,1018],{},"Pull the network cable"," (or stop the slave). Within seconds the\nkeepalive detects the dead connection, the driver goes Faulted and the\nlog shows ",[385,1021,1022],{},"… failed (attempt N): … Reconnecting in 1000 ms."," Thanks to\n",[385,1025,1026],{},"reconnectAttempts=-1"," it retries forever (after three attempts it logs\nonly once per minute). The master pauses polling meanwhile. Plug the\ncable back in and the connection is re-established and polling resumes\non its own — no runtime restart.",[447,1029,1030,1031,1033,1034,629],{},"If the driver does not connect at all, check ",[385,1032,546],{},", unit id 2 in the\nslave and the firewall on the slave PC — see\n",[625,1035,1037],{"href":1036},"\u002Freference\u002Ftroubleshooting#the-device-does-not-connect","The device does not connect",[393,1039,1041],{"id":1040},"related-chapters","Related chapters",[444,1043,1044,1053,1059,1065,1077],{},[447,1045,1046,1049,1050,1052],{},[625,1047,406],{"href":1048},"\u002Freference\u002Fdrivers#tcp-client"," and\n",[625,1051,628],{"href":627}," — driver parameters,\nkeepalive and outage behaviour.",[447,1054,1055,1058],{},[625,1056,635],{"href":1057},"\u002Freference\u002Fprotocols#modbus-master-rtutcp","\n— protocol settings and per-variable Comm params.",[447,1060,1061,1064],{},[625,1062,102],{"href":1063},"\u002Fvariables\u002Fmatrix-variable"," — block layout and\nassignment to the Modbus Master.",[447,1066,1067,726,1070,1073,1074,629],{},[625,1068,118],{"href":1069},"\u002Fvisualization\u002Fwrite-to-device",[625,1071,155],{"href":1072},"\u002Fvisualization\u002Fwatch-table-control","\nand ",[625,1075,160],{"href":1076},"\u002Fvisualization\u002Fmatrix-control",[447,1078,1079,1082],{},[625,1080,181],{"href":1081},"\u002Flogging-and-replay\u002Flogging-data"," — what the bundled\nFile data logger does.",{"title":1084,"searchDepth":1085,"depth":1085,"links":1086},"",3,[1087,1089,1090,1096,1097],{"id":395,"depth":1088,"text":396},2,{"id":441,"depth":1088,"text":442},{"id":485,"depth":1088,"text":486,"children":1091},[1092,1093,1094,1095],{"id":505,"depth":1085,"text":506},{"id":744,"depth":1085,"text":104},{"id":762,"depth":1085,"text":81},{"id":919,"depth":1085,"text":116},{"id":969,"depth":1088,"text":970},{"id":1040,"depth":1088,"text":1041},"A complete project with the TCP Client driver and the Modbus Master protocol — QInsight periodically reads the holding registers of a Modbus TCP slave, writes to them from controls and reconnects on its own after a pulled cable.","md",{},true,{"title":327,"description":1098},"c1FmpPoOKrmt-1e4izBay8IFsh80JZM17jI9bPfutzc",[1105,1106],{"title":322,"path":323,"stem":324,"navTitle":325,"children":-1},{"title":332,"path":333,"stem":334,"navTitle":332,"children":-1},1795105299701]