2021/05/14 Reference No.”TS-UX-004-TG” ver.1.0 Ultrasonic Flow   meter for Fuel Gas Management UX/UZ(Bore 25s and 32,40,50) Modbus RTU Communication Specifications

1
Overview
This communication specifications applies to "External power supply   type (24VDC)" and "External power supply type (100VAC)" of the Ultrasonic Flow Meter UX/UZ for fuel gas management. Since this document only describes the communication procedures, refer to the operation manual of the ultrasonic flow meter for fuel gas management (hereinafter referred to as "the flow meter") for instructions of operations, etc., other than communication, The flow meter has the communication interface which equips the asynchronous serial bus interface conforming to EIA-485. This interface enables to connect up to 31 flow meters to build a networked system. Modbus RTU Protocol is used as the communication protocol, so that measurement data and internal information of each flow meter can be acquired by sending commands to each flow meter.
2
Prior to Use
2.1 Connection With reference to the operation manual of the flow meter, connect it to the upper-level communication device.
Meter)
2.2 Setting of Items Related to Communications (Flow
For the setting procedures of 2.2.1 through 2.2.4, refer to "Operation manual 8-1. Details of setting items". 2.2.1   Setting of the Flow Meter's RTU Address Set the RTU address with Item No. F14, using the setting buttons on the display portion of the flow meter. When connecting multiple flowmeters, be sure to use a unique RTU address for each of them. Available addresses: 001 to 247 * "000" cannot be used. 2.2.2   Setting a Communication Bit Rate of the Flow Meter Select a communication bit rate with Item No. F13, using the setting buttons on the display portion of the flow meter.
2.3
Setting Items Related to Communications (Higher-level Communication
Device)
Match its communication bit rate with the setting of the flow meter. * Set the data length to "8 bits", stop bit to "1 bit", and parity to "None."
3
Communication Specifications and Communication Timing

Refer to the next section for the communication timing.
3.2 Communication Timing
The response time, standby time, and communication interval vary depending on the baud rate and contents of a query from the higher-level communication device. Thus, refer to the table below <Response Time and Standby Time> and the figure below <Communication Timing Diagram>.
[Case where one device is connected] Higher-level communication device Query to flow   meter Flow  meter A
Prepare to receive a response within the above-described time (the minimum value of ①) after (1): sending a query to the flow    meter. Prepare time-out time to be longer than the above-described time (the maximum value of  ①) after (2): sending a query to the flow    meter. In case the flow    meter is only the one connected to the master communication device, after (3): receiving a response from the flow    meter, send the next query to the same flow    meter after the above-described time (②) passes. In case multiple meters are connected to the master communication device, after receiving a (4): response from any of them, send the next query after the above-described time (③) passes. <Notes on programming> Provide some margins for the times mentioned above for safety when programing the master (1): communication device. If a response from the flow    meter cannot be received correctly after the master communication (2): device has sent a query, it is recommended to resend the query.
4
Message Frame Configuration

<RTU address> * Silent communication time for 3.5 characters or more “1” - “247” (01H - F7H) can be set for the flow    meter. The default is "1" (01H). When a message from the master communication device is received, only the flow meter with the matching RTU address returns a response. * Broadcast communication is not supported. <Function code> Each code specifies a function that the flow meter is commanded to perform.

<Data>
Data used to perform a function code. Configuration of this data section varies depending on the function code. Refer to "7. Data Specifications" for details. <Error check code> This code is intended to detect an error (bit change) in a message in the signal transmission process. The checking method is based on the CRC method. For details, refer to "9 Calculation of Error Check Code(CRC-16)". When the flow meter receives a message, it calculates a CRC value based on the received message, and compares it with the sent CRC value. If the two values do not match, the flowmeter determines that an error has occurred. In the case of a message to be transmitted by the flowmeter, the flowmeter calculates a CRC value based on the message to be transmitted, and transmits the message with the CRC value added to the end of the message.
5
Function Code
5.1 [Function code 03] Reading of parameters and flow meter information The function code 03H reads parameters, and flow   meter information. The function code and data portions, which are described in "4 Message Frame Configuration," are shown below.
Function code: 03H Start address: Register address (0100H to 0119H) and (0200H to 020EH) Number of registers:  Number of data to be read out (0001H to 001AH) Note that the maximum number of reading data depends on register addresses.
Number of data bytes:  Number of bytes in response data Data: Read out data Example) A case where [Address 0101H] Output pulse constant (0001H : 10L/P,) and [Address 0102H] Alarm output contact state (0000H : normal open) are read out.

