09-18-2007 06:47 AM
09-18-2007 10:26 AM
@chefcommander wrote:
it work, but can you explane what the "and" with the 00FFFFF make? and how do i find this constant "00FFFFF"
and the second part is, that i can right readout the string, but i also use typ cast, and what is the type? i can#t see it in your picture
The 00FFFFFF is just a plain U32 diagram constant where I changed the format for convenience (these are hard to enter in decimal without making your head spin ;)). Place a numeric diagram constant, change its representation to U32, then right-click ... format&precision and select (hexadecimal, 8 digits, pad with zeroes).
If we read the data as little endian, the four bytes get reversed and the x20 is highest order in the U32 (see string output set to hex display). Logical operations on numerics are done bitwise, so if we do a logical AND of any number with another number containing 00FFFFFF, we are clearing the first eight bits, leaving the other 24 bits unchanged. This is oftern called a masking operation.
For example, the first number in the file is 204C74C4, masking it with 00FFFFFF will turn it into 004C74C4. Masking the entire array will simply replace all x20 with x00. Simple, right?
If you don't wire the type for the typecase, it will cast to a string. That's all we need, so leave the type unwired. 🙂 Notice that my string is set to hex display (right-click) and uses a fixed width font (Courier) font to keep the numers aligned. A proportional font does not look great here.
09-19-2007 07:15 AM