Modbus Addressing

TahirQ

Member
Join Date
May 2013
Location
Riyadh
Posts
54
If I have to write an input on Discrete I/O module on Modicon M340 PLC , I know I can use %I.


Now I have to use modbus and read some additional inputs from another device other than the one on the module.How shall I write their addresses on the modules?
Also what is the proper adrdressing format of inputs you want to read through modbus?
 
You can't write directly I/O to the plc you can use memory bits to read or write the I/O
Adresses are following :-
Inputs:- 400001.0, 400001.1, 400001.2.......
Registers:- 400001, 400002...
you can use this...
 
You need to map the @I and %Q bits to bits of a memory word. The addressing of the memory words in an M340 is %MW. You can write each bit one rung at a time, for example

----| |--------( )
%I1.0 %MW1.0
Or you can use the Bit_To_Word instruction to write 16 bits at a time
In modbus the %MW words may be addressed as 40000 style numbers, just note there is a one offset in the address as %MW starts at 0 and in modbus the first address is 40001 (%MW0 = 40001)

You can also use the %M memory bits (you will still need to use code to map the %I to a %M bit)
In modbus these bits are addressed as 10000 numbers (%M0 = 10001)

Note some Modbus drivers do use the IEC format %M and %MW

hope this helps
 
No - with the M340s and the Unity based Quantums, the Modbus 10000 addressing is mapped to the %M memory bits, not to the %I addresses that are used by the plcs to address the inputs
 
If you want to map the %m adressing via modbus the adressing would be as per followig

%m0, %m1, %m2= 000001, 000002, 000003
You can't use 10000 because it has only the read only adress and it is not available in the modbus map...

Good Luck...
 
somehow the Magelis HMI is able to read the %I addresses from the M340 PLC without them being mapped to %M

I note that the magelis simulator in vijeo designer can't read them from the unity M340 simulator, but the magelis simulator can read from the M340 PLC.
 
There are non standard extra function codes used by companies to perform non standard functions - for example programming a plc over a modbus link. These extra functions are generally not documented and are not supported by the standard drivers. I guess the Magelis is using some of this expanded functionality
 
Hello I read your info about modbus addressing with %MW register.
I have a PLC with registers
PLC ADDR: MW4513 and the machine constructor write MODBUS ADDR: 44514
If I read the value with TCP modbus i read the exactoly value on the address 4513 Modbus ( 1st byte ) and I don't understand why.
Then I need to write 1 in the 7th bit of %MW10100 from my supervisor software, but if I make an or in the 10100 modbus adr or 50101 ( 10100 + 40001 ) it doesn't work.

Can someone hel me please ?
Thanks
 
Tacking on to the end of someone else's thread is frowned upon plus this thread is over 6 years old so a lot of people will ignore it. You need to start your own thread with your question.
Good luck.
 
As Firejo stated you should start new thread for this.

%MW10100 is on so called extended memory area on modbus. Originally modbus had 9999 registers. and numbering was 40001 to 49999.
Then there is extended addressing, which is 10000 and over addressing.
But it isn't 50000 as modbus have only 0X,1X, 3X and 4X starting addressing.
Adresses from 10001 starts from 410001 which is %MW10000 on Schneider CPU.
So %MW10100 is finded from modbus 410099 address

And %MW1100 is 41099 address, but it can also writed 401099 on extended addressing
%MW0..%MW9999 can be 5 or 6 numbers on modbus
%MW10000 and over is allways 6 numbers on modbus
 
Last edited:

Similar Topics

Hello everyone. Using the designer software for the HC900 had me thinking. How can I assign 1 variable so 1 single bit. Like how can I say that...
Replies
1
Views
445
Hi, I am doing PLC using M221 as a slave device and communication via modbus. The PLC has been completed and i am required to provide Modbus...
Replies
5
Views
2,826
Hi All, I would like to know is there any option in Wecon pi studio for Modbus addressing. I have gone through the options but I can't find the...
Replies
0
Views
1,177
Does anyone have a good doc that explains the addressing for modbus with unity. I am having issues setting up the addressing when trying to...
Replies
7
Views
3,974
Hello everyone, I am working on a project that requires a connection to Alstom relays series P40x using Modbus RTU, and I am having trouble doing...
Replies
0
Views
976
Back
Top Bottom