Check Duplicated Barcodes


I hope this topic find you well!

We rarely have this issue but i would like to add into my method some strategy to check if the loaded barcodes contains duplicated entries. We have methods where we compare barcodes between different racks or loaded labware versus worklist, however, we don’t have any method checking for duplicates in the same labware or sequence.

I tried the following strategy: Load (smart step), store loaded barcodes (from samples) in an array using loop. From here i tried to write a temporary file that i named “Pseudo worklist” but i found some issues later on:

1. Comparing my array with my pseudo worlist with Mth library return true / false
2. "If" doens't know how to deal with boolean outcomes. Only numeric. 
3. (still trying to reach this part) My code is supposed to pop a custom dialog asking for a new barcode in one of duplicated positions if duplicated entries exist.

The logic is supposed to happen as follow:
a) load samples
b) acquire barcodes
c) write into a temporary file
d) compare with array
e) if duplicated values exist, get positions and ask for a new barcode (operator should select which one he want to replace)
f) continue with our new barcode

Any suggestion?

edit: Venus 4
Thank you for your time!

You can refer to the example method Barcode Scan and File Tutorial for an example of how to import the barcodes from the file into an array and then compare that array to the found/scanned barcodes. It uses the Array library from the HSL Extensions installer which also includes a function to check if an array Contains Duplicates.

There’s also some additional example methods you can find in the VENUS programming challenges zip.

I hope this helps!

1 Like

Helped a lot! Easier than i thought thanks to the ContainsDuplicates from the HSLExtensions. Initially my approach was based on HSL until i noticed that HSL doens’t replace the logic behind built-in functions.

Now i just need to work on getting the position of my duplicates.

Once again, thank you!