Autor Thema: EASY4 MODBUS RTU write Singel coil example needed  (Gelesen 3074 mal)

Offline AlesH

  • Newbie
  • *
  • Beiträge: 8
EASY4 MODBUS RTU write Singel coil example needed
« am: Mai 29, 2025, 16:48:15 Nachmittag »
Hi, I'm straggling with Modbus RTU. I have set all communication data between Master and slave but I don't understand a logic of writing of a single coil and MU acyclic request module. How I need to write a program.
I'm asking Eaton or other forum expert to provide me an example.

Thank you in advance Ales
« Letzte Änderung: Mai 29, 2025, 16:50:57 Nachmittag von AlesH »

Offline w.sprungmann

  • Full Member
  • ***
  • Beiträge: 291
Antw:EASY4 MODBUS RTU write Singel coil example needed
« Antwort #1 am: Juni 02, 2025, 08:23:52 Vormittag »
hallo,
please upload the project

Offline AlesH

  • Newbie
  • *
  • Beiträge: 8
Antw:EASY4 MODBUS RTU write Singel coil example needed
« Antwort #2 am: Juni 03, 2025, 09:49:22 Vormittag »
hallo,
please upload the project

Hi w.sprungmann,

please find attached the project

Offline radar17892

  • Sr. Member
  • ****
  • Beiträge: 855
  • Think easy!
    • mollgruppe
Antw:EASY4 MODBUS RTU write Singel coil example needed
« Antwort #3 am: Juni 05, 2025, 14:41:41 Nachmittag »
The Modbus register table is required for correct addressing.
See example image below.
Weil Einfach einfach Einfach ist!

Offline AlesH

  • Newbie
  • *
  • Beiträge: 8
Antw:EASY4 MODBUS RTU write Singel coil example needed
« Antwort #4 am: Juni 09, 2025, 13:00:30 Nachmittag »
Hi radar17892,
I have try it but doesn't work

Offline radar17892

  • Sr. Member
  • ****
  • Beiträge: 855
  • Think easy!
    • mollgruppe
Antw:EASY4 MODBUS RTU write Singel coil example needed
« Antwort #5 am: Juni 12, 2025, 15:58:22 Nachmittag »
Hello Ales,
I've taken a look at your project and I think you don't need a MU block. You're already writing Q33 cyclically (100ms) to Slave 1.
It makes no sense to use an acyclic MU block in the program if it is triggered cyclically.
Can you post a picture of the slave Modbus registers?
Please highlight the variables you want to communicate with slave 1.


Thomas
Weil Einfach einfach Einfach ist!

Offline Konni66

  • Global Moderator
  • Full Member
  • *****
  • Beiträge: 286
  • Keine Panik!
    • Eaton Trainingscenter Bonn
Antw:EASY4 MODBUS RTU write Singel coil example needed
« Antwort #6 am: Juni 12, 2025, 16:04:02 Nachmittag »
Hello all!
I did not have a look onto the entire program...
Only one question: Are you sure you can write a coil?
Not all systems allow to write coils for security reasons. Because if you do so, the automation program loses control on coils.
Just an idea.

Geetz konni
Die Programmierbeispiele sind zu Schulungszwecken gedacht. Trotz sorgfältiger Erstellung und Funktionsprüfung können Fehler nicht ausgeschlossen werden. Daher erfolgt die Verwendung der Programmteile in eigener Verantwortung.

Offline AlesH

  • Newbie
  • *
  • Beiträge: 8
Antw:EASY4 MODBUS RTU write Singel coil example needed
« Antwort #7 am: Juni 16, 2025, 09:43:53 Vormittag »
Hi radar17892,

please find attached the pictures.
If I not use MU block how can I define which MW will be my used in my project?

Ales

Hello Ales,
I've taken a look at your project and I think you don't need a MU block. You're already writing Q33 cyclically (100ms) to Slave 1.
It makes no sense to use an acyclic MU block in the program if it is triggered cyclically.
Can you post a picture of the slave Modbus registers?
Please highlight the variables you want to communicate with slave 1.


Thomas

Offline AlesH

  • Newbie
  • *
  • Beiträge: 8
Antw:EASY4 MODBUS RTU write Singel coil example needed
« Antwort #8 am: Juni 16, 2025, 09:47:20 Vormittag »
Hi Konni66,

Yes, I'm sure, I have a slave with 32 relays.
https://www.waveshare.com/Modbus-RTU-Relay-32CH.htm

BR.,
Ales

Hello all!
I did not have a look onto the entire program...
Only one question: Are you sure you can write a coil?
Not all systems allow to write coils for security reasons. Because if you do so, the automation program loses control on coils.
Just an idea.

Geetz konni

Offline radar17892

  • Sr. Member
  • ****
  • Beiträge: 855
  • Think easy!
    • mollgruppe
Antw:EASY4 MODBUS RTU write Singel coil example needed
« Antwort #9 am: Juni 18, 2025, 21:50:26 Nachmittag »
This is what I needed:
https://www.waveshare.com/wiki/Modbus_RTU_Relay_32CH

Register Address Introduction and Modbus RTU Command Introduction

For example, it is more efficient to write the status of 16 or 32 relays with one command (0x0F write multiple coils) than to write each one individually.

activate the checkbox little endian
« Letzte Änderung: Juni 18, 2025, 21:56:02 Nachmittag von radar17892 »
Weil Einfach einfach Einfach ist!

Offline AlesH

  • Newbie
  • *
  • Beiträge: 8
Antw:EASY4 MODBUS RTU write Singel coil example needed
« Antwort #10 am: Juli 03, 2025, 11:29:12 Vormittag »
Hi radar17892,

all set, the point is that we need somewhere define on which Marker Word to assign. This is done with MU-Modbus RTU acyclic request. If I set all of this parameters I will have on marker area assignment all 32 markers related to selected MW colored with green (Read). If I want to have Read/write is in yellow. To have the writ function must be orange.
When I upload program with this configuration I will have few seconds before Modbus RTU goes in fault. To reset the fault I need to reupload a program or reboot the PLC.
I'm also sniffing the communication between Master and Slave but no data is transferred.

Offline AlesH

  • Newbie
  • *
  • Beiträge: 8
Antw:EASY4 MODBUS RTU write Singel coil example needed
« Antwort #11 am: Juli 08, 2025, 14:47:16 Nachmittag »
Moreover if Start dress is 0 it's impossible to upload the project. See attach