/// <summary> /// Write the value to the handle returned by GetSymhandleByName /// </summary> /// <typeparam name="T">A type like byte, ushort, uint depending on the length of the twincat variable</typeparam> /// <param name="varHandle">The handle returned by GetSymhandleByName</param> /// <param name="varValue">The value to be sent</param> public void Write <T>(uint varHandle, T varValue) { IEnumerable <byte> varValueBytes = GenericHelper.GetBytesFromType <T>(varValue, defaultStringLenght); this.WriteBytes(varHandle, varValueBytes); }
/// <summary> /// Write the value to the handle returned by GetSymhandleByNameAsync /// </summary> /// <typeparam name="T">A type like byte, ushort, uint depending on the length of the twincat variable</typeparam> /// <param name="varHandle">The handle returned by GetSymhandleByNameAsync</param> /// <param name="varValue">The value to be sent</param> public Task WriteAsync <T>(uint varHandle, T varValue) { IEnumerable <byte> varValueBytes = GenericHelper.GetBytesFromType <T>(varValue, defaultStringLenght); return(this.WriteBytesAsync(varHandle, varValueBytes)); }