LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus libraries for LabView 8.0

How are you converting from your RS232 serial port to RS485??
0 Kudos
Message 51 of 81
(2,417 Views)
I am using an ADAM-4520 converter.
 
Peder
0 Kudos
Message 52 of 81
(2,402 Views)

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

0 Kudos
Message 53 of 81
(2,399 Views)
I am pretty sure it does, but I will double check.
 
Peder
0 Kudos
Message 54 of 81
(2,398 Views)

It was set to 10 bit, but is now corrected to 9 bit. I'll try some more testing.

Peder

0 Kudos
Message 55 of 81
(2,394 Views)

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

0 Kudos
Message 56 of 81
(2,378 Views)
I think modbus normally uses 9600,8,E,1. Should not matter but you never know. Try using portmon to capture the data stream and post the hex values that it captures in both directions. We should be able to decode the hex data.

Message Edited by unclebump on 05-10-2007 09:09 AM

0 Kudos
Message 57 of 81
(2,367 Views)

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

 

0 Kudos
Message 58 of 81
(2,363 Views)

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.

0 Kudos
Message 59 of 81
(2,355 Views)


@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

=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 60 of 81
(2,348 Views)