📄 ofxplcdev.h
字号:
// OFxPLCDev.h: interface for the COFxPLCDev class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_OFXPLCDEV_H__D81DB75C_00BA_4975_9E03_35F428FDF70F__INCLUDED_)
#define AFX_OFXPLCDEV_H__D81DB75C_00BA_4975_9E03_35F428FDF70F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Comm.h"
#ifndef STX
#define STX 0x02
#endif
#ifndef ETX
#define ETX 0x03
#endif
#ifndef ENQ
#define ENQ 0x05
#endif
#ifndef ACK
#define ACK 0x06
#endif
#ifndef NAK
#define NAK 0x15
#endif
#ifndef S_retstruct
#define S_retstruct
struct _retstruct
{
int code;
CString discription;
CTime time;
};
#endif
class AFX_EXT_CLASS COFxPLCDev : public CComm
{
public:
COFxPLCDev();
virtual ~COFxPLCDev();
public:
int InitDev(CString strReg, _retstruct *_ret);
//
public:
int read_one(_retstruct* _ret, int istation, char &value);
int force_off(_retstruct *_ret, int istation);
int force_on(_retstruct* _ret, int istation);
int SetSpeed(_retstruct *_ret, int iStation, int Speed);
int GetSpeed(_retstruct *_ret, int istation, int &Speed);
int SendENQ(_retstruct *_ret);
//
protected:
int get_response(BYTE *ibuf, int ilen, BYTE *rbuf, int &rlen, _retstruct *_ret);
int check_sum(BYTE *buf, int& buflen, BYTE &chSum);
};
#endif // !defined(AFX_OFXPLCDEV_H__D81DB75C_00BA_4975_9E03_35F428FDF70F__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -