Example #1
0
 public void SetTimeOut(short value)
 {
     if (!isConnected)
     {
         return;
     }
     try
     {
         DeviceValue[0] = value;
         ReturnCode     = plc.WriteDeviceBlock2("D502", 1, ref DeviceValue[0]);
     }
     catch { }
 }
Example #2
0
 private void btnWrite_Click(object sender, EventArgs e)
 {
     //  richTextBox1.Text = " ";
     //   int lplData;
     //  lplData =Convert .ToInt32(txtAddress.Text);
     short[] datas = new short[100];
     for (int i = 0; i < 100; i++)
     {
         datas[i] = (short)i;
         // _PLC.ReadBuffer
     }
     _PLC.WriteDeviceBlock2("D300", 100, ref datas[0]);
     richTextBox1.AppendText("输入成功" + "\r\n");
 }
Example #3
0
 internal int SetValue(string adr, short[] values)
 {
     Err = plc.WriteDeviceBlock2(adr, 2, ref values[0]);
     return(Err);
 }