AGG Software Forums
November 23, 2024, 09:29:44 PM *
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: Advanced Serial Data Logger: Parsing redirected data  (Read 11195 times)
TheZbunj
Jr. Member
**

Karma: +0/-0
Posts: 5


View Profile
« on: December 14, 2012, 05:31:57 PM »

Hi,

I am reading print out from device on COM2. The print out has format looking something like this:

Load number: 000007#0A
#0D#0A
#0DTicket Number     Preset      Volume#0A
#0D-----------------------------------#0A
#0D000012              000100     GRS 000099#0A
#0D000013              000150     GRS 000151#0A
#0D#0C
 
I am trying to fill database based on print out with following rows:
7;12;100;99
7;12;150;151

I can't use only fixed position parsing because number of Tickets in print out is variable. So I came out following idea:

1. On COM2 configuration use entire print out as datapacket and parse only "Load number" with fixed position.
2. Redirect datapacket to COM3.
3. Parse "Tickets" in configuration on COM3.
4. Use Aggregation to merge data from COM2 and COM3 and export it to database.

However, problem is that redirected data doesn't get parsed when it is received on COM3. It is like you can't parse same data twice, even if it is on separate COMs.

Is it possible to parse redirected data?



Logged
Arthur Grasin
Tech. Support
Administrator
Hero Member
*****

Karma: +0/-0
Posts: 806



View Profile WWW
« Reply #1 on: October 24, 2022, 02:00:00 PM »

I think you can do it in one configuration. I see the following logic:

1. ASCII parser will extract rows using the #0D#0A delimiter.
2. You will extract parser items using regular expressions (4 items, including "Load number").
3. In the Script Execute plugin analyze parsed variables.
  3.1 If "Load number" is not empty, then store it (using the "PushVariable" function) and discard the current data packet.
  3.2 If "Load number" is empty, then get stored "Load number"
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines