AGG Software Forums

Online Help Center => Data loggers and plug-ins => Topic started by: skyleet on December 28, 2009, 01:50:42 PM



Title: Parser to Excel problems..
Post by: skyleet on December 28, 2009, 01:50:42 PM
hi,

I have a problem whit the parser.
i writed a uc program that sense a value and sent it to te pc, de following string come's directly form the uc:

a0684#0D
a0684#0D
a0682#0D
a0682#0D
a0682#0D
a0682#0D
a0682#0D
a0682#0D
a0682#0D
a0682#0D
a0683#0D
a0683#0D
a0683#0D
a0682#0D
a0682#0D
a0682#0D
a0682#0D
a0684#0D
a0684#0D
a0682#0D       only for test 20 "a" value's if all is working well this will be about 100+ value's
v0683#0D
i0910#0D
n0001#0D

this string is always the same.. only the value's are changing.
i set up the parser:
Sign of data packet's beginning: "[a-z]"    RE
Sign of data packet's ending:     "#0D".

the parser params:
item name: A
parsers type: fixed position
data type : integer
Fixed position: 0
Fixed length: 4
all the same for v, i and n.

if i now export this whit the direct excel connection he just fill in all the cells disregarding the letters.

what i want is all the "a" value's on a vertical row in colum A.. and the other's ( v, i, n) on a fixed position in other cells.
when a new string arrives all the previous t value's must be overwriten

i am trying it for days now but cant get it work :-\

i hope some one can help me...


Title: Re: Parser to Excel problems..
Post by: Arthur Grasin on December 28, 2009, 02:00:51 PM
Because all your data come to one serial port then you should define parser items like:

item name: ATYPE
parsers type: fixed position
data type : string
Fixed position: 1
Fixed length: 1

item name: AVALUE
parsers type: fixed position
data type : integer
Fixed position: 2
Fixed length: 5

You should activate the Script Execute plugin and write a small script that will place a value from the AVALUE item to different variables, depends on ATYPE value.

Also you may use Expressions data filter plugin and specify expressions like:

COL1 = IIF(ATYPE='a', AVALUE, '')
COL2 = IIF(ATYPE='n', AVALUE, '')
COL3 = IIF(ATYPE='v', AVALUE, '')

Please, note that the "Parse full data packet" option should be on.