Project

General

Profile

Feature #2954 » L02ATS_modbus_tcps.h

yan hong, 04/18/2023 11:18 AM

 
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			SendSwitch(uint16 startAddr, uint16 Num);
31
	sint32			SendMeasure(uint16 RegOffset,uint16 RegNum);
32
	sint32			SendMeasureOne(uint16 RegOffset, uint16 RegNum);
33

    
34
	void			ReturnException(uint8 func,uint8 expCode);
35

    
36
	sint32			GetNowSecond();
37
private:
38
	uint8			TransIdHi;
39
	uint8			TransIdLo;
40

    
41
	sint32			m_RcvTimeOuts;		//??ʱʱ??
42
	sint32			m_LastRecvTime;
43
};
44

    
45
#endif 
46
// !defined(_CModbus_TcpS_)
(4-4/4)