AGG Software Forums

Online Help Center => Data loggers and plug-ins => Topic started by: TheZbunj on December 14, 2012, 05:31:57 PM



Title: Advanced Serial Data Logger: Parsing redirected data
Post by: TheZbunj 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?





Title: Re: Advanced Serial Data Logger: Parsing redirected data
Post by: Arthur Grasin 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"