sandy1

modbus register address

10 posts in this topic

hi guys

i am using my Schneider m221 plc  but

facing this below problem.

how can write modbus address  i am trying below register data address but not accept this register data  address example i write

%MW0:=16#10001

%MW1:=16#10002

%MW2:=16#10003

%MW3:=16#10004

so guys how can write this register address can me  share one example so i understand. also share read var setting .

ObjType:

FristObj:

Quantity:

IndexData:

Thanks

modbus1111.PNG

Edited by sandy1

Share this post


Link to post
Share on other sites

@sandy1 Do you need to use M221 to read data from other modbus device or write value to them? Please give us more information.

Share this post


Link to post
Share on other sites
3 hours ago, Wasan said:
3 hours ago, Wasan said:

@sandy1  yes i am using M221 plc & read data from other modbus device so my other modbus device data is #10001 #10002 #10003 #10004 ~ #1000F so explain me how write this data in M221 PLC also explain how to read var setting .

Edited by sandy1

Share this post


Link to post
Share on other sites

@sandy1 For about your question describe at these instrunctions below.

 

1. In This Example I have used Modbus TCP to test function as setting below.

2. Assign Modbus ID.

3. Create program ny use READ_VAR.

4. For setup you need to config these parameters on READ_VAR function block.

ObjType : For reading 1x value use "1 - Read multiple bits - 0x02"

FirstObj : define start address for 10001 use 0

Quantity : adjust how many bits do you need to read - for 10001 - 10015 use 16

IndexData : First PLC %MW for recieve data - in this example use 0 for %MW0

 

For above configuration result are this.

%MW0:X0 = 10001

%MW0:X1 = 10002

%MW0:X2 = 10003

.

.

%MW0:X15 = 10015

 

* %MW0:X0 means bit 0 on %MW0.

 

5. Use Modbus Simulator to test.

6. More detail about READ_VAR parameter.

I have attached example program that you need to change from Modbus TCP to Modbus Serial RTU on READ_VAR.

Share this post


Link to post
Share on other sites

I cannot edit post then I add image from instructions 1 - 6 here

M221_Read_Var_Bit_01.jpg

M221_Read_Var_Bit_02.jpg

M221_Read_Var_Bit_03.jpg

M221_Read_Var_Bit_04.jpg

M221_Read_Var_Bit_05.jpg

M221_Read_Var_Bit_06.jpg

1 person likes this

Share this post


Link to post
Share on other sites

hi sir 

what about more than 16 address like from 0016 to 0040 this address how can write??? because there only Available  %MW0:X0 to %MW0:X15 so how can write this address 0016, 0017, 0018,.....0040,? no available %MW0:X16?

Share this post


Link to post
Share on other sites

Just a guess but, %MW1:X0 and so forth.

Share this post


Link to post
Share on other sites
13 hours ago, pcmccartney1 said:

Just a guess but, %MW1:X0 and so forth.

i write %MW1:X16 this is not working showing error no suggestion. only available %MW1:X0 to %MW1:X15 not  %MW1:X16

Share this post


Link to post
Share on other sites

For Your Example you set index data to 1 that means start from %MW1:X0

Then for one %MW contain 16 bit that means %MW1 can have %MW1:X0 to %MW1:X15

if it is over 16 it goes to next %MW

for Read_Var block if you input quantity at 40 that means

10001 - 10016 -> %MW1:X0 - %MW1:X15

10017 - 10032 -> %MW2:X0 - %MW2:X15

10033 - 10040 -> %MW3:X0 - %MW3:X7

M221_Read_Var_01.jpg

M221_Read_Var_02.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now