07-19-2023 06:53 AM
Hi all,
can anyone tell me why the output isn't like:
\05\08\07\01\00\01\03\E8\01\B3
Thanks
07-19-2023 07:05 AM
\b is a special representation for 0x08 which means backspace.
There are other special representations such as \t (0x09), which means tabulator or \s (0x20), which means space.
07-19-2023 07:07 AM - edited 07-19-2023 07:08 AM
Then why does 07 appear?
It should be bell if it works like you have said. No?
07-19-2023 07:16 AM - edited 07-19-2023 07:22 AM
Hi,
It actually is, but character 0x08 in LabVIEW is escaped as \b (bell control character), and so is:
- 0x09 as \t (horizontal tab)
- 0x0A as \n (line feed)
- 0x0C as \f (form feed)
- 0x0D as \r (carriage return)
- 0x20 as \s (space)
I guess they decided to escape these characters differently as they are frequently used.
Other non-printable characters are simply escaped \xx depending on their hexadecimal value.
Note: if you turn your string indicator into a control and replace \b with \08, LabVIEW will automatically replace it back with \b.
Regards,
Raphaël.
07-19-2023 07:22 AM
I see.
What does the \ mean in the output string?
It's different from 05080701000103E801B3
Can I obtain \05\b\07\01\00\01\03\E8\01\B3 starting from 05 08 07 and so on strings and the concatenate strings block?
Thanks
07-19-2023 07:23 AM
Why not set the indicator to hex display instead? If you are using \-codes, non-displayable characters are replaced with well-known codes if available, else with a two-digit hex code.
07-19-2023 07:27 AM
I've done it.
0508 0701 0001 03E8 01B3
Why do these spaces appear?
Thanks
07-19-2023 07:44 AM
@Lucky-Luka wrote:
I've done it.
0508 0701 0001 03E8 01B3
Why do these spaces appear?
Thanks
For readability! They are just cosmetic.
07-19-2023 08:02 AM
Crosspost on LAVA: https://lavag.org/topic/23372-byte-array-to-string-function-question/
07-19-2023 08:04 AM
A little more information on Backslash Codes: LabVIEW Help - Backslash ('\') Codes Display