Parse a TCP driver string and store the extracted values in one table row

I have several checkweighers. They each spit out weighings on UDP every few seconds and I can pick them up with the TCP driver. The string received is in the format

Date=2020-06-12,TIME=9:11:44,MachineID=Pack1, ... ,Weight=23.60,Target=23.54, etc.

I parse these out into memory tags Date, Time, MachineID, Weight, Target, etc. successfully.

What’s the best way to store these in the default database?

  • I could do it with one row per weighing into a dedicated tabe but there would be a lot of
    redundant data such as the date and target weight that only change daily or with batch change.
  • I could use the default historian with a deadband or log on change but I’m never confident that the table queries will match up the related data on the same row of the table.

What’s the right approach here?

Do you have a batch ID to relate the weights to? I’d do a dedicated table with the unique information (date/time, machine ID, weight) along with a batch ID. Then you can link as many batch-related properties as you need (target, start/end times, other set points etc.) through additional tables.

1 Like

+1 to Ben’s suggestion. On a personal level, I’d probably combine Date and Time into a single timestamp column.

1 Like