Project

General

Profile

Bug #1167 » modbus_tcps.h

yufeng wu, 01/06/2021 05:06 PM

 
1
#ifndef	_CModbus_TcpS_
2
#define	_CModbus_TcpS_
3

    
4
#if _MSC_VER > 1000
5
#pragma once
6
#endif // _MSC_VER > 1000
7

    
8
#include "daq/daq_protocol.h"
9
 
10
#if !defined(FALSE)
11
#define FALSE  0
12
#endif
13

    
14
class CModbus_TcpS : public CProtocol  
15
{
16
protected:
17
public:
18
	virtual sint32 TxProc();
19
	virtual sint32 RxProc();
20
	virtual sint32 GetZfFlag( ){return 1;};
21
	virtual void   Init( S_PROTOCOLCFG * pcfg );
22
	virtual         ~CModbus_TcpS();
23

    
24
protected:
25
	
26
	virtual uint8	ProcCmd();
27
	void			ProcYKCmd(uint16 YaoKongNo,uint16 YkStatus);
28
	void			ProcYTCmd(uint16 YaoKongNo,uint16 YkStatus);//WYF 20190110
29
	sint32			SendDiOne(uint16 startAddr,uint16 Num);
30
	sint32			SendMeasure(uint16 RegOffset,uint16 RegNum);
31

    
32
	void			ReturnException(uint8 func,uint8 expCode);
33
	sint32	GetNowSecond();
34
private:
35
	uint8			TransIdHi;
36
	uint8			TransIdLo;
37
	sint32		m_LastSendTime;
38
	sint32		m_RcvTimeOuts;		//超时时间
39
};
40

    
41
#endif 
42
// !defined(_CModbus_TcpS_)
(1-1/3)