LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Are there any Octal to ASCII string converter?

Solved!
Go to solution

Hi guys, one question. Are there any Octal to ASCII converter available in labview?

0 Kudos
Message 1 of 14
(8,435 Views)

There is a Number to Octal String in the String -> Number/String Conversion palette.

Otherwise, use Format into String with %o format.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 14
(8,427 Views)

The one you saying right now is any number or string convert to octal, somewhat like this.Capture.PNG

But i need now is to convert Octal to ASCII. It's different.

0 Kudos
Message 3 of 14
(8,422 Views)

How about changing the format string from your %02x to %03o? That is exactly what pincpanter was saying. If that is not what you want to do, show us some code of what you want to achieve, rather than what you do not want.

 

 octal string.png

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 14
(8,412 Views)

So the question is: what's Octal? There is no such thing at low level. For me, octal is only a specific visual representation of integers or "bitstream" data.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 14
(8,402 Views)

This is what i want.

Capture.PNGCapture.PNG

It's easy to convert ASCII to any base, just play with the format string, but if want to convert back, it takes some understanding.

I'm still new to labview btw

0 Kudos
Message 6 of 14
(8,383 Views)

Just do what pincpanter and rolfk say and replace the FF / hex functions you have with the ones rolf showed you. It's a direct swap!

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 7 of 14
(8,380 Views)

So what's wrong with the inverse functions from my post? The Octal String to Number function is right besides the Hexadecimal you show in your example.

 

Also note that part of the confusion is likely in your use of what represents the ASCII side. Many people consider the ASCII part the human readable text side, while the hex/octal/decimal number side is the machine representation.

 

octal string 1.png

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 14
(8,369 Views)
Solution
Accepted by topic author oliver1023

So you have an input ASCII string containing (3-digit?) numbers in octal format and need to scan it to U8 values.

The code is much the same you posted for hexadecimal format, but using Octal String to Number instead of Hex String to Number. Probably extracting 3 characters at a time.

You may also use Scan from String with %3o format, see just as an example this code:

octal.png

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 9 of 14
(8,364 Views)

1000px-Ascii_Table-nocolor.svg_.png

I'm just asking are there any code for this....

0 Kudos
Message 10 of 14
(8,336 Views)