Snippet: struct Remote Module/Device
Description: Modbus template for own struct for slave device
struct ${1:deviceStructName} {

	MODBUS_MODULE_DECLARE_BEGIN()

	MODBUS_ADD_REMOTE_REG($${2:int16}$ ${3:regName/auto}, MB_REM_${4:HOLDING/INPUT/DO/DI}, ${5:regAddr/auto}, ${7:MB_BIG_ENDIAN_WORDS})

	MODBUS_MODULE_DECLARE_END()

	func init(portNum: uint32, devAddr: uint32, interval: uint32) {
		self.comPort = portNum
		self.devAddr = devAddr
		self.interval = interval
		self.interval2 = 10000
		self.timeout = 100
		self.reqTryCount = 3
		self.isEnabled = true
		self.packSize = 0
		self.isHoldingsRead = true
		self.isAutoRead = true
		self.isShowMessages = true
		self.isMultipleWrite = true
		self.errorCallback = $(device, errorCode, regAddr) {
			//to do...
		}
		self.connectionRestoreCallback = $(device) {
			device.errors = 0
		}
		self.changedRegValueCallback = $(reg) {
			if reg.ptr == remoteDevice.regName.ptr {
				return true
			}
		}
		MODBUS_MODULE_INIT(self)

	}
}