LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

32Bit Word to String

I currently have an 8byte array that I typecasted down to 2 32bit-word values since the 8byte array needs to be split in half resulting in 2 4-byte strings. I thought it would be easier to typecast it down to 2Words then convert each word to separate strings. Maybe there's easier way, not sure. Any ideas?

 

 

0 Kudos
Message 1 of 14
(4,097 Views)

Can you give a clear example of how you want the string formated?  Please give clear input and output.

 

Without knowing what you want, you should look at the Byte Array to String function or the Number to Decimal String function.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 14
(4,085 Views)

Hi, I've attached an example of what I need to do. I have 2 strings I need to convert to an 8Byte output array, then I need convert the 8Byte array back into the 2 4byte strings. Does this make sense?

0 Kudos
Message 3 of 14
(4,073 Views)

You do not show what the actual strings are. Are they "binary" strings, or are they "textual" strings? In other words, do you see hex values when the string control is set to normal display, or do you see funny characters? Do you see the hex characters when you set the string to "hex display mode"? Where are the string contents coming from? The exact content of the string matters in terms of what you need to use.

0 Kudos
Message 4 of 14
(4,068 Views)

What format are your strings? Are they the ASCII representation of a number or are they binary data? What exactly are you doing? Yes, we know you want to convert but what will you be doing with the data? How is it being used? There are several ways to accomplish the conversions and the right way will depend on what you are doing with the data.

 

The most basic method would be this:

 

String to Byte Array.png



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 14
(4,066 Views)

Here is what I need to accomplish. I have an 8-byte array of data that contains 2 sets of data, bytes 0-3 are Latitude in dd.ddddd (degrees) and 4-7 are Longitude also in dd.ddddd (degrees) format. I need to convert each string containing the Latitude and Longitude and combined them into the 8 byte array with the Latitude placed in bytes 0-3 and Longitude in bytes 4-7. Then I need to be able to get them back out of the 8 byte array and place them back into the strings. Does this make more sense?

 

Thanks so much...

0 Kudos
Message 6 of 14
(4,054 Views)

Still not telling us what this string looks like...

 

Also, what does "bytes 0-3 are Latitude in dd.ddddd (degrees)" mean? Is byte 0 the first 2 d's? Are the 4 bytes a 32-bit number? How do you go from that 32-bit number to "dd.ddddd"?

0 Kudos
Message 7 of 14
(4,043 Views)

I think I'll just simply things and store the GPS coordinates in 32-bit fixed point representation. That will be alot easier then converting strings with floating points back and forth plus I only have 32bits available for each value anyway. Thanks for you help.

0 Kudos
Message 8 of 14
(4,028 Views)

Hi,

 

       Look at my solution, is it what you need?

 

8 bytes - Latitude Longitude.png

 

Best Regards,

Luis A. Mata C.
Ing. Electrónico
Whatsapp: +58-414-1985579
BBM Pin: 2B83E99A
Thanks: Kudos
0 Kudos
Message 9 of 14
(4,027 Views)

Thanks Luis, this is exactly what I needed 😃  Could you post the VI example for it?

Thank you so much...

0 Kudos
Message 10 of 14
(4,023 Views)