取消
显示结果 
搜索替代 
您的意思是: 

Query format in MODBUS RTU PROTOCOL

Hii

 

Pl send me

 

1. query format for Modbus RTU Protocol with ODD Parity.

 

2. If query goes to instrument using ODD Parity then how to do Error Checking? should it be based on Parity bit checking or based on CRC bits ckecking?

 

vijtin

 

 

 

 

0 项奖励
1 条消息(共 8 条)
5,516 次查看

Have you started by looking at the NI modbus library?  https://forums.ni.com/t5/Reference-Design-Content/LabVIEW-Modbus-API/ta-p/3524019

 

Odd/Even parity is set up by the serial port.  It checks to make sure a single bit hasn't been corrupted in the byte.  If this happens (which is very rare), you'll get something like a framing error or parity error returned by the serial port.

 

CRC checking is handled by the Modbus library.  It checks to make sure one or more bytes haven't been corrupted in the entire message stream.  If this happens, the library functions will return an error.

 

Either way, there isn't much you have to worry about there as a programmer.

 

You may also want to check out these links.

 

http://zone.ni.com/devzone/cda/epd/p/id/6153 

http://www.modbus.org/tech.php

0 项奖励
2 条消息(共 8 条)
5,498 次查看

Hii

Thanx for support but I have idea regarding error checking methods using Parity or CRC.

 

I want to know only query format in Modbus RTU protocol while sending Parity Bit (either odd or even).

 

With Parity None my query format is...

 

01 03 0001 0002 C40B

 

Where 01 is address of device

            03 is readcommand

            0001 is starting location

            0002 is length of data which i want to read

         & C40B is CRC

 

 

Same as above example what will be the query format with Parity EVEN or ODD?

 

 

 

Plz help me.....

 

 

vijtin

0 项奖励
3 条消息(共 8 条)
5,489 次查看

http://forums.ni.com/ni/board/message?board.id=170&message.id=417824&requireLogin=False

 

hope this helps

.......^___________________^
....../ '---_BOT ____________ ]
...../_==O;;;;;;;;_______.:/
.....),---.(_(____)/.....
....// (..) ),----/....
...//____//......
..//____//......
.//____//......
..-------
0 项奖励
4 条消息(共 8 条)
5,480 次查看

What Ravens Fans said is that the parity bit is managed by the serial port hardware, so the query format is exactly the same for no parity, odd or even.

What changes is how the message is sent through the wire (which is not up to you); however, if you switch the parity bit on, you may get parity errors during read operation.

Of course, the instrument should also support the same parity settings.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 项奖励
5 条消息(共 8 条)
5,477 次查看

Hii Paolo,

 

Thanx for reply.

but still i am not cleared......

 

My Labview software is Master, it will send query with parity bit to device & my device will work as an Slave during communication.

 

So my question is How my device will come to know whether query comming from Labview software is with ODD Parity or EVEN Parity?

 

vijtin

0 项奖励
6 条消息(共 8 条)
5,471 次查看

Well, I'm confused enough. In my opinion, your question would be relevant if:

a) you are programming the device too

b) you are not using an UART to receive the serial communication, but rather trying to interpret the input bit-per-bit

 

If the device is using an UART, this chip must be setup in advance with the correct parity management, either EVEN or ODD or NONE. As far as I know, UARTs have no auto-set capability.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 项奖励
7 条消息(共 8 条)
5,463 次查看
If you do not tell it what is the parity your device will not know, you need to use visa serial port, or a MB serial init to link it to the MB serial master query and there you can set the parity. At least this is what i think.
0 项奖励
8 条消息(共 8 条)
5,460 次查看