/// <summary> /// WRITE keyword /// Writes a complex value to the device. /// </summary> /// <param name="writeManager">A WriteManager instance to use</param> /// <param name="iostat">A reference variable that will be set to the I/O status</param> /// <param name="complexVar">A complex value to write</param> /// <returns>A zero value if the operation succeeds, or -1 if the operation fails</returns> public static int WRITE(WriteManager writeManager, ref int iostat, Complex complexVar) { if (writeManager == null) { throw new ArgumentNullException("writeManager"); } int charsWritten = writeManager.WriteComplex(complexVar); if (charsWritten == -1) { iostat = IOError.WriteError; return -1; } return charsWritten; }
/// <summary> /// WRITE keyword /// Writes an array of string values to the device. /// </summary> /// <param name="writeManager">A WriteManager instance to use</param> /// <param name="iostat">A reference variable that will be set to the I/O status</param> /// <param name="strArray">An array of string values to write</param> /// <returns>A zero value if the operation succeeds, or -1 if the operation fails</returns> public static int WRITE(WriteManager writeManager, ref int iostat, string [] strArray) { if (writeManager == null) { throw new ArgumentNullException("writeManager"); } int totalCharsWritten = 0; foreach (string strVar in strArray) { int charsWritten = writeManager.WriteString(strVar); if (charsWritten == -1) { iostat = IOError.WriteError; return -1; } totalCharsWritten += charsWritten; } return totalCharsWritten; }
/// <summary> /// WRITE keyword /// Writes a double value to the device. /// </summary> /// <param name="writeManager">A WriteManager instance to use</param> /// <param name="iostat">A reference variable that will be set to the I/O status</param> /// <param name="doubleVar">A double value to write</param> /// <returns>A zero value if the operation succeeds, or -1 if the operation fails</returns> public static int WRITE(WriteManager writeManager, ref int iostat, double doubleVar) { if (writeManager == null) { throw new ArgumentNullException("writeManager"); } int charsWritten = writeManager.WriteDouble(doubleVar); if (charsWritten == -1) { iostat = IOError.WriteError; } return charsWritten; }
/// <summary> /// WRITE keyword /// Writes an array of complex values to the device. /// </summary> /// <param name="writeManager">A WriteManager instance to use</param> /// <param name="iostat">A reference variable that will be set to the I/O status</param> /// <param name="complexArray">An array of complex value to write</param> /// <returns>A zero value if the operation succeeds, or -1 if the operation fails</returns> public static int WRITE(WriteManager writeManager, ref int iostat, Complex[] complexArray) { if (writeManager == null) { throw new ArgumentNullException("writeManager"); } int totalCharsWritten = 0; foreach (Complex complexVar in complexArray) { int charsWritten = writeManager.WriteComplex(complexVar); if (charsWritten == -1) { iostat = IOError.WriteError; return -1; } totalCharsWritten += charsWritten; } return totalCharsWritten; }
/// <summary> /// WRITE keyword /// Writes an array of double value to the device. /// </summary> /// <param name="writeManager">A WriteManager instance to use</param> /// <param name="iostat">A reference variable that will be set to the I/O status</param> /// <param name="doubleArray">An array of double values</param> /// <returns>A zero value if the operation succeeds, or -1 if the operation fails</returns> public static int WRITE(WriteManager writeManager, ref int iostat, double [] doubleArray) { if (writeManager == null) { throw new ArgumentNullException("writeManager"); } int totalCharsWritten = 0; foreach (double doubleVar in doubleArray) { int charsWritten = writeManager.WriteDouble(doubleVar); if (charsWritten == -1) { iostat = IOError.WriteError; return -1; } totalCharsWritten += charsWritten; } return totalCharsWritten; }
/// <summary> /// WRITE keyword /// Writes an array of float value to the device. /// </summary> /// <param name="writeManager">A WriteManager instance to use</param> /// <param name="iostat">A reference variable that will be set to the I/O status</param> /// <param name="floatArray">An array of float values</param> /// <returns>A zero value if the operation succeeds, or -1 if the operation fails</returns> public static int WRITE(WriteManager writeManager, ref int iostat, float [] floatArray) { if (writeManager == null) { throw new ArgumentNullException("writeManager"); } int totalCharsWritten = 0; foreach (float floatVar in floatArray) { int charsWritten = writeManager.WriteFloat(floatVar); if (charsWritten == -1) { iostat = IOError.WriteError; return -1; } totalCharsWritten += charsWritten; } return totalCharsWritten; }
/// <summary> /// WRITE keyword /// Writes an array of boolean values to the device. /// </summary> /// <param name="writeManager">A WriteManager instance to use</param> /// <param name="iostat">A reference variable that will be set to the I/O status</param> /// <param name="boolArray">An array of booleans to write</param> /// <returns>A zero value if the operation succeeds, or -1 if the operation fails</returns> public static int WRITE(WriteManager writeManager, ref int iostat, bool [] boolArray) { if (writeManager == null) { throw new ArgumentNullException("writeManager"); } int totalCharsWritten = 0; foreach (bool boolVar in boolArray) { int charsWritten = writeManager.WriteBoolean(boolVar); if (charsWritten == -1) { iostat = IOError.WriteError; return -1; } totalCharsWritten += charsWritten; } return totalCharsWritten; }
/// <summary> /// WRITE keyword /// Writes the format string to the device. /// </summary> /// <param name="writeManager">A WriteManager instance to use</param> /// <param name="iostat">A reference variable that will be set to the I/O status</param> /// <returns>A zero value if the operation succeeds, or -1 if the operation fails</returns> public static int WRITE(WriteManager writeManager, ref int iostat) { if (writeManager == null) { throw new ArgumentNullException("writeManager"); } iostat = 0; return writeManager.WriteEmpty(); }
/// <summary> /// WRITE keyword /// Writes a fixed string value to the device. /// </summary> /// <param name="writeManager">A WriteManager instance to use</param> /// <param name="iostat">A reference variable that will be set to the I/O status</param> /// <param name="fixedstrVar">A fixed string value to write</param> /// <returns>A zero value if the operation succeeds, or -1 if the operation fails</returns> public static int WRITE(WriteManager writeManager, ref int iostat, FixedString fixedstrVar) { if (writeManager == null) { throw new ArgumentNullException("writeManager"); } int charsWritten = writeManager.WriteString(fixedstrVar.ToString()); if (charsWritten == -1) { iostat = IOError.WriteError; } return charsWritten; }