03-01-2023 01:03 PM
I apologize for the unhelpful title, but I'm not sure how to explain this.
I have a list of "hex-like" values that are payloads captured from tcp packets between third party software and a lab device. The software sends commands to the device over TCP and those are the packets I have captured.
Wireshark exports the data into "hex like" strings such as "59454d0d50" or "5851562c320d01" and I have saved them into a list. When I read this list into LabVIEW using "Read from Text File", I get strings in that same format e.g. "59454d0d50". The problem is that this string is not what I want to use. It's not interpreted as "hex" it's interpreted as an ascii string. However, if I copy and paste this value into the str control with "display as hex" enabled, the str is "parsed" correctly and I get the true value I am looking for, which is some weird ascii value (see the images). Is there some way to get LabVIEW to parse this without needing to copy and paste into a string control?
Solved! Go to Solution.
03-01-2023 01:39 PM
03-01-2023 06:56 PM
03-02-2023 01:13 AM - edited 03-02-2023 01:16 AM
Hello,
look at this tutorial:
https://forums.ni.com/t5/LabVIEW/Complete-String-Conversion-Tutorial/m-p/4245188#M1234546
Perhaps recipe 05 or 06 is, what will help you.
P.S. I didn't quite understand, what kind of data you expect and how it is to be further processed. Do you expect numeric values? A text string? Please explain.
03-02-2023 01:41 AM
Just another version as suggested by @GerdW
03-02-2023 07:48 AM
Thank you for all the replies. I won't be able to test them for a few days, but I will give them a try and let you know once I do.
03-02-2023 08:46 AM
The goal is to send a correctly formatted string using the TCP Write VI. I want to send the true ascii value of the "hex-like" strings I have, which means I need to convert them in some way. The ascii string "59454d0d50" is not the "hex" string "5945 4D0D 50" which has an ascii value of something like "YEM\rP". That value is what I want to send via TCP Write.
03-02-2023 10:41 AM
This should do the trick. Had to make it once for myself.
03-09-2023 08:28 AM
Each of the three vi examples submitted gave me the output I was looking for. GerdW was first and thus wins the trophy. Thanks again for your help.
03-09-2023 08:44 AM