News:

Welcome on our forum!

Main Menu

Parsing a hex data stream

Started by mccallum4004, June 18, 2010, 07:48:38 PM

Previous topic - Next topic

mccallum4004

I receive a data stream in binary that I am trying to parse.  I have parsed the data as a word (unsigned integer).  The parser apparently finds the correct portion of the data but when exporting via DDE, I get the message "'+' is not a valid integer" for the hex word 2B 07.  Since 2B is the ASCII for +, I assume this is doing something correctly.  Why doesn't the word data type accept two bytes?  And why does it try to make it an ASCII character rather than an integer?  The data is also in little endian format.  Can this program read that correctly?  I find no option for setting this parameter.

Arthur Grasin

Please, select the "String" data type for your parser item. Then convert this variable to a WORD value with help of the Expressions plugin.
If you like my work, please take a few seconds and add feedback about our site or our software [here]

mccallum4004

Will the Expressions plugin work for arrays or do I need to use the scripting plugin?  Once I get the array, I will want to subtract a vector, mulitply it by a cosine of the index, and sum over the array.  It seems like it might be best to go directly to the scripting plugin if I will be needing it later.

Arthur Grasin

QuoteIt is not clear exactly what these functions do.  For example, I have an array of hex in little endian format. When I run WORDTOSTR(X) on that data, I get an integer that seems unrelated to the input array, X.  Does this function operate on the entire array?  Just the first two bytes?

This function operates with 2 bytes only.

QuoteThis topic refers to 'arrays' but can the expressions module work with arrays or does one need the scripting module to do this?

The scripting module is more flexible and it is better for your task.
If you like my work, please take a few seconds and add feedback about our site or our software [here]

mccallum4004

Thanks.  For the most part, I have this working and purchased a license yesterday.  From the time stamps on this forum it looks like we are 10 time zones apart.  Considering that, the help from this forum has been all that I could hope for.