/// <summary> /// Executes the instrument I/O task. /// </summary> public pingBK2831eResults Run( ) { if (_instrumentSession == null) { throw new ArgumentNullException("_instrumentSession"); } pingBK2831eResults outputs = new pingBK2831eResults(); // Query step // Does a VISA Write _instrumentSession.Write("*IDN?\n"); // Parses out one ASCII string as long as the specified string length outputs.Token = new string(_reader.ReadChars(17)); // Read and discard unparsed response data _reader.ReadMismatch(",;\r\n\t"); _reader.ReadMatch(",;\r\n\t"); // Parses out one ASCII string separated by one or more delimiters outputs.Token2 = _reader.ReadMismatch(",;\r\n\t"); _reader.ReadMatch(",;\r\n\t"); // Parses out one ASCII string separated by one or more delimiters outputs.Token3 = _reader.ReadMismatch(",;\r\n\t"); _reader.ReadMatch(",;\r\n\t"); // Read and discard the rest of the response _reader.DiscardUnreadData(); return(outputs); }
protected char[] ReadBinaryEncodedData(int numChars) { reader = new MessageBasedSessionReader(session); reader.BinaryEncoding = BinaryEncoding.DefiniteLengthBlockData; return(reader.ReadChars(numChars)); }