Modbus Server Function Definition
This block associates data to Modbus functions {Coil, Input Register, Discrete Input and Holding Register}
Block ID
Modbus Server Function Definition
Library
Woodward Custom Modbus
Description

This block associates data with Modbus functions {Coil, Input Register, Discrete Input and Holding Register} that are referenced by a Modbus Server Definition.
Multiple Function Definition blocks can be used to construct a Modbus memory map. Each block allows a group of functions to be defined and associated with a Modbus address (example). Functions of the same type are not allowed to overlap, but they may share the same underlying data. The block will execute a cross check during Simulink Update (CTRL+D) to confirm that there is no overlap.
Notification that a client has acccessed the server can be configured using the Modbus Server Event Trigger block.
Block Parameters
| Parameter Field | Values | Comments/Description |
|---|---|---|
| Modbus Definition Reference | Single quote enclosed alpha numeric | The name of Modbus Server Definition block that this function belongs to. |
| Function Name | Single quote enclosed alpha numeric | Unique, c-legal name that is associated to this function. |
| Function Type | Drop down {Coil, Input Register, Discrete Input and Holding Register} |
The type of function to be defined. |
| Starting Address | 0-65535 |
Specifies the starting address of this set of functions in the Modbus memory map. For example, setting the start address to 1010, Number of Registers to 10 and Function Type as Coil would define a set of coil registers between 1010 and 1019 in the memory map. |
| Number of Registers | 1-65535 | Specifies the number of registers to be defined by this block |
| DataStore Reference Name | Single quote enclosed alpha numeric |
The name of the datastore that provides the data being associated to this function. The referenced datastore must be a boolean type when the Function Type is Coil or Discrete Input and a uint16 type when the Function Type is Input Register or Holding Register. |
| DataStore Type | Drop down {Scalar, Vector} |
The referenced datastore could be a scalar or a vector. |
| Offset into DataStore Vector | Integer |
Specifies the element offset into a Vector DataStore
Type. A Simulink Update error will be issued if the offset and/or the Number of Registers attribute result in a reference that falls outside of the memory region specified by the referenced datastore. For example, a block of 3 functions could be specified to begin at element 5 of a vector datastore with 10 elements by setting this value to 5. However an error would result if instead of 3, 6 functions were specified by Number of Registers because 5+6 exceeds the 10 elements available in the datastore. Only visible when a Vector DataStore Type is referenced. |
