Skip to content

Cargill Hersey

Configuration Disclaimer: The configuration values shown here are based on repository reference files. Production configurations may differ. Always verify against the actual appsettings.json on the production machine.

Quick Reference

Field Value
Site Cargill Salt -- Hersey, PA
Validation Mode CargillSalt
Version hersey-v0.114
Config File appsettings-cargill-hersey.json
Controller Arduino Portenta H7 (TCP)

Hardware Inventory

Device Type Connection Address
Camera Cognex Insight (OCR) TCP (camera pushes to app) 0.0.0.0:8890 (app listens)
Controller Arduino Portenta H7 TCP 10.191.0.95:502
Data Source NetworkFileImporter File polling D:\DB (prefix: PR001059)
Stack Lights Via Arduino Digital outputs Pins 4/5/6 (R/Y/G)

Arduino Pin Map

Pin Function
7 DeviceTrigger (photo-eye input)
6 Stack Light Green
5 Stack Light Yellow
4 Stack Light Red
3 Horn (StackLightAlarm)
2 SystemReady
1 MachineStop
0 RejectSignal

Normal Operating State

When everything is working correctly at Hersey:

  • Screen: Shows the GateKeeper application with live camera image displayed. Validation mode shows "CargillSalt". The status bar shows hardware connected (Camera, Arduino).
  • Stack lights: Green light is ON when validation is running and cases are passing. The SystemReady output (Pin 2) is ON when validation is active.
  • Camera image: A live camera image should be visible in the UI panel (InsightImageDisplayEnabled is on).
  • File import: The system polls D:\DB every 10 seconds for files starting with "PR001059". When a new production file arrives, the expected date is updated automatically.

Validation Flow

  1. A production data file (e.g., PR001059_20260206_120000.txt) is placed in the D:\DB folder by the upstream system.
  2. The NetworkFileImporter detects the file within 10 seconds and reads it.
  3. The file's second line is parsed (semicolon-delimited) to extract the expected GTIN and expiration date.
  4. Validation mode is set to CargillSalt and the workflow auto-starts.
  5. A case passes through the conveyor and breaks the photo-eye beam (Arduino Pin 7).
  6. The Cognex Insight camera triggers, captures an image with OCR-read barcode, and pushes it to the application over TCP port 8890.
  7. The barcode (format: PRODUCTCODE;PLANTCODE;MM/DD/YYYY) is extracted from the camera data.
  8. The expiration date in the barcode is compared against the expected date from the production file.
  9. PASS: Green stack light. FAIL: Red stack light, reject signal fires (250ms), and if FailuresBeforeStop is reached (set to 1), the line stops.

Common Issues

OCR Not Reading Date

What you see: Camera appears connected but validations keep failing with "No barcode read from camera" or the wrong date is extracted.

What to check: - Look at the live camera image in the UI. Is the date text visible and in focus? - The barcode format must be PRODUCTCODE;PLANTCODE;MM/DD/YYYY -- if the camera reads something different, the OCR region in Cognex Insight EasyBuilder may need adjustment (escalate to engineering). - Check if the product label has changed or print quality has degraded.

SystemReady Light Not On

What you see: The external "System Ready" indicator does not light up when validation is turned on.

What to check: - Verify validation is actually ON (check the application screen). - In the Diagnostics panel, check that the Arduino controller shows "Connected". - The SystemReady output is on Arduino Pin 2.

Live Camera Image Not Showing

What you see: The image panel in the UI is blank or shows "Image not available."

What to check: - InsightImageDisplayEnabled should be true in appsettings. - Verify the camera is triggering (check logs for "Camera connection accepted" messages). - The camera must be configured to send BMP format images. If it sends PNG or JPG, the application rejects them. - Check the InsightImageTimeoutMs setting (default 3000ms). If the camera is slow, this may need increasing.

Production File Not Being Picked Up

What you see: A new production file is in D:\DB but the application still shows old expected values or "No expected barcode available."

What to check: - Does the filename start with "PR001059"? (The prefix filter is configured.) - Is the file locked by another process? - Check the application logs for "No files found matching criteria" or file read errors. - Try restarting the application.

Known Quirks

  • Camera is TCP server mode: Unlike all other sites, the Insight camera pushes data to the application. The ConnectionString in the config (0.0.0.0:8890) is the application's listen address, NOT the camera's IP. This is correct and expected.
  • Lot numbers are ignored: The production file may contain a lot number field, but CargillSalt mode deliberately ignores it per the client's requirements.
  • Only BMP images: The Insight camera must send images in BMP format (format code 0). Other formats are rejected. This is a legacy requirement.
  • Historical image viewing: You can click on any past validation in the history list to see the camera image from that validation. Click "Show Current" to return to the live view.