LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus RTU serial communication error

Solved!
Go to solution

Hello Everyone,

 

I am facing an issue while communicating with a system using Modbus RTU protocol.

 

This system (master) sends 5 set of fixed queries one by one. No access to the master (pre-existing)software.

I have created Modbus slave response to this system as per the protocol in LabVIEW.

 

There are 3 such identical systems, out of which I was successful in communicating with one system but facing error in other two.

My device is connected to this system via Serial to RS485 converter.

 

I could read the queries sent by the master which is exact as defined

1) 01 03 00 00 00 51 84 36 H

2) 01 03 00 51 00 51 D5 E7 H

 and so on.

 

But the response I send to the queries is not reflecting on the Master.( The same which is working with one of the system).

The software in all the three systems are  identical as informed.

 

If there is any issue in the signal connectivity then I should have not received the queries.

 

Stuck!!

 

Can anyone suggest if I am missing anything?

 

Attaching Screen shot of my slave response

Nectar_techabhi_0-1682574755755.png

 

 

 

Thanks in Advance.

 

0 Kudos
Message 1 of 8
(4,239 Views)

@Nectar_techabhi wrote:

Hello Everyone,

 

I am facing an issue while communicating with a system using Modbus RTU protocol.

 

This system (master) sends 5 set of fixed queries one by one. No access to the master (pre-existing)software.

I have created Modbus slave response to this system as per the protocol in LabVIEW.

 

There are 3 such identical systems, out of which I was successful in communicating with one system but facing error in other two.

My device is connected to this system via Serial to RS485 converter.

 

I could read the queries sent by the master which is exact as defined

1) 01 03 00 00 00 51 84 36 H

2) 01 03 00 51 00 51 D5 E7 H

 and so on.

 

But the response I send to the queries is not reflecting on the Master.( The same which is working with one of the system).

The software in all the three systems are  identical as informed.

 

If there is any issue in the signal connectivity then I should have not received the queries.

 

Stuck!!

 

Can anyone suggest if I am missing anything?

 

Attaching Screen shot of my slave response

Nectar_techabhi_0-1682574755755.png

 

 

 

Thanks in Advance.

 


You have three different machines running similar Master Software and Your Slave Module running?

Have you tried available NI Examples to check whether it works fine, Also Compare the Installed Software in all three Machines.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 8
(4,212 Views)

@PalanivelThiruvenkadam wrote:

@Nectar_techabhi wrote:

Hello Everyone,

 

I am facing an issue while communicating with a system using Modbus RTU protocol.

 

This system (master) sends 5 set of fixed queries one by one. No access to the master (pre-existing)software.

I have created Modbus slave response to this system as per the protocol in LabVIEW.

 

There are 3 such identical systems, out of which I was successful in communicating with one system but facing error in other two.

My device is connected to this system via Serial to RS485 converter.

 

I could read the queries sent by the master which is exact as defined

1) 01 03 00 00 00 51 84 36 H

2) 01 03 00 51 00 51 D5 E7 H

 and so on.

 

But the response I send to the queries is not reflecting on the Master.( The same which is working with one of the system).

The software in all the three systems are  identical as informed.

 

If there is any issue in the signal connectivity then I should have not received the queries.

 

Stuck!!

 

Can anyone suggest if I am missing anything?

 

Attaching Screen shot of my slave response

Nectar_techabhi_0-1682574755755.png

 

 

 

Thanks in Advance.

 


You have three different machines running similar Master Software and Your Slave Module running?

Have you tried available NI Examples to check whether it works fine, Also Compare the Installed Software in all three Machines.


Thank you for your prompt response.

 

Yes three different machines have similar master software running as informed by the proprietor.

Unfortunately, cannot check much at the Master software side. Please suggest

 

The slave response I have attached is working fine on one of the three system.

I have checked  NI Examples and my slave response is working with MB Serial Example Master.vi.

 

I have also tried using termination resistor of 120ohm.

 

Please let me know if anything that I could verify further.

 

0 Kudos
Message 3 of 8
(4,157 Views)

Any Hardware's Involved here? Do you have any Programming Manual available for Master Program?

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 8
(4,149 Views)

To clarify, you have three separate systems, each with one master and one slave. NOT three masters and one slave?

 

