Example #1
0
 /// <summary>
 /// Defines the Writing of a Word variable.
 /// </summary>
 /// <param name="value">The variable value</param>
 public void SetValue(object value)
 {
     if (!value.GetType().Equals(typeof(string)))
     {
         throw new ApplicationException("The informed type is not a string");
     }
     _pLCComunication.Write($"DB{_dbNumber}.DB{Symbol}{_wordNumber}", value);
 }
Example #2
0
 /// <summary>
 /// Defines the Writing of a Bit variable.
 /// </summary>
 /// <param name="value">The variable value</param>
 public void SetValue(object value)
 {
     if (!value.GetType().Equals(typeof(bool)))
     {
         throw new ApplicationException("The informed type is not a bool");
     }
     _pLCComunication.Write($"DB{_dbNumber}.DB{Symbol}{_byteNumber}.{_bitNumber}", (bool)value);
 }