From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UDP Data format

Solved!
Go to solution

Hi,

I am using a cRIO 9031 to collect UDP data and save it to a file. Is there a way to save the raw UDP data anything other than string form? For example the first line of the UDP data is 

SCN1 0400 0000 8E0D 4904

But when i save the data using Write Binary or Text file, it saves is as
SCN1   ŠUQ~  
I would like to preserve the original form of "SCN1 0400 0000 8E0D 4904".
Any ideas what I am doing wrong here?? 
0 Kudos
Message 1 of 4
(3,003 Views)
Solution
Accepted by topic author rcee

This is hex-string. You can transform string to numbers and then numbers to hex-string

hex.png

Message 2 of 4
(2,954 Views)

Thanks for the quick response. It worked. 

0 Kudos
Message 3 of 4
(2,942 Views)

@Artem.SPb wrote:

This is hex-string. You can transform string to numbers and then numbers to hex-string

hex.png


That innocent looking red dot on Number to Hex String is your data being exploded into a U64 array before conversion.  If you are doing this operation many times or on long strings you should wrap that primitive in a For Loop.  The scalar version does not coerce the input to U64 so it is faster.  One of the very few instances where a loop + function in G is faster than passing an array directly to a function.  Seeing that this is still happening in LV15 probably means I should give up hope of it being fixed.

Message 4 of 4
(2,927 Views)