5.2 [Function code 05] Integration value upper limit alarm clear
Function code 05H is intended for a command to clear an integration value upper limit alarm of the flow meter. An alarm state occurs when an integration value per hour exceeds a set upper limit. The function code and data portions, which are described in "4 Message Frame Configuration," are shown below.
Function code:   05H Start address: 0300H (Fixed) Changed data:   000H (Fixed)
Start address: 0300H (Fixed) Changed data:   000H (Fixed)
5.3 [Function code 06] Single parameter write
Function code : 06H is intended to make a change (perform a write) to contents of a parameter. Shown below are parts of the function code and the data in "4 Message Frame Configuration".
Function code: 06H Start address: Register address（0100H to 0119H） Changed data:   Arbitrary (For the range of changed data that may be set, refer to "7.2.1 Various Types of Parameters).
Function code: Start address: Changed data: 06H Same as the start address in a query Same as the changed data in a query Example) A case where [Address 0100H] Conversion reference temperature is changed to 35°C (0x0023).

5.4 [Function code 10] Multiple parameter writes
Function code: 10H is an intended to change (write) contents of a plurality of consecutive parameters. Shown below are parts of the function code and data in "4 Message Frame Configuration".
Start address: Register address (0100H to 0119H) Number of registers: Number of data to be written (0001H to 001AH) Number of data bytes:  Number of bytes of data to be written Arbitrary (For the range of changed data that may be set, refer to "7.2.1 Changed data: Various Types of Parameters).
Same as the start address in the query Same as the number of registers in the query
Example) A case of changing [Address 010FH] Actual flow   conversion    select to Yes (0x0001)

5.5 Communication-related Item
When a single write or a multiple write to a item / items related to the communications (RTU address, communication bit rate) is performed,the flow meter responds thereto with parameters before the change has been made. For subsequent communications, the flowmeter operates with the changed set value.
Subsequently, the flow meter operates with the RTU address = 02

6
Communication Error
6.1 List of Communication Errors

6.2
Error Response
Listed below are parts of the function code and data in "4 Message Frame Configuration". In the case of an error response, the function code is an error function code. The error function code is a code to the highest-order bit of which 1 is set.
Example) If you set 0006H for the gas species select: You receive a response with the error code 03H for the invalid data, because the set data 0006H is a value out of the range.
Set 1 to the highest-order bit of 06H
6.3 Processing of Invalid Data
If invalid data is detected in a single write, no write is performed. If invalid data is detected in certain data in a multiple write, no values after the invalid data is detected are set. However, values before the invalid data is detected are set. For example, if you write [Addresses 0100H to 0102H] multiple times: Example 1) Conversion reference temperature:   0014H (20°C Normal data) Output pulse constant: 0005H (Invalid data) Alarm output contact state: 000H (Normal open Normal data) As shown above, when the second data of the three pieces of set data is the invalid data, the first conversion reference temperature is set. However, because the second output pulse constant is the invalid data, the output pulse constant and the alarm output contact state are not set. A response with the error code 03H for invalid data is returned. Example 2) Conversion reference temperature:   003FH (63°C Invalid data) 0001H (10L/P Normal data) Output pulse constant: 000H (Normal open Normal data) Alarm output contact state: As shown above, when the first data of the three setting data is the invalid data, neither of the three data is set. The response returned is the error code 03H for invalid data.
Data Specifications
7
7.1   Address and Data
Data is arranged as shown below:
*Use of the area for system is not allowed.
7.2 List of Data
7.2.1   Various Types of Parameters
You can set various types of parameters and acquire internal information. Therefore, you can use the following function codes.
*1Model: Only the type wiht pressure sensor can be accepted. *2Model: Only the type wihtout pressure sensor can be accepted. UX[Bore]-[Pressure][Power Supply]-[Flow Direction]-[Gas Type] Class UZ[Bore]-[Pressure][Power Supply]-[Flow Direction]-[Gas Type] [Pressure]=0 : Type wihtout pressure sensor [Pressure]=100 or 500 : Type wiht pressure sensor

