05-09-2007 07:55 AM
05-09-2007 07:59 AM
05-09-2007 08:04 AM - edited 05-09-2007 08:04 AM
You might have to verify that this product supports modbus protocol. Modbus RTU mode uses a nine bit datastream, 8 data bits plus one parity bit. This caught me once using some broadband modems to transmit modbus info.
Here is one device.
http://www.bb-elec.com/product_family.asp?FamilyId=302&TrailType=Sub&Trail=9
Message Edited by unclebump on 05-09-2007 08:07 AM
05-09-2007 08:07 AM
05-09-2007 08:17 AM
It was set to 10 bit, but is now corrected to 9 bit. I'll try some more testing.
Peder
05-10-2007 07:59 AM
Hi again.
After correcting the number of bits I am getting some sort of contact.
The LED's on both ends blinks, but no matter how many registers or what adress I put in,
I receive the value C0F1. (I am now using MB read reg.vi found in this forum.)
Can anybody tell me what it means?
(The ports in both ends are set to 9600,8,n,2)
Peder
05-10-2007 09:08 AM - edited 05-10-2007 09:08 AM
Message Edited by unclebump on 05-10-2007 09:09 AM
05-10-2007 09:28 AM
Hi.
I am using the "MB read reg.vi" found on this forum (it worked for other people so it should for me too).
The input I set is slave adr: 1, First reg: 0x66 and # of regs:6 (or 10, or ...)
The received string is 018302c0f1. The vi reports 2 bytes received and the value is c0f1.
No error is reported.
I get the same string in return no matter what register value I put in.
(I am running the latest version of Labview.)
Peder
05-10-2007 10:55 AM
Something is still off in the timing, databits, or parity. When you send a modbus message to read holding registers to a device with address 01. The hex string should start 0103... The slave response should come back as 0103.... The 83 in the response data doesn't make sense to me.
05-10-2007 11:24 AM - edited 05-10-2007 11:24 AM
@unclebump wrote:
... The 83 in the response data doesn't make sense to me
I think Peder is getting a Modbus exception response.
<snip from some old Modbus Doc ... emphasis added>
Function Code Field: In a normal response, the server echoes the function code of the original request in the function code field of the response. All function codes have a most–significant bit (MSB) of 0 (their values are all below 80 hexadecimal). In an exception response, the server sets the MSB of the function code to 1. This makes the function code value in an exception response exactly 80 hexadecimal higher than the value would be for a normal response.
<edit>
... and the 02 would indicate that it is an Illegal Data Address.
"The data address received in the query is not an allowable address for the server (or slave). More specifically, the combination of reference number and transfer length is invalid".
Message Edited by Donald on 05-10-2007 12:28 PM