예제 #1
0
파일: io.cs 프로젝트: stevewpalmer/jcom
 /// <summary>
 /// WRITE keyword
 /// Writes a 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="floatVar">A float 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, float floatVar)
 {
     if (writeManager == null) {
         throw new ArgumentNullException("writeManager");
     }
     int charsWritten = writeManager.WriteFloat(floatVar);
     if (charsWritten == -1) {
         iostat = IOError.WriteError;
     }
     return charsWritten;
 }
예제 #2
0
파일: io.cs 프로젝트: stevewpalmer/jcom
 /// <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;
 }