Author Topic: Bar Code Verification App  (Read 8584 times)

seth350

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Bar Code Verification App
« on: January 07, 2018, 11:38:11 PM »
I don’t usually post my work but I would like to hear others thoughts. Feedback welcome.

My company wanted a system to verify that we are using  the correct components during assembly.
I managed to do this using the following:

AdvancedHMI running on RaspberryPi3 with Mono
Compactlogix PLC
Cognex 8050 WiFi scanner
Prosoft WiFi Radio (serves as hotspot for the raspberries)
SQL Server 2014

I tried to make this app as portable as possible. All stations are running the same exact app with an ini file for its settings. Running three stations at the moment. Each station is configurable using bits from the PLC to bypass or enable scanning of certain components at each station. We needed the ability to change where certain components get scanned during assembly. In the case of an absence or special case scenario.

The PLC is also used to connect to the scanners and relays the scanned data from the respective scanner to that scanners respective station. The SQL lookups are done in AHMI. I initially tried to use Factorytalk Transaction Manager, but AHMI was faster in getting the SQL data.

The jist of operation works as follows:
An operator must first scan a SKU or UPC Number to see what they should be scanning. AHMI receives the scanned code from the PLC and then determines if they scanned a SKU or a UPC. If valid, AHMI then requests the BOM from SQL using WHERE SKU/UPC=‘scan’. If data is received, AHMI creates a new data table and stuffs the received BOM into it. It will then send the BOM to a Station UDT in the PLC for retaining the data. AHMI will then check which components are enabled to be scanned and then build the listview with just those parts.
The operator can then start scanning their components to verify they are correct for the SKU/UPC being assembled.
As the operator scans each component, AHMI will verify the scan matches one in the listview and check off and highlight the row that was scanned. It will also determine if a component has already been scanned. The status area gives the operator information as to what effect their last scan had.
Once all components are scanned, AHMI will alert the operator and then clear all data from the listview and labels.

Wish list:
Ability to use more than one scanner per station. (Haven’t figured this out yet)
Use something other than Linux to run AHMI. Porting to Mono is full of gotchas.
Station performance metrics



Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Bar Code Verification App
« Reply #1 on: January 08, 2018, 08:29:45 AM »
Nice application! Out of curiosity, why did you use the Raspberry Pi instead of a Windows PC?

seth350

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Bar Code Verification App
« Reply #2 on: January 08, 2018, 09:17:07 AM »
Nice application! Out of curiosity, why did you use the Raspberry Pi instead of a Windows PC?

Thank you, Archie. I appreciate it. The RaspberryPi was already approved through IT to be used on the production floor. If I had installed a Windows PC, it would then need to have went through an auditing process and then setup to receive automatic updates and security patches. Not the best scenario for something that will need required restarts and running production.

Simply just chose the lesser of two evils. If the Windows PC didn't have all of the extra chutes and ladders, I would have used it.

 

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Bar Code Verification App
« Reply #3 on: January 10, 2018, 08:56:56 AM »
Do you have the part # of Prosoft Wifi Radio?

Cognex scanner is full of surprises (but not of their high price). I used to scan into PLC and either validate scanned data using PLC or .NET app, but recently I discovered it can do that as well.
I am very impressed when I can put in a regular expression like the one below and the scanner can validate without any problem.

Code: [Select]
[R]{1}[12]{1}[FWLR]{1}[MPW]{1}[ABCDEFGHJKLMNPRSTUWXYZ0123456789]{4}
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

timryder

  • Jr. Member
  • **
  • Posts: 84
  • Still trying to figure it out
    • View Profile
Re: Bar Code Verification App
« Reply #4 on: January 11, 2018, 04:12:01 PM »
Clear, simple... not too cluttered.  Good job :)

I've done tons of custom applications with the Cognex Vision products. I use their SDK's all the time for applications. 
Good work.
Still just trying to figure out this thing called Life.

seth350

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Bar Code Verification App
« Reply #5 on: January 16, 2018, 02:37:03 PM »
Thank you guys for the feedback.

Do you have the part # of Prosoft Wifi Radio?

Sure do. I used this guy here. RLX2-IHNF-A

Supports b/g/n

I've done tons of custom applications with the Cognex Vision products. I use their SDK's all the time for applications. 

I initially started that way and did achieve the same result. However I could not figure out how to handle the WiFi barcode scanner going into Sleep mode. This would close the tcp socket on the scanner side but leave the socket open on the .net app side. Even after the scanner came back online, the socket would still receive the scanned data, but the SDK would just ignore it. Rebooting the .NET app would get everything talking once again.

I finally gave up on that path and stuck the Compactlogix in to handle the connections to the scanners. I think it will be easier to manage and troubleshoot a problem using the PLC than in some tcp socket code, for me anyways.

The Cognex scanners also support Javascript, so you could *i assume* create an entire application that is housed only in the scanner.


Hasenkaber

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Bar Code Verification App
« Reply #6 on: February 14, 2023, 05:02:44 AM »
Hi there! I stumbled upon this old post and wanted to chime in. Nice work on making the app portable, too, with an ini file for each station's settings. I see you mentioned a wishlist item of using more than one scanner per station - have you looked into it since? Just wanted to throw it out there, but if you're ever interested in automatic document scanning and OCR, you might want to check out smartengines.com/. It saves me all the time when I have to send docs to our international partners. Anyway, keep up the good work!
« Last Edit: February 20, 2023, 07:28:42 AM by Hasenkaber »