Пример #1
0
 /// <summary>
 /// 修改PLC地址
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void linkLabelPLCAddress_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     if (fF350YBExtPLC != null)
     {
         int fAddress = fF350YBExtPLC.PLCAddress;
         if (fF350YBExtPLC.PLCActive() && (InputBox_Int.InputIntBoxByte(ref fAddress, "PLC地址:")))
         {
             fF350YBExtPLC.PLCAddress = fAddress;
             Close();
         }
     }
 }
Пример #2
0
        private void buttonSetRegValue_Click(object sender, EventArgs e)
        {
            int fPLCRegAddr = -1;
            int fRegValue   = 0;

            if ((labelRegAddress.Tag != null) &&
                int.TryParse(labelRegAddress.Tag.ToString(), out fPLCRegAddr) &&
                (labelRegValue_10.Tag != null) &&
                int.TryParse(labelRegValue_10.Tag.ToString(), out fRegValue) &&
                fADP1701VXPLC.PLCActive() &&
                InputBox_Int.InputIntBoxWord(ref fRegValue, "RegValue"))
            {
                fADP1701VXPLC.WriteReg((ushort)fPLCRegAddr, new ushort[] { (ushort)fRegValue });
            }
        }