0% found this document useful (0 votes)
32 views9 pages

How To Use ModbusTCP Client To Query Raw Data From WISE-2460 Through WISE-4051 Over ModbusTCP

This document provides a guide on how to query raw data from the WISE-2460 device using both Modbus/RTU and Modbus/TCP protocols. It details the steps required for each method, including the necessary commands and addresses to trigger data collection and confirm readiness. The document also includes examples of request and response data for both querying methods.

Uploaded by

javalitetimoso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views9 pages

How To Use ModbusTCP Client To Query Raw Data From WISE-2460 Through WISE-4051 Over ModbusTCP

This document provides a guide on how to query raw data from the WISE-2460 device using both Modbus/RTU and Modbus/TCP protocols. It details the steps required for each method, including the necessary commands and addresses to trigger data collection and confirm readiness. The document also includes examples of request and response data for both querying methods.

Uploaded by

javalitetimoso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Advantech AE Technical Share Document

Date 2024/3/12 SR#


Category ■FAQ □SOP Related OS N/A
How to use Modbus/TCP client to query raw data from WISE-2460 through
Abstract
WISE-4051 over Modbus/TCP?
Keyword WISE-2460、raw Data
Related Product WISE-2460、WISE-4051
◼ Problem Description:

WISE-2460 supports user to export Acceleration raw data. User can query WISE-2460 through
Modbus/RTU. It also supports using Modbus/TCP client to query raw data from WISE-2460
through WISE-4051 over Modbus/TCP.

This document divides into 2 sections:


Section 1. Method1: How to use Modbus/RTU client to query raw data from WISE-2460 through
Modbus/RTU?
Section 2. Method2: How to use Modbus/TCP client to query raw data from WISE-2460 through
WISE-4051 over Modbus/TCP?

1
◼ Solution:

Section 1. Method1: How to use Modbus/RTU client to query raw data from WISE-2460

through Modbus/RTU?

This section will introduce how to use Modbus/RTU client to query raw data from WISE-2460

through Modbus/RTU. The topology is illustrated in Figure1 (a). A Modbus/RTU Client transmits a

raw data request command to the WISE-2460 device. The WISE-2460 then responds the raw data

back to Modbus/RTU Client.

Write Modbus coil address


0x0002 to 1 to start collect raw
data

Waiting for raw data ready by


polling Modbus coil address
0x0001 until the value is 1

Continue to query file number 1


to get raw data by Modbus file
transfer command (0x14) until
matching total size of raw data

(a) Topology (b) The steps of querying raw data

Figure 1 Query WISE-2460 raw data through Modbus/RTU

The steps of querying WISE-2460 raw data through Modbus/RTU shows in Figure 1 (b) and the

detailed explanation of each step will be provided below.

Step 1. Trigger WISE-2460 for accessing raw data of vibration.

User needs to write Modbus coil address 0x0002 to 1 to start collect raw data. In this step,

WISE-2460 collects the vibration raw data first, the raw data contains 32768 samples of Z-axis

2
32-bit raw data. In other words, the total data length is 65536 records (or “words”). Then,

WISE-2460 firmware will save these data into file number 1 which can be queried by user for

querying raw data.

[Notice] WISE-2460 triggers raw data recording only once when the Modbus coil address 0x0002

is set to 1. This recorded data remains unchanged unless the Modbus coil address 0x0002 is

triggered again.

Step 2. Confirm the raw data had been prepared and can be queried by another device.

User needs to read Modbus coil address 0x0001, which indicates the Raw data ready status, to

confirm whether the raw data are ready.

⚫ The value of Modbus coil address 0x0001 = 0: WISE-2460 raw data are not ready.

⚫ The value of Modbus coil address 0x0001 = 1: WISE-2460 raw data are ready, user can start to

query raw data.

Step 3. Query the raw data by sending Modbus/RTU command.

When the value of Modbus coil address 0x0001 turns to 1, user can start to query the raw data from

WISE-2460. WISE-2460 allow user to use the Modbus Function Code 20 (0x14): Read File

Record to query raw data. Here is the information about this function code below.

