MODBUS Write_var function block with Memory Double word

Britt23

Member
Join Date
Nov 2023
Location
Australia
Posts
1
Hi!

I am using a TM200CE40T PLC from Schneider to write data over Modbus. I have used Memory words (%MW) before using the Write variable successfully. One of the values I need to write is larger than 16 bits so I am using a memory double word (%MD). I'm not sure how to use the Write Variable function with memory double words or if this is even possible. Any help would be amazing.

Thanks! 🤞🏻
 
There is usually a COP/COPY/MEMCPY instruction that will copy the bits starting at %MDx to %MWy and %MW(y+1)

Or you might be able simply write the double word data to %MDx internally on the PLC, and then have Modbus write the two registers %MWx and %MW(x+1) to the device address A and A+1. This uses the 32-bits of data in %MDx (i.e. the same 32-bits of memory as %MWx and %MW(x+1), but is interpreted as a double word when written to internally on the PLC, and as two words of data when read from for the Modbus write. The only fly in the ointment is if the byte order of the Modbus slave/server device is different from the byte order of the Schneider, in which case you will need to swap the words between writing the %MD value internally and reading the %MW values for the Modbus transfer. Assuming Schneider has written their Modbus Master/Client implementation correctly (MSByte-first on the wire), the byte order within words and withing the double word should be taken care of by the Modbus implementation.
 

Similar Topics

Hi everyone, I am working on a project that needs to expose the SV (Set Value) of a temperature controller to a SCADA system. SCADA <-...
Replies
4
Views
162
Hello, This is my first exposure to CCW Micro8xx family. Someone will write to my existing micro850. Modbus TCP is turned on and I created a...
Replies
2
Views
175
Hello, I am attempting to add some IO Discrete tags to a AVEVA InTouch project (version 2020). These tags use the MBTCP driver and attempt to map...
Replies
1
Views
1,183
My first time using a SEL 3350 RTAC (or any RTU for that matter). Setting up with most Modbus TCP functions - both Server and Client - seems...
Replies
1
Views
1,492
Lately, I've been using Modbus for reading sensor values in process programming. I haven't used Modbus much, so I spent some time looking at...
Replies
4
Views
1,895
Back
Top Bottom