byte[] MyDB32 = new byte[3000];
static S7Client MyClient;
MyClient = new S7Client();
int res= MyClient.ConnectTo("192.168.0.1", 0, 1);//连接
if(res==0)
{
MessageBox.Show("连接成功");
}
else
{
MessageBox.Show("连接失败");
}
int DBNumber = 0;
// MyClient.ReadArea(S7Consts.S7AreaDB, 53, 0, 16, S7Consts.S7WLByte, MyDB32);//读
MyClient.DBRead(53, 0, 16, MyDB32);
bool p1 = S7.GetBitAt(MyDB32, 0, 3);
S7.SetBitAt(ref MyDB32, 0, 3, true );//写
// S7.SetIntAt(MyDB32, 0, 200);
MyClient.DBWrite(53, 0, 16, MyDB32);