AGG Software Forums

Online Help Center => Data loggers and plug-ins => Topic started by: mccallum4004 on June 18, 2010, 10:48:38 PM



Title: Parsing a hex data stream
Post by: mccallum4004 on June 18, 2010, 10:48:38 PM
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.


Title: Re: Parsing a hex data stream
Post by: Arthur Grasin on June 21, 2010, 08:30:54 AM
Please, select the "String" data type for your parser item. Then convert this variable to a WORD value with help of the Expressions plugin.


Title: Re: Parsing a hex data stream
Post by: mccallum4004 on June 21, 2010, 11:44:35 PM
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.


Title: Re: Parsing a hex data stream
Post by: Arthur Grasin on June 22, 2010, 09:16:43 AM
Quote
It 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.

Quote
This 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.


Title: Re: Parsing a hex data stream
Post by: mccallum4004 on June 22, 2010, 06:36:08 PM
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.