7.2.2   Details of Various Types of Parameters
1. [Address 0100H] Conversion reference temperature This item is to set a designated temperature [°C] that is used as a reference at the time of conversion. Setting is possible in the increment of 1°C, in the range of -10 to +60°C (FFF6H to 003CH). To set the parameter, treat it as date with sign (+/-). The conversion temperature is valid only when selecting “Yes (Normal or standard flow rate)" for [Address 010FH] Actual flow conversion selection. When “No (Actual flow rate)” is selected for Actual flow rate conversion selection, a conversion reference temperature can be changed, but the change is not reflected in the flow rate conversion. This is only valid in the Type wiht pressure sensor. The setting and read-out cannot be performed with the Type wihtout pressure sensor.
2. [Address 0101H] Output Pulse Constant
The parameter is to select weight "10L/P(0001H)", "100L/P(0002H)", "1000L/P(0003H)", or “10000L/P(0004H)”. You cannot set the parameter depending on a combination of a class, and [Address 010FH] Actual flow   conversion    select. For details, refer to the table below.
Cannot select
3. [Address 0102H] Alarm output contact state
The parameter is to select "Normal open (0000H)" or"Normal close (0001H)". If you use a battery-driven pulse receiver, use Normal open. 4. [Address 0103H, 0104H] Alarm output upper limit The parameter is to set an alarm output upper limit of the flow rate upper/lower limit alarm. When you set this parameter, set a 10x value. With 4byte data, setting is possible in the range of 10x values 0000000H to 0001869FH of 0 to 999.9[m³/h]. An address is assigned to each of upper 2 bytes and lower 2 bytes. [Address 0103H]: Alarm output upper limit (Upper) [Address 0104H]: Alarm output upper limit (Lower) You can set upper level only or lower level only. Note, however, that a settable range is determined as the 4byte data. Example) Upper 000H, Lower 9876H→Alarm output upper limit=00009876H→3903.0[m³/h] If you try to change only the upper bytes to 0001H, setting is not allowed due to out of setting range. Alarm output upper limit=00019876H→10456.6[m3/b]≥9999.9[m3/b]
5. [Address 0105H, 0106H] Alarm output lower limit
The parameter is to set an alarm output lower limit of the flow rate upper/lower limit alarm. Details are similar to [Address 0103H, 0104H] Alarm output upper limit. 6. [Address 0107H, 0108H] Alarm output hysteresis width For a flow rate value set in the alarm output upper limit and lower limit, set an alarm output hysteresis width as a flow rate width for stopping the alarm. Details are similar to   [Address 0103H, 0104H]    Alarm output upper limit. 7. [Address 0109H] Instantaneous flow moving average times The parameter is to refer to a moving average times of instantaneous flow measurement results. You can select once (No average)(0x0001) to 16 times (0x0010). The instantaneous flow rate measured most recently is displayed/outputted as an average value of the selected moving average times. 8. [Address 010AH, 010BH] Analog output full-scale flow rate The parameter is to set a full-scale flow rate value of analog output. Setting is enabled when you select “Instantaneous flow rate”for [Address 010CH] Analog output switching. It is FS flow rate corresponding to setting of [Address 010FH] Actual flow   conversion select. When you set this parameter, set a 10x value. Details are similar to [Address 0103H, 0104H] Alarm output upper limit. 9. [Address 010CH] Analog output switching The item is to select the function assignment of analog output from “Flow rate (0000H)”, "Temperature (0001H)", or "Pressure (0002H)". When you select the instantaneous flow, set a relative value of the instantaneous flow rate selected for [Address 010FH] Actual flow   conversion    select.
The option “Pressure” is only valid for the type wiht pressure sensor. You cannot set the parameter in the Type wihtout pressure sensor.
10. [Address 010DH] Communication bit rate
The parameter is to set the communication bit rate “4800bps (0000H)””9600bps(0001H)”.
11. [Address 010EH] RTU Address
The parameter is to set an RTU address of the flow   meter. A range of setting of an RTU address is from 001 to 247（0001H to 00F7H）. The parameter is to set a Actual flow rate, normal conversion flow rate, and standard conversion flow rate for the flow rate conversion. With settings of the flow rate conversion select and the conversion reference temperature, you can select a Actual flow rate, normal conversion flow rate, and standard conversion flow rate.
12. [Address 010FH] Flow rate conversion select

