取消
显示结果 
搜索替代 
您的意思是: 

Are there any Octal to ASCII string converter?

已解决!
转到解答

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

0 项奖励
1 条消息(共 14 条)
10,329 次查看

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 项奖励
2 条消息(共 14 条)
10,321 次查看

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 项奖励
3 条消息(共 14 条)
10,316 次查看

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
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 项奖励
4 条消息(共 14 条)
10,306 次查看

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 项奖励
5 条消息(共 14 条)
10,296 次查看

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 项奖励
6 条消息(共 14 条)
10,277 次查看

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 项奖励
7 条消息(共 14 条)
10,274 次查看

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
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 项奖励
8 条消息(共 14 条)
10,263 次查看
解答
已被主题作者 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
9 条消息(共 14 条)
10,258 次查看

1000px-Ascii_Table-nocolor.svg_.png

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

0 项奖励
10 条消息(共 14 条)
10,230 次查看