Modbus Buffer Question

scantime

Member
Join Date
Apr 2014
Location
US
Posts
25
I am in the process of trying to create a Modbus buffer in a Schneider M340 PLC. My intent was to have all of the tags with Modbus addresses in one place, and then assign in one section with the := operator. I realized after completion it may not be that simple, as I can (and do) already read and write to a Modbus address in the PLC. I am essentially trying to do the following:

PLC_Program_Tag := Tag_With_Modbus_Address
Tag_With_Modbus_Address := PLC_Program_Tag

Which I know will not work.

I'd like to be able to read from, and write to the Tag_With_Modbus_Address. Any ideas?
 
take a look to read_var and write_var blocks, there is also others blocks for writing/reading to/from modbus slave.
 
It is a common performance improvement to group the Modbus addresses together just like you are trying to do. Maybe you want it for another reason, but under very heavy loads this can have a significant performance improvement.

When you declare the tag variables in the editor, did you know you can assign a Modbus address here as well? So PLC_Program_Tag_xxx would be located, as in identified by either tag name in the program or memory address, with the memory address allowing for direct Modbus access over a network. It looks like you describe a pure PLC tag, unlocated, and linking this to a located tag, so this seems to work for you.

What you describe is commonly done with the RSLogix5K series of controllers because of the way they update during a scan (asynchronous). Schneider is always synchronous, so it's technically not necessary except maybe you want to do it for other reasons.

After all of this, if you execute your first line at beginning of scan and the second line at end of scan, not sure why it won't work. You would copy over all variables to a local store, use them, and then copy them back to the IO block at the end. However, IO block won't change during the scan so you really don't need to worry about that. As a server for Modbus operations, the network clients will only see the value from the end of the last scan no matter which method you choose. Server communications (reads or writes) can be shown to be executed at the end of each scan, and only then.
 

Similar Topics

Hi Everyone, i was hoping for a little help with this module. i have data that needs to be read from a different plc through the Modbus plus...
Replies
11
Views
205
I have a PH meter that I am trying to bring its data into 1756-L81. I have downloaded the Rockwell MODBUS AOI kit, but I am not sure if I need to...
Replies
5
Views
158
Dear All, i am trying to connect Danfoss inverter with s7 200 cpu 226.but microwin shows following error at DATA Ptr.i assigned different VB...
Replies
1
Views
46
I'm trying to control a device via MODBUS RTU and the ModbusRtuMasterV2_PcCOM in Twincat 3. I've configured a device with the right com port and...
Replies
7
Views
222
Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
6
Views
255
Back
Top Bottom