When you select "with" conversion, "Normal" or "Standard" display above the partition line turns on. The integrated flow rate/instantaneous flow rate display/output signal correspond to the conversion flow rate together. When you select "without" conversion, "Normal" or "Standard" display above the partition line turns off. The integrated flow rate/instantaneous flow rate display/output signal correspond to the Actual flow rate together. Be careful because if you set the flow rate conversion select (in a case where you access the internal address 010FH of the flow rate conversion by means of the function code 06 or 10 even if you do not change the setting),a pulse constant automatically switches to the setting of 1000[L/P]. Example: A case where you switch to Conversion from No conversion Pulse constant 10L/P, No conversion ↓ Select Conversion. Pulse constant 1000L/P, normal flow rate or standard flow rate 13. [Address 0110H] Used gas pressure set value  (gage) When you set this parameter, set a 100x value. With 2byte data, setting is possible in the following ranges: UX: UZ: 100x value within 0 to 100.00[kPa] 0000H to 2710H 100x value within 0 to 500.00[kPa] 0000H to C350H This is only valid in the type wiht pressure sensor. You cannot perform setting or read-out in the type wiht pressure sensor. 14. [Address 011H] Test mode time select The parameter is to select a valid period of the test mode, "3 minutes (0000H)", "60 minutes (0001H", or “Unlimited (0002H)”. The test mode is designed to simply perform sensing of any piping leak by temporarily cancelling the low flow cut-off. For details, refer to "4 - 2. Measuring Microflow Rate (Test Mode)" in the instruction manual.
15. [Address 0112H] Conversion reference pressure  (gage)
The item is to set a specified pressure that serves as a reference at the time of conversion. When you set this parameter, set a 100x value. Setting is possible in in the range of 0.01 kPa, in the range of 100x values 0x0000 to 0x03E8 of 0.00 to 10.00kPa. The conversion reference pressure is valid only when you select “Yes (Normal or standard flow rate)" for [Address 010FH] Actual flow   conversion   select. When you select “No (Actual flow rate) " for Actual flow   conversion    select, you may change a conversion reference pressure, but the change is not reflected in the flow rate conversion. 16. [Address 0113H, 0114H] Integration value upper limit alarm threshold The parameter is to set an integration value upper limit alarm threshold. When you set this parameter, set a 100x value. With 4byte data, setting is possible in the range of 100x values 0000000H to 000F423FH of 0 to 9999.99[m3/h]. An address is assigned to each of upper 2 bytes and lower 2 bytes. [Address 0113H]: Integration value upper limit alarm threshold (Upper) [Address 0114H]: Integration value upper limit alarm threshold (Lower) You can set upper level only or lower level only. Note, however, that a settable range is determined as the 4byte data. Example) Upper 0005H, Lower 9876H→Integration value upper limit alarm threshold=00059876H→3667.10[m3/h] If you try to change only the upper bytes to 000FH, setting is not allowed due to out of setting range. Alarm output upper limit=000F9876H→10220.70[m3/h]>9999.99[m3/h]
17. [Address 0115H] Alarm output select
The item is to set function assignment of contact output to “Flow rate upper and lower limit alarm（000H）”or “Integration value upper limit alarm (0001H)”. 18. [Address 0116H] Gas species select The parameter is to set “13A (000H)”, “Propane (0001H)”, “Butane (0002H)”, “Nitrogen (0003H)”, “Air (0004H)”, or “Argon (0005H)”. Since the specified gas species is set at the time of factory shipment, you do not have to change it. In addition, "Air"in the choices is intended for maintenance, no use with "Air" is allowed,
19. [Address 0117H] Low flow cut-off flow rate
The parameter is to set a low flow cut-off value (Qcut) with the instantaneous flow rate being 0m³/h. When you set this parameter, set a 100x value. For example, when you set 1.0[m³/h], set 1.0×100=100(dec)→0064(hex). Then, -0.9 to +0.9[m³/h] will be 0[m³/h]. Setting is possible in the range of 0≤Qœr≤Qmin. Qmin varies depending on a model. Refer to the table below.
The set flow rate will be the flow rate selected for [Address 010FH] Actual flow conversion select. 20. [Address 0118H] Atmospheric pressure in usage environment The item is set an absolute pressure for the atmospheric pressure in usage environment. Use the set value when calculating the conversion flow rate. When you set this parameter, set a 10x value. For example, if you set 101.3 [kPa], set 101.3×10=1013(dec)→03F5(hex). The parameter is set to 101.3[kPa] at the time of factory shipment. If you use the factory default at a location with a high altitude, an error occurs during calculation of the conversion flow rate. Thus, set an appropriate atmospheric value. The table below shows a relation of the altitude, atmospheric pressure, and an extreme error. (Not that the following table is for reference and the values vary depending on the environmental conditions.)

