/**
  * <summary>
  *   Changes the measuring unit for the measured quantity.
  * <para>
  *   That unit
  *   is just a string which is automatically initialized each time
  *   the measurement mode is changed. But is can be set to an
  *   arbitrary value.
  *   Remember to call the <c>saveToFlash()</c> method of the module if the modification must be kept.
  * </para>
  * <para>
  * </para>
  * </summary>
  * <param name="newval">
  *   a string corresponding to the measuring unit for the measured quantity
  * </param>
  * <para>
  * </para>
  * <returns>
  *   <c>0</c> if the call succeeds.
  * </returns>
  * <para>
  *   On failure, throws an exception or returns a negative error code.
  * </para>
  */
 public int set_unit(string newval)
 {
     if (_func == null)
     {
         throw new YoctoApiProxyException("No PwmInput connected");
     }
     if (newval == _Unit_INVALID)
     {
         return(YAPI.SUCCESS);
     }
     return(_func.set_unit(newval));
 }