S
Hey
Currently working on a MODBUS slave, what i would like to know is how to map variables to the modbus register. Is there a particular method used when coding the protocol in C?
For example i have a physical input say PORTB Pin 1. I need to map this to a modbus coil say 00001. Should i just copy its value/state in to an Array that can then easily be mapped to the modbus register?
Another example is if i have a 16bit Analogue value, do i need to copy this to an array for easy access to the modbus register?
Should i use a pointer to the variables?
Thanks
Currently working on a MODBUS slave, what i would like to know is how to map variables to the modbus register. Is there a particular method used when coding the protocol in C?
For example i have a physical input say PORTB Pin 1. I need to map this to a modbus coil say 00001. Should i just copy its value/state in to an Array that can then easily be mapped to the modbus register?
Another example is if i have a 16bit Analogue value, do i need to copy this to an array for easy access to the modbus register?
Should i use a pointer to the variables?
Thanks