21. [Address 0119H] Pressure moving average select
The parameter is to select “Yes (0001H)” or “No (0000H)” for averaging of pressure values. When “Yes” is selected, a moving average of the most recently measured pressure values for 10 times is taken, and displayed/outputted. This is only valid in the type wiht pressure sensor. You cannot perform setting or read-out in the Type wihtout pressure sensor.
22. [Address 011AH] With or without pressure zero-cut
Select "With zero-cut(on)"or"Without zero-cut(OFF)"for zero-cut of pressure value.If "With zero-cut(on)"is selected,in selected,in the case that the measured pressure value is 5[kPa]or less,the pressure value is indicated and outputted as 0[kPa].In the case the setting of “pressure value averaging” is “With averaging”,zero-cut judgment is to be done based on the pressure value of moving aveage after such averaging.
7.2.3 Flow meter information, Clearing
For the flow    meter information, internal information can be acquired. Therefore, the following function code can be used.
1. [Address 0200H, 0201H] Instantaneous flow rate The item is the instantaneous flow rate corresponding to [Address 010FH] Actual flow conversion    select. For signed 4-byte data, the flow    meter responds with a 100x value of an actual value. Each of the upper 2 bytes and lower 2 bytes of the 4-byte data can be read out separately. (Example) Case of the instantaneous flow rate 123.45[m³/h] (123.45×100=12345(dec)→00003039(hex)) - Read-out data for the upper2 bytes: 0000H - Read-out data for the lower 2 bytes: 3039H - Read-out data for the 4 bytes: 00003039H 2. [Address 0202H] Pressure [kPa] - Type wihtout pressure sensor:    This is [Address 0110H] Used gas pressure set value (gage). For unsigned 2-byte data, the flow   meter responds with a 100x value. (Example) Case of pressure 3.00[kPa] (3.00×100=300(dec)→012C(hex)) - Read-out data: 012CH - Type wiht pressure sensor: This is a measured pressure value. For unsigned 2-byte data, the flow   meter responds with a 10x value of the actual value. (Example) Case of pressure 123.4[kPa] (123.4×10=1234(dec)→04D2(hex)) - Read-out data: 04D2H 3. [Address 0203H] Temperature [°C] For signed 2-byte data, the flow    meter responds with a 10x value of the actual value. (Example) Case of temperature-9.4[°C] (-9.4×10=-94(dec)→ FFA2 (hex)) - Rad-out data: FFA2H 4. [Addresses 0204H, 0205H, 0206H] Positive integration value ① 6-byte data [Addresses 0207H, 0208H, 0209H] Trip integration value ① 6-byte data These are the integration flow rates corresponding to [Address 010FH] Actual flow conversion select. For unsigned 6-byte data, the flow meter responds with a 1 to 100x value of the actual value. Each of the upper 2 bytes, middle 2 bytes, and lower 2 bytes of the 6-byte data can be read out separately. Since a multiple varies depending on [Address 010FH] Actual flow   conversion    select, refer to the table below.
In addition, even if respective integration value displays overflow, true integration values are read out as the read-out values. *The underlined italic parts are displayed values.
5. [Address 020AH] Error information
meter. The item is to read out a state of the flow For 2-byte data, each bit represents the following error information. In the case of abnormality, the bit is 1, and in the case of no abnormality or in the case of no use, the bit is 0. 6. [Address 020BH, 020CH] Positive integration value  ② 4-byte data [Address 020DH, 020EH] Trip integration value  ② 4-byte data - Type wihtout pressure sensor: This is the integration flow rate value of the Actual flow rate. - Type wiht pressure sensor: This is the integration flow rate corresponding to [Address 010FH] Actual flow   conversion    select. In the case of unsigned 4-byte data, the flow   meter responds with a ¦ﾆﾆﾆto 100x value, for the part enclosed by the dot-line in the table below. 1) Type wihtout pressure sensor, Type wiht pressure sensor: "No flow rate conversion" is
2) Type wiht pressure sensor: "Flow rate conversion" is selected.
Each of the upper 2 bytes and lower 2 bytes of the 4-byte data can be read out separately. Since the multiple varies depending on [Address 010FH] Flow rate conversion select, refer to the above example. 7. [Address 0300H] Integration value upper limit alarm clear The item is to clear the integration value upper limit alarm. For set data, only a clear command by 0000H is accepted.
*1 Refer to the following: Class

