예제 #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);
 }
예제 #2
0
파일: Bit.cs 프로젝트: laislopes/PLCUnit
 /// <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);
 }