Exemplo n.º 1
0
 /// <summary>
 /// Shows the function code of the command.
 /// </summary>
 private void ShowFuncCode(CmdConfig cmd)
 {
     if (cmd == null)
     {
         numCmdFuncCode.Value    = 0;
         numCmdFuncCode.ReadOnly = true;
     }
     else if (cmd.DataBlock == DataBlock.Custom)
     {
         numCmdFuncCode.Value    = (byte)cmd.CustomFuncCode;
         numCmdFuncCode.ReadOnly = false;
     }
     else
     {
         numCmdFuncCode.Value    = ModbusUtils.GetWriteFuncCode(cmd.DataBlock, cmd.Multiple);
         numCmdFuncCode.ReadOnly = true;
     }
 }