ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Byte Array To String Function question

Hi all,

can anyone tell me why the output isn't like:

\05\08\07\01\00\01\03\E8\01\B3

Thanks

0 Kudos
Message 1 of 11
(2,069 Views)

\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.

0 Kudos
Message 2 of 11
(2,057 Views)

Then why does 07 appear?

It should be bell if it works like you have said. No?

https://www.asciitable.it/

0 Kudos
Message 3 of 11
(2,049 Views)

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.

Message 4 of 11
(2,040 Views)

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

0 Kudos
Message 5 of 11
(2,034 Views)

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.

0 Kudos
Message 6 of 11
(2,031 Views)

I've done it.

0508 0701 0001 03E8 01B3

Why do these spaces appear?

Thanks

0 Kudos
Message 7 of 11
(2,017 Views)

@Lucky-Luka wrote:

I've done it.

0508 0701 0001 03E8 01B3

Why do these spaces appear?

Thanks


 

For readability! They are just cosmetic.

Message 8 of 11
(1,995 Views)

Crosspost on LAVA: https://lavag.org/topic/23372-byte-array-to-string-function-question/ 



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 11
(1,976 Views)

A little more information on Backslash Codes: LabVIEW Help - Backslash ('\') Codes Display 



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 10 of 11
(1,965 Views)