
#ifndef _LINPAC_MODBUS_H
#define _LINPAC_MODBUS_H

#define ERROR_FUNCTION			1
#define FC01ReadCoilStatus		1
#define FC02ReadInputStatus		2
#define FC03ReadHoldingRegister		3
#define FC04ReadInputRegister		4
#define FC05ForceSingleCoil		5
#define FC06PresetSingleRegister	6
#define FC15ForceMultipleCoil		15
#define FC16PresetMultipleRegister	16
#define FC70ModuleSetting		70

#define SubFC00ReadModuleName		0
#define SubFC04SetModuleAddr		4
#define SubFC05ReadCommProtocol		5
#define SubFC06SetCommProtocol		6
#define SubFC07ReadTypeCode		7
#define SubFC08SetTypeCode		8
#define SubFC32ReadFirmwareInfo		32
#define SubFC37ReadSpecificChannel	37
#define SubFC38SetSpecificChannel	38
#define SubFC41ReadMiscSetting		41
#define SubFC42SetMiscSetting		42

#define useTCP				0
#define useUDP				1
#define useSSL				2
#define useSSH				3

#define useIPv4				0
#define useIPv6				1

#define autoLocalPort			0

int modbusRequest(char cPort, char cNetID, char cFunction, WORD wAddr, WORD wCount, unsigned char cBuf[], WORD wBufLen, WORD wTimeout, WORD *wT);

#endif
