Application Programmable Interface
API to intialize, configure and open Stack
goal_mbInit()
GOAL_STATUS_T goal_mbInit ( void )
Initialize Modbus Stack.
Returns:
GOAL_STATUS_T
result
goal_mbCfgDataRegionDefine()
GOAL_STATUS_T goal_mbCfgDataRegionDefine ( uint8_t dataType, uint16_t addrStart, uint16_t quantity )
Define Data Regions for appropriate Types.
This functions defines allowed ranges for supported data types.
Returns:
GOAL_STATUS_T
result
Parameters:
dataType
appropriate data typeaddrStart
start addressquantity
number of objects
goal_mbCfgProdCodeSet()
GOAL_STATUS_T goal_mbCfgProdCodeSet ( const char ∗ pStrProdCode )
Configure Device Production Code.
Returns:
GOAL_STATUS_T
result
Parameters:
pStrProdCode
production code string
goal_mbCfgRevisionSet()
Configure Device Revision.
Returns:
GOAL_STATUS_T
result
Parameters:
pStrRevision
revision string
goal_mbCfgVendorNameSet()
Configure Vendor Name.
Returns:
GOAL_STATUS_T
result
Parameters:
pStrVendorName
vendor name string
goal_mbNew()
New Modbus Stack Handle.
Start the Stack and Create a new Modbus Instance Handle.
Returns:
GOAL_STATUS_T
result
Parameters:
out
ppHdlMb
Modbus handleidMb
Modbus handle idin
pFunc
callback function
goal_mbLedSet()
Set LEDs.
This Function is called by the Stack to set the LEDs. The State of the LEDs depends on available connections.
Returns:
GOAL_STATUS_T
result
Parameters:
in
pHdlMb
Modbus handlestatus
stack status
goal_mbRecvCb()
New Modbus Data from Transport Layer.
This function is called by the Stack, if new Data arrived via the Transportation Layer.
Returns:
GOAL_STATUS_T
result
Parameters:
in
pHdlMb
Modbus handle
goal_mbShutdown()
Shut down the Modbus Stack.
Returns:
GOAL_STATUS_T
result
API to add, get and set Objects
goal_mbDataAdd()
Add Object.
This Function adds a new Object with an Index of the specified Type. A Start Value can also be set. Only writeable Objects can be created.
Returns:
GOAL_STATUS_T
result
Parameters:
in
pMbHdl
Modbus handleindex
index of datadataType
data typevalue
value
goal_mbDataGet()
Get Object.
This Function writes the requested object values to a given buffer pointer. It also sets the written length.
Returns:
GOAL_STATUS_T
result
Parameters:
in
pMbHdl
Modbus handledataType
data typestartingAddress
address of dataquantity
number of requested valuesin/out
pBuf
bufferbufLen
buffer lenout
pWrittenLen
written buffer len
goal_mbDataSet()
Set Object.
This Function sets the requested object values from a given buffer pointer. It also sets the written length.
Returns:
GOAL_STATUS_T
result
Parameters:
in
pMbHdl
Modbus handledataType
data typestartingAddress
address of dataquantity
number of requested valuesin/out
pBuf
bufferbufLen
buffer lenout
pWrittenLen
written buffer len
API for Transportation Layer
goal_mbTcpInit()
Initialize the Modbus TCP stack.
This function initializes stack specifica.
Returns:
GOAL_STATUS_T
result
goal_mbTcpNew()
Open the Modbus TCP stack.
This function opens up the socket interface and initialize the ring buffer for receiving messages.
Returns:
GOAL_STATUS_T
result
Parameters:
in
pHdlMb
Modbus handle
goal_mbTcpShutdown()
Shutdown the Modbus TCP stack.
Returns:
GOAL_STATUS_T
result
Parameters:
in
pHdlMb
Modbus handle
Â