# Logging bar code data and seeing if it's been scanned twice

**URL:** <https://forum.inductiveautomation.com/t/logging-bar-code-data-and-seeing-if-its-been-scanned-twice/19184>\
**Category:** Ignition\
**Created:** [August 9, 2018, 7:18pm UTC](https://forum.inductiveautomation.com/t/logging-bar-code-data-and-seeing-if-its-been-scanned-twice/19184 "2018-08-09T19:18:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephen.c.wilbur](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@stephen.c.wilbur](https://forum.inductiveautomation.com/u/stephen.c.wilbur)\
**Post date:** [August 9, 2018, 7:18pm UTC](https://forum.inductiveautomation.com/t/logging-bar-code-data-and-seeing-if-its-been-scanned-twice/19184/1 "2018-08-09T19:18:12Z")

</div>

We are trying to use ignition to data log from a barcode scanner. We also want the ability to if a barcode is scanned twice to write back to the plc with an error. Is this possible within ignition?

Warning— I am a little new to ignition

Thanks fro the help

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [August 9, 2018, 9:20pm UTC](https://forum.inductiveautomation.com/t/logging-bar-code-data-and-seeing-if-its-been-scanned-twice/19184/2 "2018-08-09T21:20:39Z")

</div>

Yes, it’s possible.

I admit it, I was feeling a bit snarky there. I was going to leave it there, since there’s not a lot to go on, but here’s my take on it. (My view is from a manufacturing standpoint)

First, though, welcome to the forums! Don’t let my lack of sleep or caffeine trouble you. 🙂

At the beginning of the cycle, it should be assumed the part is bad until told otherwise from the process. It’s the same with duplicate scans.

I would do this with a transaction group.

- The scan comes in as a read-only item.

- A query expression item to check if there are any duplicates. If it returns 0, there is no duplicate. More than 0 is a problem.

```auto
SELECT count(*)
FROM table
where barcode = '{new_scan_item_in_group}'

```

- send status back to PLC

This is just a rough outline, but a transaction group, IMO, is the least painful way to go.
