Draxcat
Sorry if this is in the wrong place but Im having a spot of bother with holding registers.
I maybe stupid!!
I have a very simple counter hooked up to the blink example and all i want to do is read the value in via modbus tcp
using Radzio i can see anything in the holding register page.
However i can if i write the counter to an analog register.
I have a var that holds the value of the counter an INT i select %MW0 which is where i believe the location to be.
What am i doing wrong please.
 
Regards
Rob
Reply 0 0
thiagoralves
 
On the ESP32, %MW0 is at holding register 32.
Reply 1 0
Draxcat
Screenshot (1).png
Thats what i have blink_cnt is fine writing out to a analog but no holding reg.
Reply 0 0
Draxcat
Screenshot (2).png
heres radizio
Reply 0 0
richw
Not sure if it was ever fixed, but there was a bug in the OpenPLC runtime unable to read %MW0. Try %MW1
Reply 0 0
Draxcat
Not sure if it was ever fixed, but there was a bug in the OpenPLC runtime unable to read %MW0. Try %MW1
Odd... I took out the var that wrote to the analog reg and changed to %MW1 and it's working fine. Thanks for the tip.
R
Reply 0 0
thiagoralves
This bug was affecting only the Linux runtime if I’m not mistaken. It was introduced after a PR from some user.

%IW0 is mapped to input register 0. This should never work as the runtime driver overwrites it every cycle with data from analog inputs. You can write to %QW0 (holding register 0) or %MW0 (holding register 32).
 
Make sure you’re running the latest version of the editor (file -> check for updates) and that you’re reading from the right offset on Radzio. Sometimes reading many registers at once could be buggy on the Radzio side. When using Radzio I usually read only 8 or 10 registers at once.
Reply 0 0
Draxcat
Thanks for the reply everyone all working now. I have a separate issue on my opta but ill submit a fresh post. Thanks again
Reply 0 0
thiagoralves
Odd... I took out the var that wrote to the analog reg and changed to %MW1 and it's working fine. Thanks for the tip.
R
Did you have this problem on OpenPLC running on the ESP32 or on your Windows PC / Raspberry Pi / Linux box? What is the version of your editor?
Reply 0 0
Reply