Operating Guide
How to add MODBUS coils in MCXD
Summary |
How to make the MCXD support MODBUS coils. |
||||
|
|
|
|
||
Description |
Following are the steps to support MODBUS coils with MCXD. |
||||
|
Will be allowed to read a single coil or group of 16 coils per task: |
||||
|
1. |
Add the functionalities into the "InitDefines.c" file: |
|||
|
|
//Enable to use Coils for Modbus Slave |
|
|
|
|
|
#define MODBUS_SUPPORTCOILS |
|
|
|
|
|
#ifdef MODBUS_SUPPORTCOILS |
|
|
|
|
|
|
#define MODBUS_COILS_OFFSET |
50000 |
|
|
|
#endif |
|
|
|
|
2. |
Add the file "AdditionalCoilTable.c" into the folder... \App |
|||
|
3. |
Edit "AdditionalCoilTable.c" setting the boolean variables to the coils: |
|||
|
|
a. For "Alarms": the variables' name are in the column "Variable name" in the tab called "Alarms" |
|||
|
|
|
|
|
|
|
|
|
|
|
|
b.For "Digital Input": the variables' name are in the column "Name" in the tab called "Digital Input"
c.For "Digital Output": the variables' name are in the column "Name" in the tab called "Digital Output"
d.For "Hot Spot": the variables' name is "MyApp. Hot spot name"
© Danfoss | Climate Solutions | 2021.11 |
AQ397218417593en-000101 | 1 |
4.Edit the "main.c" file by adding "TTimer MainLoopTimer"; just before the instruction:
#ifdef MODBUS_SUPPORTCOILS #include "AdditionalCoilTable.c" #endif
5.Edit the "main.c" file by adding "IOMng.Run( )"; just before the instruction:
#ifdef MODBUS_SUPPORTCOILS SetValuesOfCoils( );
#endif
© Danfoss | Climate Solutions | 2021.11 |
AQ397218417593en-000101 | 2 |