Also baud and the id can usually be changed pretty easily on the master. Can you at least verify that all the masters are 9600 and trying to read from ID 1?

0 Kudos
Message 5 of 8
(4,135 Views)

 


@PalanivelThiruvenkadam wrote:

Any Hardware's Involved here? Do you have any Programming Manual available for Master Program?


The hardware involved is a serial interface card as shown below 

Nectar_techabhi_0-1683087121144.png

The remote terminal unit basically converts the RS485 signals and Ethernet and is connected to Master.

The serial interface card has jumper settings for half duplex and full duplex RS485 and also for termination resistor.

I had doubted the serial interface module, but confused because receiving query from master. If there was issue in hardware i think there should not be any query. Correct me if I am wrong?

 

I have received a communication protocol for interfacing with master. It has format of master query and for slave response.

I can not share the entire document but will sharing the communication settings and master query and slave response format.

 

Baud rate: 9600 bps
Parity: No parity
Data bits: 8
Stop Bit: 1
Offset in Holding Register Address : -1
Turn around time: 100 mSec

 

Master query for reading data of transmit groups

Command

to Read

data of

Slave

Address

Function code

MODBUS

Start

Address Hi

MODBUS

Start

Address Lo

No of

Registers

to read Hi

No of

Registers

to read Lo

CRC

Lo

CRC

Hi

Transmit

Group-G1

01H

03H

00H

00H

00H

51H

84H

36H

Transmit

Group-G2

01H

03H

00H

51H

00H

51H

D5H

E7H

Transmit

Group-G3

01H

03H

00H

A2H

00H

51H

25H

D4H

Transmit

Group-G4

01H

03H

00H

F3H

00H

51H

74H

05H

Transmit

Group-G5

01H

03H

01H

44H

00H

51H

C5H

DFH

 

Slave response format :

Response format for First tank group G1

Slave Address

1 Byte (Hex)

01H

Function Code

1 Byte(Hex)

03H

Byte Count

1 Byte(Hex)

A2H

Data-1 Hi

Higher Byte (Hex)

00H

Data-1 Lo

Lower Byte (Hex)

00H

Data-2 Hi

Higher Byte (Hex)

01H

Data-2 Lo

Lower Byte (Dec)

12

Data-3 Hi

Higher Byte (Dec)

01

Data-3 Lo

Lower Byte (Hex)

02H

Data-4 Hi

Higher Byte (Hex)

00H

Data-4 Lo

Lower Byte (Hex)

32H

Data-5 Hi

Higher Byte (Hex)

00H

Data-5 Lo

Lower Byte (Hex)

00H

Data-6 Hi

Higher Byte (Hex)

20H

Data-6 Lo

Lower Byte (Hex)

5DH

--

Data of 2nd UNIT

--

--

--

--

--

Data of 16th UNIT

--

Data-77 Hi

Higher Byte (Hex)

10H

Data-77 Lo

Lower Byte (Dec)

12

Data-78 Hi

Higher Byte (Dec)

16

Data-78 Lo

Lower Byte (Hex)

02H

Data-79 Hi

Higher Byte (Hex)

00H

Data-79 Lo

Lower Byte (Hex)

32H

Data-80 Hi

Higher Byte (Hex)

00H

Data-80 Lo

Lower Byte (Hex)

00H

Data-81 Hi

Higher Byte (Hex)

4CH

Data-81 Lo

Lower Byte (Hex)

59H

CRC Lo

Lower Byte (Hex)

As calculated

CRC Hi

Higher Byte (Hex)

As calculated

 

Looking forward to your reply.

 

 

0 Kudos
Message 6 of 8
(4,106 Views)

@StevenD wrote:

To clarify, you have three separate systems, each with one master and one slave. NOT three masters and one slave?

 

Yes I have three separate identical systems, each with one master and one slave.

 

Also baud and the id can usually be changed pretty easily on the master. Can you at least verify that all the masters are 9600 and trying to read from ID 1?


Baud rate is 9600 and ID is 1 confirmed.

0 Kudos
Message 7 of 8
(4,103 Views)
Solution
Accepted by topic author Nectar_techabhi

I think that's a pretty strong case for "not a software problem"

 

Check cables.

0 Kudos
Message 8 of 8
(4,077 Views)