ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

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,884 Views)
Solution
Accepted by rcee

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

hex.png

Message 2 of 4
(3,835 Views)

Thanks for the quick response. It worked. 

0 Kudos
Message 3 of 4
(3,823 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
(3,808 Views)