Hi All,
I have a problem with CodeSys(version 2.3.9, ST language). So, I should both read and write to the same registers over modbus(RS485) but I have any idea how I can do it.
Register numbers are between 40000 - 42000 and I can write values to those registers but how I can read those registers?
And I am a newbie with CodeSys, so, please simple asnwer if it possible.
Kassu
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
shooter hat geschrieben:
yes you can write to registers using AT %MX0.0 :BOOL;
Thanks for you answer but write is not problem. I can write those register but I donΓ€t understand how I can read the same register. That is my problem.
Kassu
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
in the varlist you can say
input AT %MX0.0 : BOOL;
output AT %MX0.0 :BOOL;
so you can write them from 2 places it is bad practice as you can also use same name for input and output.
if you mean reading from distance you will have to make communications protocol to the receiving unit.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All,
I have a problem with CodeSys(version 2.3.9, ST language). So, I should both read and write to the same registers over modbus(RS485) but I have any idea how I can do it.
Register numbers are between 40000 - 42000 and I can write values to those registers but how I can read those registers?
And I am a newbie with CodeSys, so, please simple asnwer if it possible.
yes you can write to registers using AT %MX0.0 :BOOL;
Thanks for you answer but write is not problem. I can write those register but I donΓ€t understand how I can read the same register. That is my problem.
in the varlist you can say
input AT %MX0.0 : BOOL;
output AT %MX0.0 :BOOL;
so you can write them from 2 places it is bad practice as you can also use same name for input and output.
if you mean reading from distance you will have to make communications protocol to the receiving unit.