Hi,
I'm using Eaton PLC XC303 and I'm trying to make PLC as a Modbus slave.
And there is a problem, I can't use holding registers to read and write them.
I can't write values to the registers from PLC side. Why?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You don't understand me. PLC is a slave, not master, so there is no any channel settings.
And yes, PLC is on Codesys v3.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2018-08-21
Originally created by: ph0010421
Does your device have the Modbus slave licence? My preferred Codesys plc has a Modbus master, but will not act as a slave due to not having the licence.
Some genius has probably written a Modbus slave library
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As normal standard Codesys V3 soft PLC, regardless your modbus master or slave, you have to do the configuration.
The step for configure as slave is adding the device->add modbus slave->add modbus serial device.
Then inside the modbus serial device have the memory where is for outside using reading holding register to read or write.
as for some other brand PLC like ABB, Wago , where default have open up the modbus slave function where will automatically to map all the PLC internal memory for all the modbus function.
this is example for standard codesys V3 softPLC modbus setup
Thank you
Lee Junn Hei
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ph0010421 hat geschrieben:
Does your device have the Modbus slave licence? My preferred Codesys plc has a Modbus master, but will not act as a slave due to not having the licence.
Some genius has probably written a Modbus slave library
Eaton Codesys doesn't need another license for Modbus slave
johnlee hat geschrieben:
Hi marcin.w,
As normal standard Codesys V3 soft PLC, regardless your modbus master or slave, you have to do the configuration.
The step for configure as slave is adding the device->add modbus slave->add modbus serial device.
Then inside the modbus serial device have the memory where is for outside using reading holding register to read or write.
as for some other brand PLC like ABB, Wago , where default have open up the modbus slave function where will automatically to map all the PLC internal memory for all the modbus function.
this is example for standard codesys V3 softPLC modbus setup
Thank you
Lee Junn Hei
Yes, I know these all things.
P.S.
I've got answer from Eaton support, that the problem is with the Eaton Codesys.
So probably they will fix it in the next version.
Thank you guys for help. For now that's all. Bye
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As see, in codesys the holding registers are only for writing and the input register just for reading. I don't know for where they take this rule, onde holding register can be read or write in modbus...
I have another problem tha I think will be usefull to share here. My master was reading only zeros from codesys. No erros, but the registers were always at zero... So I changed the option "aways uptade variables" (see the attachment) to "enabled". Worked for me.
Hi,
I'm using Eaton PLC XC303 and I'm trying to make PLC as a Modbus slave.
And there is a problem, I can't use holding registers to read and write them.
I can't write values to the registers from PLC side. Why?
Hi marcin.w,
if the PLC are using codesys V3, just make sure you have configure the device properly and make sure you have add the IO channel correctly.
if you use holding register just make sure you have add the IO channel for FC 03(reading) FC06 or FC16(for write)
Thank you
John Lee
You don't understand me. PLC is a slave, not master, so there is no any channel settings.
And yes, PLC is on Codesys v3.
Originally created by: ph0010421
Does your device have the Modbus slave licence? My preferred Codesys plc has a Modbus master, but will not act as a slave due to not having the licence.
Some genius has probably written a Modbus slave library
Hi marcin.w,
As normal standard Codesys V3 soft PLC, regardless your modbus master or slave, you have to do the configuration.
The step for configure as slave is adding the device->add modbus slave->add modbus serial device.
Then inside the modbus serial device have the memory where is for outside using reading holding register to read or write.
as for some other brand PLC like ABB, Wago , where default have open up the modbus slave function where will automatically to map all the PLC internal memory for all the modbus function.
this is example for standard codesys V3 softPLC modbus setup
Thank you
Lee Junn Hei
Eaton Codesys doesn't need another license for Modbus slave
Yes, I know these all things.
P.S.
I've got answer from Eaton support, that the problem is with the Eaton Codesys.
So probably they will fix it in the next version.
Thank you guys for help. For now that's all. Bye
As see, in codesys the holding registers are only for writing and the input register just for reading. I don't know for where they take this rule, onde holding register can be read or write in modbus...
I have another problem tha I think will be usefull to share here. My master was reading only zeros from codesys. No erros, but the registers were always at zero... So I changed the option "aways uptade variables" (see the attachment) to "enabled". Worked for me.
There is a checkbox for writeable holding registers, see attached screenshot.
I heartily welcome you to the club of people who have learned that by default, IO not used in the code is never updated.
I don't have this option... either on modbus serial or TCP. I'm using codesys 3.5.11.0