模拟PLC操作。

This commit is contained in:
TAO Cheng
2014-11-25 11:53:12 +08:00
parent e0883dae59
commit 058f911000
6 changed files with 326 additions and 144 deletions
@@ -48,6 +48,7 @@ enum TCPIP_RESPONSE_RESULT
RESPONSE_UNKNOWN=0,
RESPONSE_HANDSHAKE,
RESPONSE_READ_PLC_STATE,
RESPONSE_READ_PLC_CALIB_POS,
RESPONSE_WRITE_PLC_STATE,
RESPONSE_READ_SENSOR_STATE,
RESPONSE_READ_CCD_DATA,
@@ -86,6 +87,27 @@ struct s_tcpip_state
_PCMeasureResult=0;
};
};
struct s_tcpip_msg_data
{
int _MsgType;
int _CmdType;
int _DataAddr;
int _DataSize;
int _UpdateData;
void Init()
{
_MsgType=0;
_CmdType=0;
_DataAddr=0;
_DataSize=0;
_UpdateData=0;
};
s_tcpip_msg_data()
{
Init();
};
};
//======================================================================================
class CSo7_TCPIP_Server
{
@@ -95,7 +117,7 @@ public:
static struct_so7_tcpip_buff m_TCPIPBuf[lChannelSize];
static s_tcpip_state m_TCPIPServerState;
s_tcpip_msg_data m_TCPIPMsg;
short *DM5000;
short *DM8000;
short *DM10000;