FAQ TWedge
Why Are All Commands Ignored by the Device?
Why Are All Commands Ignored by the Device?
Solution: When using the function WriteToDevice () (or WriteData ()) to send device configuration or initialization commands, please check if a newline or carriage return character is required. This is especially important if the device uses a protocol like TELNET. A newline character is specified by \n.
The following example sends the text "user" followed by a newline to the device:
// TWedge 2:
WriteToDevice ("user\n", 1000);
// TWedge 3:
hConn.WriteData ("user\n", 1000);
Here is a list of common escape sequences:
- \' Single quotation mark.
- \" Double quotation mark. Use this escape sequence if you need to specify a " as part of a string.
- \\ A single backslash character.
- \b Backspace.
- \n New-line (line-feed).
- \r Carriage return. \r in combination with \n is used in DOS systems as sequence for a carriage return and new line. Most likely \n can be used instead.
- \t Horizontal tab.
- \f Form feed (for printers).