1. Server ID: The WISE-2460 Device ID. In this case, set to “0x01”.

2. Function Code: 1 byte, in this case, set to “0x14” for using “Read File Record” function.

3. Byte Count: 1 byte, the total combined count of bytes in all Sub-Req and not included CRC.

4. Reference Type: 1 byte, in this case, it must be specified as “0x06”.

5. File number: 2 bytes, in this case, it must be set to “0x0001” for querying raw data from file

number 1.

3
6. Record Number: 2 bytes, the starting record number within the file.

7. Record Length: 2 bytes, it defines the maximum amount of data transferred in a single

Modbus/RTU request. In this case, set to “0x7C”.

The raw data contains a total of 65,536 records. However, each request can retrieve a

maximum of 0x7C (124 records) due to the length limitation of each request. Consequently,

users must send multiple requests to query the entire dataset.

8. CRC Check: Calculate the Modbus/RTU CRC and swap to Little-Endian format.

Take the first Modbus/RTU request as example, the CRC Calculate of 0x01 0x14 0x07 0x06

0x00 0x01 0x00 0x00 0x00 0x7C is 0x05 0xC5. Swap to Little-Endian format will be 0xC5

0x05.

Modbus/RTU CRC Calculator: https://www.lammertbies.nl/comm/info/crc-calculation

◆ Modbus/RTU Request Command List


Request Server Byte Ref. File Record Record CRC
Function
# ID Count Type NO. Number Length Check
1 0x01 0x14 0x07 0x06 0x0001 0x0000 0x007C 0xC505
2 0x0001 0x007C 0x007C

81 0x26C0 0x007C
82 0x273C 0x007C

528 0xFF44 0x007C
529 0xFFC0 0x0040

4
◆ Modbus/RTU Response Data List
Request Server Byte Resp. Ref. CRC
Function Record Data
# ID Count length Type Check
1 0x01 0x14 0xF9 0xF8 0x06 … 0x----
2 0x01 0x14 0xF9 0xF8 0x06 … 0x----

81 0x01 0x14 0xF9 0xF8 0x06 … 0x----
82 0x01 0x14 0xF9 0xF8 0x06 … 0x----

528 0x01 0x14 0xF9 0xF8 0x06 … 0x----
529 0x01 0x14 0x81 0x80 0x06 … 0x----

✓ Result

Here is the result for sending the first request for querying the raw data through Modbus/RTU.

➢ Request Command

Request Server Byte Ref. File Record Record CRC


Function
# ID Count Type NO. Number Length Check
1 0x01 0x14 0x07 0x06 0x0001 0x0000 0x007C 0xC505

➢ Get the response data from WISE-2460.

Figure 2. Result of using Modbus/RTU client to query raw data from WISE-2460

5
Section 2. Method2: How to use Modbus/TCP client to query raw data from WISE-2460

through WISE-4051 over Modbus/TCP?

This section will introduce how to use Modbus/TCP client to query raw data from WISE-2460

through WISE-4051 over Modbus/TCP. The topology is illustrated in Figure 2 (a).

⚫ Modbus/TCP Client sends a raw data request to WISE-4051 (via TCP/IP).

⚫ WISE-4051 interprets the request and translates it into Modbus/RTU format.

⚫ WISE-4051 sends the Modbus/RTU request to WISE-2460.

⚫ WISE-2460 processes the request and sends a raw data response back to WISE-4051 (via

Modbus/RTU).

⚫ WISE-4051 receives the response, translates it back to the original format, and sends it back to

the Modbus/TCP Client (via TCP/IP).

[Notice] Currently, WISE-4051 transparent transmission to retrieve Raw Data only supports

one WISE-2460 and its Modbus ID must be 0x01 only.

Write Modbus coil address


0x9902 to 1 to start collect raw
data

Waiting for raw data ready by


polling Modbus coil address
0x9901 until the value is 1

Continue to query file number 1


to get raw data by Modbus file
transfer command (0x14) until
matching total size of raw data

(a) Topology (b) The steps of querying raw data

Figure 3. Query raw data from WISE-2460 through WISE-4051 over Modbus/TCP

