Hi, I'm stuck with a conversion of a string to values. Could somneone give my an advice how to convert my string to decimal values please? Here is a pic of my string.
Thank you in advance.
Solved! Go to Solution.
Not nearly enough information to answer this question. I suggest reading the manual so you can get an idea of what needs to happen so we can help you.
Well, what kind of data are you expecting? After the initial number series ending with 'u' i would assume it's binary written as string and a typecast to an array of U32 (or whatever is the correct data type) would get you far.
Where is this data string coming from? Are you even sure you have all of the data? It is looking similar to a protocol I have seen Keysight use. The message starts with a "#" followed by a single ASCII character stating how long the length data is (in this case 8 ASCII characters). The length is then 00001000. So you should have 1000 bytes of raw data. What is that data? We need context to get any further.
We cannot work with a picture. At least attach a simple VI that contains the exact string data in e.g. a diagram constant.
We will only be able to help you once you provide full documentation. Where does the string come from (make&model of instrument, command used to request this reply, etc.)? Do you have the manual? Do you know the datatype? String structure of relevant parts? Byte order?
I would guess that taking the string from offset 10 on and then passing through a Unflatten from String node, with the datatype set to an array of I16 is all that is needed. You then only have to play with the endianness input of that node to see if you need to set it to big or little endian to get the expected values.
And please, how could i use that type? how to implement it to that Unflatten from String node.
Connect it to the "type" input.
Or are you asking how to create the type? Create an array constant, create a numeric, right-click the numeric and select "representation" and change to I16, drag the numeric into the array constant.