02-26-2013 04:30 AM
Hello All,
i have a 3 different strings of Ascii which i want to convert into Hex with a Checksum,
however i think i have gone wrong somewhere,
if i have one of my strings as a U8 and the others as U16 and U32 my byte array will not add the elements together, unless i
make all of them them a U32 (which i dont want) as i will have extra 0s padding my string, when i put them together
can someone help me with this please.
Thanks in advance
Thomas
Solved! Go to Solution.
02-26-2013 04:32 AM
02-26-2013 04:34 AM
Post your VI friend (2011) with your required input.
02-26-2013 04:55 AM
on the front panel i have Addr Data and command Data needs to be of a variable length however read/write only needs to be a Unsigned 8 i dont want any zeros in the concatnated string but when if i do this i can bnot add the elements in the array for the checksum
02-26-2013 04:58 AM
also i know there are alot of things that dont need to be there they are only there for my purposes only and will be remove one i have it working!!
02-26-2013 04:58 AM - edited 02-26-2013 05:00 AM
Hi Thomas,
can you also give some typical data?
It doesn't seem to be useful to typecast some strings to convert them back to strings to again convert them to an array of numbers to decimate that array. Seems not useful at all...
So we need:
- typical data for "addr", "status" and "Data"
- result needed for those data
- formula for your checksum calculation
02-26-2013 05:18 AM
addr ="xxxx"
data= is variable length
status= 4 Ascii caracters
read/write=r or w
checksum= sum of all above in hex or with 80hex
02-26-2013 05:19 AM
checksum= sum of all above ORed with 80hex
02-26-2013 05:33 AM
02-26-2013 05:53 AM
thanks GerdW one quick question i see that you ff anded with the result could you explain that to me please,
it works like a dream!! i didnt even know that i had a add array element function