Files
FG2608061/反编译CODE/华晓AGV管理系统/Cls/Cls_Profinet_Siemens.cs
T

60 lines
1.5 KiB
C#

using System;
using s7api.net;
namespace AGVSystem.Cls
{
// Token: 0x02000028 RID: 40
internal class Cls_Profinet_Siemens
{
// Token: 0x06000242 RID: 578 RVA: 0x00050688 File Offset: 0x0004E888
public Cls_Profinet_Siemens(string ip, int rack, int slot)
{
this.Rack = rack;
this.Slot = slot;
this.IpAddress = ip;
}
// Token: 0x06000243 RID: 579 RVA: 0x000506D8 File Offset: 0x0004E8D8
public bool Connect()
{
int num = this.client_profinet.ConnectTo(this.IpAddress, this.Rack, this.Slot);
return num == 0;
}
// Token: 0x06000244 RID: 580 RVA: 0x00050718 File Offset: 0x0004E918
public bool Disconnect()
{
int num = this.client_profinet.Disconnect();
return num == 0;
}
// Token: 0x06000245 RID: 581 RVA: 0x00050748 File Offset: 0x0004E948
public bool Read(int dbNumber, int start_address, int size, byte[] buffer)
{
int num = this.client_profinet.DBRead(dbNumber, start_address, size, buffer);
bool flag = num != 0;
return !flag;
}
// Token: 0x06000246 RID: 582 RVA: 0x0005077C File Offset: 0x0004E97C
public bool Write(int dbNumber, int start_address, int size, byte[] buffer)
{
int num = this.client_profinet.DBWrite(dbNumber, start_address, size, buffer);
bool flag = num != 0;
return !flag;
}
// Token: 0x04000607 RID: 1543
private S7Client client_profinet = new S7Client();
// Token: 0x04000608 RID: 1544
private int Rack = 0;
// Token: 0x04000609 RID: 1545
private int Slot = 0;
// Token: 0x0400060A RID: 1546
private string IpAddress = "";
}
}