12-04-2019 04:36 PM
HI Bob,
that is basically it. All I want to do is replace that for loop that builds an array (data bytes written indicator) with a byte array converted from a string. Thank you for your help
Joe
12-05-2019 07:32 AM
OK, Joe, we are ready to help you (or at least get you closer to what you want to do). Here's what you do:
Bob Schor
12-06-2019 08:02 AM - edited 12-06-2019 08:03 AM
@joeross wrote:
sure... say it is a module number for example AF1234... i want to convert this into a hex byte array to save to an EEPROM.. then read it back from the EEPROM and convert it back to the string.. thanks for your help
A byte array stores an array of 8 binary bits. It doesn't care if you want to look at the number as hex, decimal, or as a character.
It would be easier if you told more about the expected conversion. But as i understand it you have a string of hexadecimal numbers where pairs of two numbers represent a byte. So the string "AF1234" shall be converted to an byte array with the values 0xAF, 0x12, and 0x34 (175, 18, 52 in decimal)
Is this what you need?
Use "Number to hexadecimal string" to convert from byte array to string array and then concatenate the string array when going the other way around.
12-06-2019 08:22 AM - edited 12-06-2019 08:24 AM
@joeross wrote:
sure... say it is a module number for example AF1234... i want to convert this into a hex byte array to save to an EEPROM.. then read it back from the EEPROM and convert it back to the string.. thanks for your help
Or if you want the string "AF1234" to be converted to byte array with values 0x41, 0x46, 0x32, 0x32, 0x33, 0x34 (65, 70, 49, 50, 51, 52 in decimal) then use the "String to byte array"-function.
I have LabVIEW 2012 so have not looked at the code attached earlier.
12-09-2019 08:53 AM
this worked! thank you everyone for their help
joe