50 lines
2.2 KiB
C#
50 lines
2.2 KiB
C#
namespace AuroraPLC
|
|
{
|
|
public enum ePLCNetType
|
|
{
|
|
//None,
|
|
|
|
MelsecNet,
|
|
MXComponent,
|
|
// etc
|
|
}
|
|
|
|
public abstract class PLCNetwork
|
|
{
|
|
// Melsec & MXComponent Open/Close 를 위한 공용 초기화 메서드
|
|
// For MelsecNet: mode: dummy(-1), ownStationNo: 255
|
|
public virtual void SetInitParams(short channelNo, short mode, short stationNo) { }
|
|
// For MX Component: ActUtlType64Lib
|
|
public virtual void SetInitParams(int logicalStationNo) { }
|
|
|
|
// Melsec & MX Component 공통용
|
|
public abstract bool OpenToPLC();
|
|
public abstract bool CloseToPLC();
|
|
|
|
// 송신과 수신 부분을 하나로 통일 필요 : xxx2 API 사용 (2 바이트 단위)
|
|
// MelsecNet
|
|
public virtual bool ReceiveFromPLC(short devType, short startDevNo, ref short readByteSize, ref short readData) { return false; }
|
|
public virtual bool SendToPLC(short devType, short startDevNo, ref short writtenByteSize, ref short writtenData) { return false; }
|
|
// MXComponent
|
|
public virtual bool ReceiveFromPLC(in string devLabel, int readSize, ref short[] readData) { return false; }
|
|
public virtual bool SendToPLC(in string devLabel, int writeSize, ref short[] writeData) { return false; }
|
|
|
|
//-----------------------
|
|
// 특수 케이스1 : B/W 이외의 장치 통신
|
|
// MXComponent : ReadDeviceBlock2 <==> Melsec: mdReceive
|
|
// 우선 MXComponent 기준으로 구현, 나중에 Melsec 과 호환되게 수정하자..
|
|
// 워드 단위로 수신
|
|
// MXComponent
|
|
public virtual bool ReceiveDeviceBlock2FromPLC(in string szDevice, int readSize, ref short[] readData) { return false; }
|
|
|
|
//=====================================
|
|
//-------------- Only For MXComponent
|
|
// 솔더링에서 Bit Input 의 Write 용도였으나, 혼용문제 수정하여 삭제됨 : 현재 사용안함
|
|
public virtual bool SetDevice2(in string devLabel, short writeData) { return false; }
|
|
//============================================================
|
|
|
|
//---------- 기타 ------------------------
|
|
public virtual void Terminate() { }
|
|
}
|
|
}
|