Your SICK ID gives you access to our extensive range of services. This includes direct online orders, price and availability checks, and access to our digital services.
How to receive measurement, field evaluation, and I/O data from a SICK picoScan100 on PLCs (Siemens, Beckhoff, Mitsubishi, Rockwell).
Related Products
picoScan100
Table of Contents
How to receive measurement, field-evaluation, and I/O data from a
SICK picoScan100 on modern PLCs (Siemens, Beckhoff, Mitsubishi, Rockwell) using the
CoLa protocol over TCP/IP. The focus is vendor-neutral concepts, best practices, and
common pitfalls, not ready-made function blocks.
No maintained function blocks
SICK does not ship dedicated picoScan100 function blocks for PLCs. Instead of copying
an outdated block, this guide explains the protocol so you can write a small, robust
receive routine on any controller.
Byte-level layouts live in the Telegram Listing
The exact field order of each telegram payload is defined in the Telegram Listing
section of the picoScan100 operating instructions. Always confirm offsets and
data types against that documentation for your firmware version before parsing.
Overview
1 - Scope and Approach
The picoScan100 is a 2D LiDAR sensor with several data interfaces. For a PLC, the
best choice is the CoLa command protocol over a plain
TCP/IP socket. Every mainstream controller can open a TCP client
socket, so no vendor-specific driver is required.
This article is built around four deliberate choices:
Decision
Recommendation
Reason
Protocol
CoLa B (binary) on TCP port 2112
Length-prefixed telegrams are easier to frame than CoLa A on 2111.
Direction
Focus on receiving data
Configure the device once via the web UI; the PLC only reads at runtime.
Data access
Polling (request/response)
Deterministic and simpler to synchronize with a cyclic PLC program than event streams.
Connection
A single bidirectional TCP socket
Send the request and read the answer on the same connection.
Interfaces
2 - Which Interface to Use
The picoScan100 exposes multiple interfaces. Knowing what each one is for prevents a
common mistake: trying to stream high-rate scan data over a protocol meant for
commands, or vice versa.
Interface
Transport
Best suited for
CoLa A / B
TCP 2111 / 2112
Command & telegram access from a PLC (the focus of this article).
Compact / MSGPACK
UDP or TCP
High-rate scan streaming to a PC or edge device.
REST / HTTP
TCP 80 / 443
Configuration, diagnostics, firmware update.
Migrating from TiM or LMS?
The picoScan100 operating instructions confirm that you can add the
LMDscandata format and receive it over TCP/IP. This makes the picoScan100
largely compatible with existing TiM/LMS receive logic, so much of your old CoLa
parsing can be reused.
Prerequisites
3 - Configure the Device First
Do not configure the sensor from the PLC. Set everything up once through the
on-board web server, then let the PLC only read at runtime. This keeps the PLC
program small and avoids writing parameters on every restart.
1
Set the network parameters
Give the sensor a fixed IP address reachable from the PLC subnet. Note the
factory default is 192.168.0.1/24, static.
2
Configure the application in SOPASair
Open http://<device-ip>/ in a browser. Select the scan
profile, define field-evaluation zones (teach-in), and assign digital I/O.
Field-evaluation groups must be created here first; they cannot be
created from the PLC at runtime.
3
Enable the LMDscandata output (if used)
For distance data, enable the LMDscandata format and apply the
bandwidth-reducing settings from §5.2.
4
Export a parameter backup
Save the full configuration as a parameter file. Re-importing it is the
fastest way to commission a replacement device identically, with no PLC
changes required.
Connection
4 - Connection Handling and CoLa B Framing
4.1 The polling loop
The PLC is the TCP client. It opens one connection to
<device-ip>:2112 and keeps it open. On each poll it writes a
request telegram, then reads the answer telegram on the same socket:
connect(device_ip, 2112) // once; keep the socket open
loop every cycle:
send( frame("sRN LMDscandata") ) // request
reply = receive_one_telegram() // answer: "sRA LMDscandata ..."
parse(reply)
on error or timeout:
close(); reconnect() // supervise the link
4.2 CoLa B telegram structure
CoLa B wraps every payload in a fixed, length-prefixed frame.
This is the key advantage over CoLa A: you always know exactly how many bytes
to read, so you never have to scan for a terminator.
Field
Size
Content
Start
4 bytes
02 02 02 02 (fixed magic)
Length
4 bytes
Number of payload bytes, big-endian
Payload
N bytes
Command type + name + data, e.g. sRN LMDscandata
Checksum
1 byte
XOR of all payload bytes
A complete request for the scan data telegram looks like this on the wire:
Because TCP is a byte stream, one read may return a partial telegram
or several concatenated telegrams. Do not assume one read equals one
telegram. Use the length field to reassemble:
receive_one_telegram():
wait until buffer has ≥ 8 bytes // start (4) + length (4)
verify buffer[0..3] == 02 02 02 02
len = big_endian_u32(buffer[4..7])
wait until buffer has 8 + len + 1 bytes // header + payload + checksum
payload = buffer[8 .. 8+len-1]
checksum = buffer[8+len]
verify xor(payload) == checksum
remove the consumed bytes from the buffer // keep any remainder
return payload
Why this matters
A length-prefixed reader is the single most important piece of robust CoLa B
code. It handles fragmentation, coalescing, and re-sync after a glitch with the
same few lines.
Telegrams
5 - Telegram Reference
These are the telegrams a PLC typically reads. Each is requested with
sRN <name> and answered with
sRA <name> <data>. Field-by-field byte layouts
are in the Telegram Listing section of the operating instructions; parse against those.
Telegram
Purpose
Notes & pitfalls
SCdevicestate
Overall device status (ready / busy / error).
Poll at a low rate as a health check before trusting other data.
LMDscandata
Distance (and optionally RSSI) measurement data.
Large. Keep it below the network MTU; see §5.2.
perpendicularDistanceResult
Min/max perpendicular distance to a zone boundary.
Stale-value trap; see the warning below.
FieldEvaluationResult
Occupied/free state per evaluation group.
Map each group index to the zone you configured in SOPASair.
LIDoutputstate
State of the digital output pins.
Useful to mirror sensor-driven outputs in the PLC image.
LIDinputstate
State of the digital input pins.
Reads the physical inputs wired to the sensor.
5.1 SCdevicestate: the health check
Request sRN SCdevicestate. Treat any non-ready state as a reason to
hold or invalidate the measurement values you are using downstream. This telegram
is described in the Telegram Listing section of the picoScan100 operating instructions.
5.2 LMDscandata: keep it under the MTU
The scan-data telegram can grow large. If it exceeds the network MTU
(typically 1500 bytes) it is split across several TCP segments, which makes
reassembly slower and more error-prone on a PLC. Keep it small at the source with
these device settings:
Setting
Effect
Use one echo only (first or last)
Removes duplicate distance values per beam.
Disable RSSI / intensity output
Roughly halves the per-point data.
Restrict the angle range
Only stream the sector you actually need.
Choose the coarsest acceptable angular resolution
Fewer beams per scan.
Rule of thumb
Configure the smallest telegram that still satisfies your application. A telegram
that fits in a single MTU can be read with one length-prefixed pass and no
reassembly logic.
This telegram is described in the Telegram Listing section of the picoScan100
operating instructions.
5.3 perpendicularDistanceResult: the stale-value trap
Value updates only while the field is infringed
When the perpendicular-distance field is no longer infringed,
sRN perpendicularDistanceResult keeps its last value instead of
updating.
This telegram is described in the Telegram Listing section of the picoScan100
operating instructions.
5.4 FieldEvaluationResult: zone states
Returns a free/occupied state per evaluation group. Because groups are created and
numbered in SOPASair, keep a mapping in the PLC from group index to physical zone
so the states are meaningful to the rest of the program. This telegram is described
in the Telegram Listing section of the picoScan100 operating instructions.
5.5 LIDinputstate / LIDoutputstate: digital I/O
Read the current input and output pin states with
sRN LIDinputstate and sRN LIDoutputstate. This lets the
PLC see the sensor's I/O without extra wiring; useful when a zone result is
also mapped to a physical output pin. These telegrams are described in the Telegram
Listing section of the picoScan100 operating instructions.
Controllers
6 - Vendor-Specific Notes
The protocol is identical on every controller; only the socket API differs.
6.1 Siemens S7-1500 / S7-1200 (recommended)
Use Open User Communication. The native picoScan100 example
establishes the socket with TCON_IP_v4 and moves data with
TSEND_C and TRCV_C:
Parameter
Value
Meaning
ConnectionType
17 (0x11)
Native TCP connection.
ActiveEstablished
true
PLC opens the connection (it is the client).
RemoteAddress
sensor IP
The picoScan100 address.
RemotePort
2112
CoLa B port.
TRCV_C.ADHOC
true
Receive variable-length data; RCVD_LEN gives the actual count.
Drive TSEND_C.REQ with a one-shot to send a request, and keep
TRCV_C.EN_R enabled to collect answers into a receive buffer. Then
apply the length-prefixed reader from §4.4 on that buffer.
One connection vs. two
It is possible to open two connections to the same IP and port (one to send,
one to receive). For a polling design we recommend a single bidirectional
connection: send the request and read the answer on one ID. The
two-connection variant also works.
6.2 Siemens S7-300 / S7-400 (legacy)
Older systems use a CP (e.g. CP343/CP443) with AG_SEND /
AG_RECV and the FB54 TCP function block. The CoLa payload
is identical; only the transport blocks differ. Mentioned for completeness;
prefer Open User Communication on new projects.
6.3 Beckhoff TwinCAT 3
Use the Tc2_TcpIp library. Open the socket with
FB_SocketConnect (remote port 2112), then
FB_SocketSend the request and FB_SocketReceive the
answer, feeding the bytes through the same length-prefixed reader. Supervise the
link and reconnect with FB_SocketClose / FB_SocketConnect
on error.
6.4 Mitsubishi (GX Works2 / iQ)
Use the built-in Ethernet socket services:
SP_SOCOPEN to connect, SP_SOCSND to send,
SP_SOCRCV to receive, and SP_SOCCLOSE to close. The same
framing and reassembly rules apply.
6.5 Rockwell / Allen-Bradley
Studio 5000 can use raw TCP through the socket object with
MSG instructions (connect / write / read / close).
Best Practices
7 - Best Practices & Common Pitfalls
Do
Avoid
Use CoLa B on port 2112 with a length-prefixed reader.
Scanning for terminators (CoLa A style) with variable-length data.
Keep one long-lived socket and supervise it.
Reconnecting on every poll (unnecessary overhead).
Reassemble telegrams using the length field.
Assuming one TCP read returns exactly one telegram.
Gate perpendicularDistanceResult with a freshness check.
Trusting a frozen distance value as a live reading.
Trim LMDscandata below the MTU at the source.
Streaming full-resolution, dual-echo, RSSI-on scans to a PLC.
Configure the device in SOPASair and back up the parameters.
Writing configuration from the PLC on every start-up.
Verify byte offsets against the Telegram Listing in the operating instructions per firmware.
Hard-coding offsets copied from an old LMS/TiM block.
Troubleshooting
8 - Troubleshooting
Symptom
Likely cause
Action
TCP connection refused on port 2112
Wrong IP/subnet, or the CoLa interface is disabled.
Verify the sensor IP and subnet; confirm CoLa B is enabled in SOPASair. Note 2112 is CoLa B, 2111 is CoLa A.
Connection opens but no answer to a request
Malformed request frame or misspelled command name.
Check the frame: 02 02 02 02 + length + XOR checksum. Command names are case-sensitive (e.g. sRN LMDscandata).
Sensor replies with sFA (error)
Variable not available, or not supported by this firmware.
Look up the error code in the Telegram Listing section of the operating instructions; confirm the variable name and firmware version.
Read blocks or the answer never completes
Reading a fixed byte count instead of using the length field; telegram split across TCP segments.
Use the length-prefixed reader (see §4.4): wait for 8 + length + 1 bytes.
Garbled or misaligned parsing
Several telegrams coalesced in one read, or leftover bytes from a previous telegram.
Consume exactly one framed telegram at a time and keep the remainder in the buffer.
Values look frozen
The same scan is read twice, or perpendicularDistanceResult is not updated while the field is clear.
Check that the scan counter/timestamp advances; gate zone distance with FieldEvaluationResult.
LMDscandata arrives truncated or fragmented
The telegram exceeds the network MTU.
Reduce the telegram at the source (one echo, no RSSI, restricted angle, coarser resolution); see §5.2.
Keywords: picoScan, PLC integration, CoLa protocol, TCP/IP, LMDscandata, Siemens S7-1500,
Beckhoff TwinCAT, Mitsubishi, Function blocks, Telegram parsing, best practices