Reading Multiple Barcodes from the SICK SEC200 over TCP/IP

This engineering brief introduces the SICK SEC200-USBZ112ZZZZ sensingCam (SEC) as shown in Figure 1. It demonstrates a method of retrieving the barcode data over a TCP/IP socket and concludes with a running list of challenges I personally encountered while operating the unit.

The official SICK literature for the image-based code reader is located here. This prerequisite page includes videos showcasing the scanner in operation. It also contains product overview and operating instructions.

Key Takeaways

  • Multiple barcodes may be read from a single scan. Your application must protect against obscured or missing records as well as unpredictable order of arrival.
  • The featured SEC uses mDNS for local name resolution ‘sec200-sick.local’.
  • TCP/IP is disabled by default.
  • The featured SEC connects via a high-power USB-C connection. An Ethernet variant with M12 connectors is available.
  • The SEC uses STX (‘0x02’) and ETX (‘0x03’) framing by default. Parse these message boundaries rather than treating raw TCP receives as complete barcode records.

This article is part of the DigiKey Field Guide for Industrial Automation

Location: Understand It → Sensors
Difficulty: :wrench: Technician — difficulty levels explained
Author: Aaron Dahlen | MSEE | Senior Applications Engineer, DigiKey, Author bio.
Last update: 24 Sep 2026


Figure 1: Image of the SICK SEC200 with the green orientation light illuminating a QR code.

From Scan to Barcode Data

The SEC is designed to capture 1D and 2D barcodes. I explored two ways to retrieve the information:

  • Keyboard: This SEC defaults to keyboard-like operation. In this configuration, each scan will output a string as if it were a keyboard. For example, this was written directly in my Notepad++ editor:

    FMY244500807
    AC164162
    MY

    Note that the SEC captured all three 1D barcodes from the Microchip PIC box shown in Figure 2. That’s three barcodes from a single scan.

  • TCP/IP: The same scan data may be transferred using a TCP/IP socket. In this case, new data are sent upon arrival. For example, scanning the Microchip box using Python code yields:

    Raw data: b’\x02FMY244500807\x03\x02AC164162\x03\x02MY\x03’
    Decoded: FMY244500807
    Decoded: AC164162
    Decoded: MY

Figure 2: Image of the 1D barcodes on the box of Microchip Curiosity adapter board.

Tech Tip: There is no guarantee that the SEC will pick up all barcodes. For example, if my thumb covers up one of the codes as shown in Figure 2, that portion will not be read. It is up to you, at the application level, to determine if the requisite number of barcodes have been read.

Do not assume a fixed delivery order. It appears to depend on the orientation of the barcode label. In my opinion it’s better to correct for delivery in code than to depend on proper label orientation.

Multicast DNS

The SEC may be accessed using the Multicast DNS (mDNS) name ‘sec200-sick.local’. Note that this connection is limited to the local network. Refer to SICK’s knowledge base for additional information.

On a related note, there is an Ethernet variant of the SEC as shown in Figure 3. The M12 connectors may be more at home in your OT environment next to your PLC. It’s up to you to establish the IT vs OT boundaries for your industrial automation system.

Figure 3: Image of the Ethernet variant of the SEC200.

TCP/IP Code Example

The rudimentary Python script for the SEC is presented in Listing 1. This AI code is provided for demonstration purposes only.

Note:

  • Incoming data is appended to a buffer via the statement ‘buffer.extend(data)’. We then iterate looking for the STX (‘\x02’) as start of text and ETX (‘\x03’) as end of text.
  • The default SEC TCP/IP configuration is used as shown in Figure 4.
import socket

HOST = "sec200-sick.local"
PORT = 2112

buffer = bytearray()

with socket.create_connection((HOST, PORT), timeout=10) as camera:
    print(f"Connected to {HOST}:{PORT}")
    print("Waiting for barcode scans...")

    camera.settimeout(None)

    while True:
        data = camera.recv(4096)

        if not data:
            print("SEC200 closed the connection.")
            break

        print("Raw data:", repr(data))
        buffer.extend(data)

        while True:
            start = buffer.find(b"\x02")

            if start < 0:
                buffer.clear()
                break

            if start > 0:
                del buffer[:start]

            end = buffer.find(b"\x03", 1)

            if end < 0:
                break  # Wait for the rest of this frame.

            frame = bytes(buffer[1:end])
            del buffer[:end + 1]

            message = frame.decode("utf-8", errors="replace")
            print("Decoded:", message)
            
# AI-Generated Code Notice: The preceding Python example was generated by ChatGPT. It is provided as an educational example and should be reviewed, tested, and validated for the intended application before use.

Listing 1: Rudimentary TCP/IP socket used to connect to the SEC.

Figure 4: SEC data-output configuration used for Listing 1.

Troubleshooting the SEC

This list describes several difficulties I encountered when setting up the SEC:

  • USB Power: The SEC is connected to a PC via a high-power USB. Initially, I used a USB-C to type A cable. This did not work as the easily accessible ports on my PC did not provide the 900 mA as specified in the SEC datasheet. This problem was eliminated by using my PC’s motherboard-mounted USB ports. An alternative is to use a USB-C to USB-C cable.

  • Firewalls: The initial connection to the SEC may be complicated by the PC’s firewall. My Norton software faithfully blocked access. This was easy to fix by temporarily disabling the Norton firewall. Once the firewall was temporarily disabled, we can connect to the SEC using device address ‘sec200-sick.local’ and then enter the password ‘servicelevel’.

  • HID Keyboard: Out of the box, the SEC is designed to operate as a Human Interface Device (HID). It operates just like a keyboard: click to where you want to type and there goes the scan data. This is a feature not a defect. However, for TCP/IP socket, this is the first thing that should be turned off. At the same time, the TCP/IP output must be enabled. These options are available in the ‘Data output’ menu. Failure to turn off the HID will result in what appear to be randomly placed typing after every scan.

Please add any problems you encounter with the SEC. Your attention to detail could save considerable time for a fellow technician.

About this Author

Aaron Dahlen, LCDR USCG (Ret.), is a Senior Applications Engineer at DigiKey in Thief River Falls. His background in electronics and industrial automation was shaped by a 27-year military career as both technician and engineer, followed by over a decade of teaching.

Dahlen holds an MSEE from Minnesota State University, Mankato. He has taught in an ABET-accredited electrical engineering program, served as coordinator of an electronic engineering technology program, and instructed military technicians in component-level repair.

Today, he has returned to his home in northern Minnesota, completing a decades-long journey that began with a search for capacitors. Read his story here.