9

9.1 Overview
The Modbus RTU protocol includes an error check code based on the CRC method in each message. The error check code consists of 16 bits, is calculated by the transmitting side, and is added to the message. The receiving side recalculates a CRC based on the received message and compares the result of the calculation with the actually received error check code. If the two values do not match, it is determined that an error has occurred. CRC calculation is performed, starting with the RTU address at the head of the message to the tail end of the data. For the calculation, only 8 bits of each characters are used, and start and stop, and parity bit are not applied to the CRC. When the error check code is added to the message, the lower byte of the calculation result is added first, followed by the upper byte.

9.2 Calculation Procedure
① Initializes the CRC code to “FFFH.” ②  Calculates an exclusive OR (XOR) with the lower 1 byte of the CRC code and the first character of the message, and store it in the CRC code. ③ Proceeds to  ④ if the least significant bit of the CRC code is "1." Proceeds to  ⑤ if the least significant bit of the CRC code is “0.” ④  Shift the CRC code to the right by 1 bit. Then, calculates exclusive OR with the generating polynomial A001H and store it in the CRC code.→Proceed to 《》. ⑤ Shift the CRC code to the right by 1 bit.→Proceed to  ⑥. ⑥ Repeat steps  ③→④ or  ⑤ until the CRC code is shifted by 8 bits. ⑦ Repeat steps ② to ⑥ similarly for the second and subsequent characters, and apply to all characters in the calculation range. ⑧ A value that finally remains in the CRC code is the error check code. <Calculation Example> When a message is 01 03 02 01 09 (hex), the CRC code is to be D279H. Since the lower bytes of the calculation result is first added, the transmission data is to be 01 03 02 01 09 79 D2.
[Details]
The following figure illustrates contents of the calculation of the first and second characters (01 and 03):
When the third to fifth characters are calculated in a similar manner, the CRC code will be D279H.