{"id":3600,"date":"2026-10-26T09:00:00","date_gmt":"2026-10-26T01:00:00","guid":{"rendered":"https:\/\/cnbygele.com\/?p=3600"},"modified":"2026-10-25T19:09:35","modified_gmt":"2026-10-25T11:09:35","slug":"power-meter-modbus-byte-order","status":"publish","type":"post","link":"https:\/\/cnbygele.com\/fr\/blog\/power-meter-modbus-byte-order\/","title":{"rendered":"Ordre des octets Modbus d\u2019un compteur \u00e9lectrique : d\u00e9coder les registres sans erreur de mise \u00e0 l\u2019\u00e9chelle"},"content":{"rendered":"<p>Power meter Modbus byte order determines how received bytes become a usable measurement. Start with the exact meter register map, identify the data type and register count, then distinguish the byte sequence inside each register from the order of multiple registers. Decode a saved response before applying engineering units or CT scaling. A valid communication reply can still produce an incorrect value when these steps are mixed together. Verify the result against a documented reference at more than one operating point, and retain the original bytes so that another engineer can reproduce the interpretation.<\/p>\n<p>This guide addresses decoding after communication has been established. For addresses, serial settings and the first successful read, begin with the <a href=\"https:\/\/cnbygele.com\/blog\/power-meter-modbus-communication-setup\/\">power meter Modbus setup guide<\/a>. Examples below are synthetic protocol examples, not BY194 register addresses or claimed product functions.<\/p>\n<h2>Establish the model-specific decoding contract<\/h2>\n<p>Obtain the instrument&#8217;s complete order code, communication option, applicable register-map revision and firmware information where available. A familiar front panel does not establish whether a particular instrument supports communications or whether its map matches another model. The <a href=\"https:\/\/cnbygele.com\/product\/by194-series-multifunctional-power-instruments\/\">CNBYG BY194 series<\/a> is the relevant product family; request documentation for the supplied configuration before integrating it.<\/p>\n<p>For every required quantity, record the supported function, documented address, number of registers, representation, byte and word sequence, engineering unit, scale and sign convention. Also record whether the transmitted value is already adjusted to primary quantities. These fields form one decoding contract. Treating the address alone as sufficient leaves several independent opportunities for a plausible but wrong reading.<\/p>\n<p>Separate source documentation from the software setting used to implement it. A driver option called little endian may refer to an entire four-byte item, while another application uses the same label for exchanging two sixteen-bit words. Retain a concrete byte example alongside the option name so the configuration remains understandable after a software upgrade.<\/p>\n<h2>Separate register byte order from word order<\/h2>\n<p>The <a href=\"https:\/\/www.modbus.org\/file\/secure\/modbusprotocolspecification.pdf\" rel=\"noopener nofollow\" target=\"_blank\">Modbus application protocol specification<\/a> describes big-endian representation for addresses and data items: the most significant byte of a multibyte item is transmitted first. A holding or input register contains sixteen bits. That protocol rule should not be confused with a universal definition of how a manufacturer maps a thirty-two-bit floating-point measurement across two registers.<\/p>\n<p>A manufacturer can document the more significant sixteen-bit word first or last for a multi-register value. The client must follow that mapping. Registers can also contain scaled integers, bit fields or other documented representations. Two adjacent registers are not automatically an IEEE floating-point number, even when interpreting them that way produces a number within an expected range.<\/p>\n<p>Serial bit transmission is another layer. The order in which a serial controller sends bits within a character does not tell an application to reverse register bytes. Let the communication stack handle framing. The decoding task begins with the validated response data and the manufacturer&#8217;s mapping, rather than a visual guess about electrical waveforms.<\/p>\n<p><figure><img decoding=\"async\" alt=\"Disconnected CNBYG BY194 reference instrument beside communication decoding review materials \u2014 inspection\" class=\"wp-image-3598\" height=\"1024\" loading=\"lazy\" src=\"https:\/\/cnbygele.com\/wp-content\/uploads\/2026\/10\/power-meter-modbus-byte-order-inspection-20261025.png\" style=\"max-width:100%;height:auto\" width=\"1536\" srcset=\"https:\/\/cnbygele.com\/wp-content\/uploads\/2026\/10\/power-meter-modbus-byte-order-inspection-20261025.png 1536w, https:\/\/cnbygele.com\/wp-content\/uploads\/2026\/10\/power-meter-modbus-byte-order-inspection-20261025-300x200.png 300w, https:\/\/cnbygele.com\/wp-content\/uploads\/2026\/10\/power-meter-modbus-byte-order-inspection-20261025-1024x683.png 1024w, https:\/\/cnbygele.com\/wp-content\/uploads\/2026\/10\/power-meter-modbus-byte-order-inspection-20261025-768x512.png 768w, https:\/\/cnbygele.com\/wp-content\/uploads\/2026\/10\/power-meter-modbus-byte-order-inspection-20261025-18x12.png 18w, https:\/\/cnbygele.com\/wp-content\/uploads\/2026\/10\/power-meter-modbus-byte-order-inspection-20261025-600x400.png 600w\" sizes=\"auto, (max-width: 1536px) 100vw, 1536px\" \/><figcaption>Product-reference illustration of the disconnected BY194 exterior beside communication decoding review materials. The image does not establish a fitted communication option, terminal assignments, register representation or response speed.<\/figcaption><\/figure>\n<\/p>\n<h2>Use an unambiguous four-byte example<\/h2>\n<p>For a synthetic IEEE 754 binary32 value of 1.0, the usual big-endian byte representation is hexadecimal 3F 80 00 00. Label those bytes A, B, C and D respectively. The labels identify positions in this example; they are not Modbus address labels or a promise about any instrument&#8217;s map.<\/p>\n<div style=\"overflow-x:auto;max-width:100%\">\n<table style=\"border-collapse:collapse;width:100%;min-width:560px\">\n<thead>\n<tr>\n<th style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">Example sequence<\/th>\n<th style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">Bytes presented to a decoder<\/th>\n<th style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">Interpretation to verify<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">ABCD<\/td>\n<td style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">3F 80 00 00<\/td>\n<td style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">Original big-endian binary32 representation<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">CDAB<\/td>\n<td style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">00 00 3F 80<\/td>\n<td style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">Two sixteen-bit words exchanged<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">BADC<\/td>\n<td style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">80 3F 00 00<\/td>\n<td style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">Bytes exchanged within each word<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">DCBA<\/td>\n<td style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">00 00 80 3F<\/td>\n<td style=\"border:1px solid #d1d5db;padding:10px;text-align:left;vertical-align:top\">Entire four-byte sequence reversed<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>The table illustrates transformations, not four equally valid settings for a meter. The approved map determines which transformation, if any, is required. The <a href=\"https:\/\/docs.python.org\/3\/library\/struct.html\" rel=\"noopener nofollow\" target=\"_blank\">Python struct documentation<\/a> provides an independent reference for explicit byte order and binary data formats. A decoder must specify the intended format instead of relying on the computer&#8217;s native memory layout.<\/p>\n<p>A zero measurement makes a poor first test because several permutations of zero bytes remain zero. Choose a stable nonzero documented measurement where possible, then verify a second value with different bytes. Do not deliberately change live electrical conditions simply to create a convenient test value; use approved operating observations, a documented simulator or an authorized test arrangement.<\/p>\n<h2>Decode in a controlled order<\/h2>\n<p>First confirm the requested function and address convention. An offset error can return the wrong neighboring registers while the response remains valid. Establish whether the software expects a protocol offset or a human-readable reference. Record both the manual&#8217;s notation and the actual request so that an unexplained plus-one correction does not spread through the tag list.<\/p>\n<p>Next verify the response length and extract only the bytes belonging to the intended quantity. Preserve the complete frame separately for diagnostics, but exclude device address, function, byte count and error-check fields from the numeric payload. Confirm the required register count rather than padding a short response or silently discarding unexpected data.<\/p>\n<p>Apply the documented register sequence and representation. Only after the numeric decoding is correct should the configured engineering scale and unit conversion be applied. Finally, evaluate whether the measurement is primary-scaled. Keeping these operations separate makes a mismatch traceable to a specific decision instead of hiding several compensating errors inside one multiplier.<\/p>\n<h2>Distinguish ordering faults from scaling faults<\/h2>\n<p>A consistently incorrect factor can indicate a unit conversion or primary-ratio problem, but it does not prove one. Some byte permutations happen to produce reasonable values over a limited operating range. Diagnose against raw evidence rather than assuming that every enormous number is endianness or every small error is calibration.<\/p>\n<p>For a value that is unstable, intermittently extreme or not a finite number, examine representation, register boundaries and snapshot consistency. If the map does not promise an atomic read across the selected registers, ask how coherent multi-register values should be obtained. Reading adjacent registers in one request reduces unnecessary transactions but does not, by itself, prove the device&#8217;s internal update behavior.<\/p>\n<p>For a constant ratio error, review units and the <a href=\"https:\/\/cnbygele.com\/blog\/power-meter-voltage-transformer-ratio\/\">voltage-transformer ratio guide<\/a>. Review the <a href=\"https:\/\/cnbygele.com\/blog\/ct-selection-multifunction-power-meter\/\">CT selection and measurement-chain guide<\/a> before applying another current multiplier. Correctly decoded bytes cannot compensate for an incorrect sensor ratio or phase assignment in the physical installation.<\/p>\n<h2>Handle signed integers, flags and exceptional values<\/h2>\n<p>A sixteen-bit register can represent an unsigned integer, a signed integer or a set of status bits. The same bit pattern has different meanings under those interpretations. Use the manufacturer&#8217;s definition rather than inferring the type from whether the present value happens to be positive. Directional power and energy registers require particular care because sign can carry operational meaning.<\/p>\n<p>Confirm how unavailable or invalid measurements are represented. A documented sentinel, status flag or exceptional floating-point value should become an explicit quality condition in the receiving system. Replacing it silently with zero makes an instrumentation problem appear to be a genuine absence of load, which can mislead energy reporting and troubleshooting.<\/p>\n<p>Keep cumulative counters separate from instantaneous measurements. Their width, unit, reset behavior and rollover rules can differ from the neighboring power registers. The <a href=\"https:\/\/cnbygele.com\/blog\/power-meter-energy-counter-rollover\/\">energy-counter rollover guide<\/a> explains continuity checks after decoding has been established. A rollover correction should never be used to conceal an unresolved interpretation error.<\/p>\n<h2>Retain evidence through gateways and software changes<\/h2>\n<p>A gateway may decode a serial register and publish an engineering value, or it may relay registers without changing them. Determine which behavior applies before configuring a second decoder downstream. An unnecessary swap in both layers can appear to fix the value while leaving a fragile configuration that breaks when either layer changes.<\/p>\n<p>Save a commissioning record containing the device identity, map revision, raw request and response, observed local display, timestamp, decoded intermediate value, final engineering value and quality state. Include the exact driver version and conversion settings. This record is more useful than a screenshot of a correct-looking dashboard because it explains how that dashboard value was obtained.<\/p>\n<p><figure><img decoding=\"async\" alt=\"Disconnected CNBYG BY194 reference instrument beside communication decoding review materials \u2014 records\" class=\"wp-image-3599\" height=\"1024\" loading=\"lazy\" src=\"https:\/\/cnbygele.com\/wp-content\/uploads\/2026\/10\/power-meter-modbus-byte-order-records-20261025.png\" style=\"max-width:100%;height:auto\" width=\"1536\" srcset=\"https:\/\/cnbygele.com\/wp-content\/uploads\/2026\/10\/power-meter-modbus-byte-order-records-20261025.png 1536w, https:\/\/cnbygele.com\/wp-content\/uploads\/2026\/10\/power-meter-modbus-byte-order-records-20261025-300x200.png 300w, https:\/\/cnbygele.com\/wp-content\/uploads\/2026\/10\/power-meter-modbus-byte-order-records-20261025-1024x683.png 1024w, https:\/\/cnbygele.com\/wp-content\/uploads\/2026\/10\/power-meter-modbus-byte-order-records-20261025-768x512.png 768w, https:\/\/cnbygele.com\/wp-content\/uploads\/2026\/10\/power-meter-modbus-byte-order-records-20261025-18x12.png 18w, https:\/\/cnbygele.com\/wp-content\/uploads\/2026\/10\/power-meter-modbus-byte-order-records-20261025-600x400.png 600w\" sizes=\"auto, (max-width: 1536px) 100vw, 1536px\" \/><figcaption>Product-reference illustration of the disconnected BY194 exterior beside communication decoding review materials. The image does not establish a fitted communication option, terminal assignments, register representation or response speed.<\/figcaption><\/figure>\n<\/p>\n<p>After a firmware, gateway or driver change, replay approved saved examples offline where possible and compare live observations through an authorized procedure. Test at least one nonzero value, any required signed quantity, a documented invalid condition and representative counter data. The checks should target the actual representations in use rather than every theoretically possible byte permutation.<\/p>\n<h2>Specify a reproducible acceptance test<\/h2>\n<p>Define acceptance around documented measurements and project tolerances. Do not invent a universal percentage difference between display and supervisory values: update timing, display rounding and instrument specifications affect the comparison. Record whether the observations were simultaneous enough to support the conclusion, especially when the load changes quickly.<\/p>\n<p>Keep the initial verification read-only. Decoder troubleshooting does not authorize writes to instrument settings, protection functions or calibration data. If a configuration change becomes necessary, obtain the applicable procedure, preserve the previous settings and verify the result separately from the communication test.<\/p>\n<p>The engineering handover should state which layer owns each transformation. For example, the driver may assemble the documented words, a tag definition may convert watts to kilowatts, and the meter may already apply the CT ratio. Named ownership prevents a later integrator from adding another correction because a setting appears to be missing in their own layer.<\/p>\n<h2>Further learning: what endianness means<\/h2>\n<p>Computerphile&#8217;s lesson explains how byte significance and memory ordering relate. It supports the decoding concepts above, while the exact meter map remains the authority for register representation. The video does not establish any BY194 register address or default.<\/p>\n<div style=\"position:relative;padding-bottom:56.25%;height:0;overflow:hidden\"><iframe allowfullscreen=\"\" loading=\"lazy\" src=\"https:\/\/www.youtube-nocookie.com\/embed\/NcaiHcBvDR4\" style=\"position:absolute;top:0;left:0;width:100%;height:100%;border:0\" title=\"Endianness Explained With an Egg - Computerphile\"><\/iframe><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=NcaiHcBvDR4\" rel=\"noopener nofollow\" target=\"_blank\">Watch the educational lesson<\/a><\/p>\n<h2>Frequently asked questions<\/h2>\n<h3>Does Modbus big-endian mean every two-register float has the same word order?<\/h3>\n<p>No. The protocol&#8217;s byte representation does not replace the manufacturer&#8217;s definition of a multi-register measurement. Verify the documented data type and word sequence for the exact map.<\/p>\n<h3>Can I try swap settings until the number looks reasonable?<\/h3>\n<p>Use saved responses to investigate, but accept a setting only when it matches the map and independent observations. A plausible number at one operating point is insufficient evidence.<\/p>\n<h3>Should I swap bytes again after a gateway publishes an engineering value?<\/h3>\n<p>Determine what the gateway already does. If it has decoded the value, another byte transformation is generally a configuration error rather than a necessary second stage.<\/p>\n<h3>Does correct byte order prove the meter measurement is accurate?<\/h3>\n<p>No. It verifies one part of data interpretation. Sensor configuration, wiring, units, scaling, measurement conditions and instrument performance still require their own checks.<\/p>\n<p><script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"Does Modbus big-endian mean every two-register float has the same word order?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No. The protocol's byte representation does not replace the manufacturer's definition of a multi-register measurement. Verify the documented data type and word sequence for the exact map.\"}}, {\"@type\": \"Question\", \"name\": \"Can I try swap settings until the number looks reasonable?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Use saved responses to investigate, but accept a setting only when it matches the map and independent observations. A plausible number at one operating point is insufficient evidence.\"}}, {\"@type\": \"Question\", \"name\": \"Should I swap bytes again after a gateway publishes an engineering value?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Determine what the gateway already does. If it has decoded the value, another byte transformation is generally a configuration error rather than a necessary second stage.\"}}, {\"@type\": \"Question\", \"name\": \"Does correct byte order prove the meter measurement is accurate?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No. It verifies one part of data interpretation. Sensor configuration, wiring, units, scaling, measurement conditions and instrument performance still require their own checks.\"}}]}<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>D\u00e9codez les registres Modbus des compteurs \u00e9lectriques en distinguant l\u2019ordre des octets, l\u2019ordre des mots, le format de repr\u00e9sentation et la mise \u00e0 l\u2019\u00e9chelle, \u00e0 l\u2019aide d\u2019exemples de v\u00e9rification reproductibles.<\/p>","protected":false},"author":4,"featured_media":3597,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_gspb_post_css":"","footnotes":""},"categories":[1],"tags":[231],"class_list":["post-3600","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-power-factor-correction"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"acf":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cnbygele.com\/fr\/wp-json\/wp\/v2\/posts\/3600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cnbygele.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cnbygele.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cnbygele.com\/fr\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/cnbygele.com\/fr\/wp-json\/wp\/v2\/comments?post=3600"}],"version-history":[{"count":1,"href":"https:\/\/cnbygele.com\/fr\/wp-json\/wp\/v2\/posts\/3600\/revisions"}],"predecessor-version":[{"id":3601,"href":"https:\/\/cnbygele.com\/fr\/wp-json\/wp\/v2\/posts\/3600\/revisions\/3601"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cnbygele.com\/fr\/wp-json\/wp\/v2\/media\/3597"}],"wp:attachment":[{"href":"https:\/\/cnbygele.com\/fr\/wp-json\/wp\/v2\/media?parent=3600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cnbygele.com\/fr\/wp-json\/wp\/v2\/categories?post=3600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cnbygele.com\/fr\/wp-json\/wp\/v2\/tags?post=3600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}