| Using VISA.NET > Formatted I/O > Using Scanf > Scanf Format Strings |
Format strings contain information that describes how to parse data (from a Formatted I/O read buffer) that was sent from a connected device to a PC. The first parameter to every Scanf method is a format string. Format strings include ordinary characters, escape sequences, and format specifiers:
Note that Scanf and Printf are very similar conceptually, with Printf handling the formatting of outgoing messages and Scanf handling the parsing of incoming messages. That said, many of the format conventions are the same.
You can use any language-specific escape sequence in a format string. Regardless of the language, several escape sequences are always recognized by VISA.NET, as shown in the table below.
The Scanf Format Specifier Syntax topics describe Scanf format specifier syntax in detail.
![]() |
Strings in .NET are UNICODE, but VISA.NET assumes that all text added to the read buffer by the connected device is single-character ASCII. This means that format strings may not contain any characters greater than 255, and an octal escape sequence (\###) may never specify a character greater than 255. |
The following table lists VISA.NET defined escape sequences and describes what they send to the device.
|
Escape Sequence |
Effect on Write Buffer |
|---|---|
|
\n |
Reads an ASCII new line character (LF) from the read buffer. In some contexts, the new line character may be treated as a general whitespace character. |
|
\r |
Reads an ASCII carriage return character (CR) from the read buffer. |
|
\t |
Reads an ASCII TAB character from the read buffer. |
|
\### |
Reads the ASCII character specified by the octal value from the read buffer. |
|
\" |
Reads an ASCII double-quote (") character from the read buffer. |
|
\\ |
Reads an ASCII backslash (\) character from the read buffer. |