Posted 9 Sep 2020 (edited) 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 Edited 9 Sep 2020 by sandy1 Share this post Link to post Share on other sites
Posted 9 Sep 2020 @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
Posted 9 Sep 2020 (edited) 3 hours ago, Wasan said: @sandy1 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 9 Sep 2020 by sandy1 Share this post Link to post Share on other sites
Posted 8 Oct 2020 @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
Posted 8 Oct 2020 Example Program M221_Test_Read_Bit.smbp Share this post Link to post Share on other sites
Posted 8 Oct 2020 I cannot edit post then I add image from instructions 1 - 6 here 1 person likes this Share this post Link to post Share on other sites
Posted 9 Oct 2020 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
Posted 9 Oct 2020 Just a guess but, %MW1:X0 and so forth. Share this post Link to post Share on other sites
Posted 10 Oct 2020 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
Posted 11 Oct 2020 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 Share this post Link to post Share on other sites