Modbus Slave Register Mapping??

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
derfleznew
Posts: 3
Joined: Wed Aug 09, 2017 7:30 pm

Modbus Slave Register Mapping??

Post by derfleznew »

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?

User avatar
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??

Post by Benj »

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.

Post Reply