WinTECH Software
API for Modbus Slave Dll

The following API calls are supported by both the 16-bit Modbus Slave Dll and the Win32 Slave Dll. The 32-bit version uses a separate thread to handle COM notification events so the last two calls, (ProcessCommNotification() and ProcessTimerNotification()), are not required.

OpenConnection (......)
Defines the com port, baud rate, protocol, etc. Returns a Handle to the connection. The dll may support multiple serial connections to the same or different applications.

DefineDataBlock (.......)
Defines the Node Address, Point Type, Modbus Address and pointer to a Data Array, (i.e. 100 Holding Registers Starting at Address 2000 for Node 1). This API is used to pass the address of an array to the dll. Your application would then fill the array with whatever data you wished, and it would be immediately accessible to a modbus Master polling according to the above parameters. Data points may also be written by the Master.

EnableWriteNotification (......)
This API allows the controlling application to receive a WMsg notification if a data point is written by the modbus master device.

SlaveStatus (.....)
Allows the app to interogate status counters, (i.e. number of polls from master etc.)

CloseConnection (......)
RemoveDataBlock (......)
Cleans up memory allocated within the dll.

ProcessCommNotification(UINT wParam, LPARAM lParam)
ProcessTimerNotification(UINT nIDEvent)
Since the driver is implemented as a simple dll, it cannot directly receive Windows messages. These API calls are used by the controlling application to pass control to the dll upon receipt of a COMM notification or specific Timer Notification. The dll can then control the serial channel and/or time-out on the RTU end-of-frame. These two API functions would not be required by the 32-bit version of the dll.

Last Updated: November 27, 1997
Copyright © 1996,97, WinTECH Software
Backup to MODBUS Driver Page.