# Modbus Server Device – Script Points and Task Triggers

The Modbus Server device has the following script points:

Script Point | Description
On Reading | Fires before it is read by a connected Modbus Client device, and runs before the Modbus Server device would handle the read request. This helps refreshing the data before the Modbus Server device handles the read request.
Write Completed | Fires after data is successfully written by a connected Modbus Client device.

Both the On Reading and the Write Completed script points use the ModbusFunctionEventArgs event argument type with the following available arguments:

Name | Type | Description
IOType | ModbusIOType | The IO type the operation belongs to.
Address | int | The address of the IO operation.
Count | int | The count of read or written units.
Values | object | The read or written values.

ModbusIOType is an enumeration of the following Modbus IO types:

Name | Description
Coils | Represents the writable 1-bit length units.
DiscreteInputs | Represents the read-only 1-bit length units.
InputRegisters | Represents the read-only 16-bit length units.
HoldingRegisters | Represents the writable 16-bit length units.

The Modbus Server device also has the following task trigger:

Task Trigger | Description
Write Completed | Fires after data is successfully written by a connected Modbus Client device.