Modicon M221 connect with LXM32M with Modbus Rtu

Join Date
Apr 2015
Location
greece
Posts
19
Hello I am new in this forum and i don't now where i can start the question.I have the servo drive LXM32M and i want to connect with the plc Modicon M221 with Modbus Rtu.
 
Things they don't tell you in the manuals.

The Modicon is the master. Look on-line for an example of a Modicon Modbus read/write operation and then modify it for your purposes.

Your drive is the slave and it will have specific registers in a map/table of registers. The slave setup is serial comm and a unique slave ID address. Beyond that there isn't much to do with the slave for read actions, sometimes a preliminary action is needed to write a value to a drive.

The serial comm settings for both devices need to be identical (word size 8 bits, one stop bit, parity) on both devices.

Modbus RTU is typically done over RS-485. It is common to refer RS-485 as '2 wire', but in reality a 3rd wire, a signal common, should be used, too, so it's really 3 wire.

The RS-485 data lines go by various designations, A/B, (+)/(-), D/D-. Negative to negative, Plus to plus, if it's labeled the same. However, sometimes it isn't labeled the same and (+) needs to go to (-). It won't hurt anything if wired backwards, but it won't work.

Termination resistors usually are not needed at 9600/19.2K baud rates on the bench, but might be at faster rates or longer distances.

Some devices don't 'see' comm setting changes unless power is cycled for a cold start.

32 bit Floating point values can be troublesome because there are four IEE754 formats for byte/words, two of which are commonly used, the others rarely if ever, but people freak when the value 174.9 appears at -5.937856^23 because the correct format is the 'other' one.

The leading 3 or 4 used for register/addresses like, 30032 or 400712 is only so human beings can identify whether to the register is an input register (starts with 3) or a holding register (starts with 4). The leading 3 or 4 is NOT used in the modbus message.

Ironically, function code 03 is used for (4)xxxxxx holding registers, while function code 04 is used for (3)xxxxx input registers. No one knows why. It just is.

If you can test on the bench, it's easier than in the field because of issues over distance, but you do what you can.

I always test a slave first with a generic PC Modbus master, like Modscan32, with a USB/RS-485 converter to make sure I can establish communications by reading some non-zero register, confirming that its correct; then writing a value. I try to test with a holding register, in order to avoid the complication of reading the wrong register but getting a valid reply that is zero, because sometimes zero is a filler and for coils or binary inputs you've got 50% chance of getting the right value from the wrong register, given that it can only be a one or zero. But a temperature is not likely to be the same value as the Hz.
 
Thanks for the replay.I don't have comunication problem when i connect with the screen HMIGTO 5310.I have communication problem when i go to write programm to the plc.I don't no what parameter must change to the servo all manual i have read for the servo is only for modbus/tcp.The manual write that must change parameter 1282 to (modbus) but the servo has two option (local mode and fielbus mode).Thanks
 

Similar Topics

Hey Programmers, Heres todays puzzle I was trying to solve... I have a Modbus TCP network with two Modicon M221 controllers live on my work bench...
Replies
0
Views
467
Hey everyone! I have trouble making sense of the math conversion in this seconds tag of the Modicon M221 Real Time Clock. I thought I understood...
Replies
4
Views
1,594
Hi all, i am trying to scale a 0 - 1000 analogue input to a -10000 to 10000 output with 0-500 been -10000 to 0 and 501-1000 to 0-1000 is there...
Replies
7
Views
2,892
Hi All, I'm looking for some insight into what the SHORT instruction does. The help file wasn't very useful, as I found the explanation to be...
Replies
4
Views
1,494
Hi all. I’m currently trying to combine 3 memory words in to a single display on a weintek hmi as I want to display running time. I have the...
Replies
4
Views
1,827
Back
Top Bottom