AGG Software Forums
November 25, 2024, 12:28:51 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome on our forum!
 
   Home   Help Search Login Register  

Pages: [1]
  Print  
Author Topic: Parser to Excel problems..  (Read 13081 times)
skyleet
Newbie
*

Karma: +0/-0
Posts: 2


View Profile
« 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 Undecided

i hope some one can help me...
« Last Edit: December 28, 2009, 01:53:34 PM by skyleet » Logged
Arthur Grasin
Tech. Support
Administrator
Hero Member
*****

Karma: +0/-0
Posts: 806



View Profile WWW
« Reply #1 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.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines