GitHub user zhy1378 added a comment to the discussion: How do I configure the 
PLC memory address to start at 0 instead of 1 when using PLC4j Modbus-TCP?

Hi, thanks for your answer.

Your suggestion is what I am doing right now - using address 1 as the starting 
address instead of 0.

Arrays and lists begin at 0, not 1, in most programming languages. I have been 
programming for over 10 years before using PLCs and Modbus-TCP, and having 
addresses start at 0 aligns better with my experience.

Even though the Modbus specification defines 1 as the starting address, 
stopping the check for non-zero addresses would likely work better in this 
situation and provide more compatibility. Do you agree?

While the Modbus standard specifies starting at 1, allowing a starting address 
of 0 seems more intuitive for those with a programming background. Disabling 
the address validation would enable full compatibility with PLCs like Siemens 
that start addressing memory at 0. Given my background, starting addresses at 0 
feels more natural as well. What are your thoughts on disabling the address 
check?

GitHub link: 
https://github.com/apache/plc4x/discussions/1330#discussioncomment-8074254

----
This is an automatically sent email for dev@plc4x.apache.org.
To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org

Reply via email to