19.09.2016, 12:12
(18.09.2016, 21:31)Erwin van der Zwart Wrote: Hi Buuuuudzik,
Try this:
Code:-- String to HEX
strvalue = 'this is my string'
result = lmcore.strtohex(strvalue)
log(result)
-- HEX to String
hexvalue = '74686973206973206D7920737472696E67'
result = lmcore.hextostr(hexvalue)
log(result)
-- Remove last 2 chars (or checksum)
strvalue = 'this is my string'
result = string.sub(strvalue, 0, (string.len(strvalue) -2))
log(result)
BR,
Erwin
Hey Erwin,
thanks for your help but unfortunately it not works probably because I can't use hex in this way:
Code:
hexvalue = '74686973206973206D7920737472696E67'
but only in this way:
Code:
command = string.char(0xBF,0xF4,0xFA,0xB8,0x43,0xFA,0x00,0x00,0x00,0x04,0xA2)
Is there any way to convert such data to string?