[question] start addresses are 0? #808
Unanswered
Gwanyoung-K
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi I'm newbie.
Example of modbus_mapping_new function as follws.
/* The first value of each array is accessible from the 0 address. */
mb_mapping = modbus_mapping_new(
BITS_ADDRESS + BITS_NB,
INPUT_BITS_ADDRESS + INPUT_BITS_NB,
REGISTERS_ADDRESS + REGISTERS_NB,
INPUT_REGISTERS_ADDRESS + INPUT_REGISTERS_NB
);
if (mb_mapping == NULL) {
fprintf(
stderr, "Failed to allocate the mapping: %s\n",
modbus_strerror(errno)
);
modbus_free(ctx);
return -1;
}
And description.
This function is equivalent to a call of the modbus_mapping_new_start_address function with all start addresses to 0.
So, if REGISTERS_ADDRESS is 20, BITS_NB is 10, should client access to 30 ~ 39?
Best regards.
Beta Was this translation helpful? Give feedback.
All reactions