07-03-2019 05:36 PM
I have an array of strings that contains 9 bytes each.
0XAB43B3D489EE9DD739 -> String 1
0XA7B3CD2CC2C30AEFF3 -> String 2
0X39572B3A8AAC2C7A34 -> string 3
.
.
.
I would like to take each byte of every string and plot it in 9 different graphs.
As a result from the data above we would have:
Graph 1 -> AB, A7, 39
Graph 2 -> 43, B3, 57
Graph 3 -> B3, CD, 2B
.
.
Graph 9 -> 39, F3, 34
Solved! Go to Solution.
07-03-2019 06:01 PM
Here's how to do 9 plots on one graph, so modify as needed. (there are many ways to do this, of course).
07-03-2019 10:28 PM - edited 07-03-2019 10:29 PM
Here is an alternative method using a pre-made enum.
07-04-2019 01:11 AM
07-04-2019 01:33 AM
It is just a way of instructing the Scan from String to only use 2 characters at a time, similar to what you have done. I like your method of scanning but I think my method of loop control is better - no dud values and the poster has a 1D array of strings.
07-04-2019 01:56 AM - edited 07-04-2019 01:58 AM
Hi Paul,
It is just a way of instructing the Scan from String to only use 2 characters at a time
First you have to create that enum: can be a long time to type in all those 256 items…
no dud values
What is "dud"?
the poster has a 1D array of strings
Ah, yes: replace the SearchAndReplaceString in my images by a simple ConcatString when the input is already an array of strings.
07-04-2019 01:59 AM
I used a loop to set the strings in a Ring and then replaced it with an Enum so only a little time required.
By "dud" I mean when the input string is empty into the Scan from String function and so a 00 is scanned at the end. Your reshape array crops it off.
07-04-2019 02:48 AM
The OP says that each string contain 9 bytes. Also, he prepends 0X to the string value.
This makes me think that he only needs to convert to U8.
07-04-2019 07:06 PM
@pincpanter wrote:
The OP says that each string contain 9 bytes. Also, he prepends 0X to the string value.
This makes me think that he only needs to convert to U8.
Yes - if the OP copies and pastes each string into a string constant/control that has been set to the Hex display mode (which is really changing the value of the string to the actual binary characters)
No - if the OP is getting the hex-formatted string value from another VI, then it won't give the correct result.
It really depends on what options there are for getting the string data in the first place. If the binary data is available without being formatted into Hex, then that would make it a lot simpler.
07-05-2019 03:55 AM
@pincpanter wrote:
The OP says that each string contain 9 bytes. Also, he prepends 0X to the string value.
This makes me think that he only needs to convert to U8.
That's how I read it...