6
The steps of querying WISE-2460 raw data through WISE-4051 over Modbus/TCP shows in Figure

3 (b) and the detailed explanation of each step will be provided below. Be aware that the Modbus

addresses for Step 1 and Step 2 differ from Method 1.

Step 1. Trigger WISE-2460 for accessing raw data of vibration.

User needs to write Modbus coil address 0x9902 of WISE-4051 to 1 for asking WISE-2460 to

start collect raw data. In this step, WISE-2460 collects the vibration raw data first, the raw data

contains 32768 samples of Z-axis 32-bit raw data. In other words, the total data length is 65536

records (or “words”). Then, WISE-2460 firmware will save these data into file number 1 which can

be queried by user for getting raw data.

[Notice] WISE-2460 triggers raw data recording only once when the Modbus coil address 0x9902

of WISE-4051 is set to 1. This recorded data remains unchanged unless the Modbus coil address

0x9902 of WISE-4051 is triggered again.

Step 2. Confirm the raw data had been prepared and can be queried by another device.

User needs to read Modbus coil address 0x9901, which indicates the Raw data ready status, to

confirm whether the raw data are ready.

⚫ The value of Modbus coil address 0x9901 = 0: WISE-2460 raw data are not ready.

⚫ The value of Modbus coil address 0x9901 = 1: WISE-2460 raw data are ready, user can start to

query raw data.

Step 3. Query the raw data by sending Modbus/TCP command.

When the value of Modbus coil address 0x9901 of WISE-4051 turns to 1, user can start to query the

raw data from WISE-2460 through WISE-4051 over Modbus/TCP. WISE-2460 allow user to use

the Modbus Function Code 20 (0x14): Read File Record to query raw data. Here is the

7
information about this function code below.

1. Server ID: The WISE-2460 Device ID. In this case, set to “0x01”.

2. Function Code: 1 byte, in this case, set to “0x14” for using “Read File Record” function.

3. Byte Count: 1 byte, the total combined count of bytes in all Sub-Req and not included CRC.

4. Reference Type: 1 byte, in this case, it must be specified as “0x06”.

5. File number: 2 bytes, in this case, it must be set to “0x0001” for querying raw data from file

number 1.

6. Record Number: 2 bytes, the starting record number within the file.

7. Record Length: 2 bytes, it defines the maximum amount of data transferred in a single

Modbus/RTU request. In this case, set to “0x7C”.

◆ Modbus/TCP Request Command List


Request Transaction Protocol Server Byte Ref. File Record Record
Length Function
# ID ID ID Count Type NO. Number Length
1 0x000A 0x01 0x14 0x07 0x06 0x0001 0x0000 0x007C
2 0x0001 0x007C 0x007C

81 0x26C0 0x007C
82 0x273C 0x007C

528 0xFF44 0x007C
529 0xFFC0 0x0040

◆ Modbus/TCP Response Data List


Request Transaction Protocol Server Byte Resp. Ref.
Length Function Record Data
# ID ID ID Count length Type
1 0x01 0x14 0xF9 0xF8 0x06 …
2 0x01 0x14 0xF9 0xF8 0x06 …

81 0x01 0x14 0xF9 0xF8 0x06 …
82 0x01 0x14 0xF9 0xF8 0x06 …

528 0x01 0x14 0xF9 0xF8 0x06 …
529 0x01 0x14 0x81 0x80 0x06 …

8
✓ Result

Here is the result for sending the first request for querying the raw data through Modbus/RTU.

➢ Request Command
Request Transaction Protocol Server Byte Ref. File Record Record
Length Function
# ID ID ID Count Type NO. Number Length
1 0x0001 0x0000 0x000A 0x01 0x14 0x07 0x06 0x0001 0x0000 0x007C

➢ Get the response data from WISE-2460 through WISE-4051 over Modbus/TCP.

In this method, use the Modbus Poll software as Modbus/TCP Client.

(a) Topology (b) Result

Figure 4. Result of using Modbus/TCP client to query raw data from WISE-2460 through

WISE-4051 over Modbus/TCP

You might also like