Modbus Slave Register Mapping??
Moderator: Benj
-
derfleznew
- Posts: 3
- Joined: Wed Aug 09, 2017 7:30 pm
Modbus Slave Register Mapping??
I have created a program for an ATMEGA328P, with an RS485 transciever chip tied to UART1, and need to be able to assign Modbus holding registers to Global variables, specifically for 40001+ registers that can be polled from an external Modbus Master. There is nothing anywhere I can find in FlowCode7 references for how to do this. The ModbusSlave1 component allows for setting up the number of coils, inputs, and Holding registers, however, that allocation needs to be tied to specific global variables. Does anyone know how to achieve this, or has done it and can share a code example?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Modbus Slave Register Mapping??
Hello,
The modbus slave RAM registers are created for you by the component and serviced by the CheckForIncoming macro.
The various Readxxx macros allow you to get the values of the modbus registers meaning you don't have to re-create the registers as global variables.
Hope this helps.
The modbus slave RAM registers are created for you by the component and serviced by the CheckForIncoming macro.
The various Readxxx macros allow you to get the values of the modbus registers meaning you don't have to re-create the registers as global variables.
Hope this helps.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel