Skip to main content

AI-POWERED DOCS

What do you want to know?

PLC User Data

User Data is a block of up to 464 bytes that the PLC writes to the camera over Industrial Ethernet. The camera does not interpret these bytes by itself. You give them meaning by adding a variable at a byte offset, for example a 16-character serial number at bytes 0 to 15.

User Data offsets run from 0 to 463. That is the number you type as Offset (byte) when you add a variable. Whether all 464 bytes reach the camera depends on the protocol and, on PROFINET, on the module in your PLC project.

Which bytes arrive​

Your PLC projectUser Data bytes the camera receives
EtherNet/IPAll of them, 0 to 463. The connection size is fixed, so there is nothing to choose
PROFINET with the User Data 464 moduleAll of them, 0 to 463
PROFINET with the User Data 64 moduleOnly 0 to 63
PROFINET with no User Data moduleNone

On PROFINET, User Data is an optional module that goes in slot 14 of the camera in your engineering tool, for example TIA Portal. The GSDML file offers two sizes:

ModuleSizeUse it when
User Data 6464 bytesYour variables fit in the first 64 bytes. Smaller cyclic data
User Data 464464 bytesYou need any byte from 64 onwards, such as a long string or many variables

When you add a variable at offset 64 or more on a PROFINET camera, the Add variable form warns: Arrives only with the User Data 464 module.

Bytes the PLC doesn't send read as zero, not empty

If a variable sits on bytes the PLC doesn't send, for example at offset 100 with the User Data 64 module, the camera does not leave it empty. It reads those bytes as zero, so the variable becomes 0, false or an empty string, and every capture saves that value. A recipe script that checks for a missing value (null) won't catch it. Plug the User Data 464 module, or move the variable below byte 64.

Where the bytes are in the PLC​

User Data starts after the camera's own control bytes, so the first User Data byte is not byte 0 of the PLC's output data:

ProtocolUser Data byte n is
EtherNet/IP, with the camera added from the EDSThe tag UserData[n]
EtherNet/IP, as a Generic Ethernet ModuleDATA[32 + n] of the output assembly. User Data byte 0 is DATA[32]
PROFINETByte n of the User Data module in slot 14

Once a protocol is selected under Industrial Ethernet, the Add variable form shows these addresses for the offset you pick, under Where the PLC writes it, so you don't need to work them out by hand. On EtherNet/IP it lists both the Rockwell UDT tag and the Generic Ethernet Module address.

Byte order​

Numbers longer than one byte (INT, DINT, REAL and so on) are read in the fieldbus's own byte order. The camera never swaps them:

ProtocolByte order
EtherNet/IPLittle-endian: the lowest byte first
PROFINETBig-endian: the highest byte first

Write numbers from the PLC in its normal format and they arrive correctly. Byte order only matters if you build values byte by byte, for example in a BYTES array.

When the camera reads the bytes​

  • The camera decodes User Data each time a byte changes, so a variable is always up to date with the last bytes the PLC wrote.
  • Each inspection saves the values the variables have when its tools finish. Have the PLC write User Data before it raises the trigger.
  • While no PLC is connected, nothing is decoded, and each variable keeps the last value it had.

Check what the PLC is sending​

Open Integration > I/O Live Monitor. Fieldbus User Bytes shows the bytes the camera is receiving, live. If a variable reads 0 or the wrong value, check the bytes there first, then the module size and the offset.

Where to go next​