06-29-2009 03:19 AM
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
06-29-2009 09:12 AM
Have you started by looking at the NI modbus library? http://sine.ni.com/nips/cds/view/p/lang/en/nid/201711
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.
06-29-2009 11:15 PM
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
06-30-2009 02:35 AM
http://forums.ni.com/ni/board/message?board.id=170&message.id=417824&requireLogin=False
hope this helps
06-30-2009 02:50 AM
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.
06-30-2009 04:38 AM
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
06-30-2009 05:44 AM
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.
06-30-2009 06:02 AM