---
title: "Connect a PLC over PROFINET"
description: "Connect a PLC to LumiScan VGR over PROFINET: import the GSDML file, add the device with its twelve modules, assign the name and run the first Setup."
product: "LumiScan VGR / VGR Lite"
component: "lumiscan-vgr"
version: "2.0.0"
display_version: "2.0.0.8"
latest_version: true
language: "en"
url: "https://docs.hdvisionsystems.com/en/lumiscan-vgr/howto/connect-plc-profinet.html"
---

# Connect a PLC over PROFINET – LumiScan VGR / VGR Lite

This guide connects a PLC to LumiScan VGR over PROFINET, from the device description to the first successful Setup. The signals are described in [PROFINET Interface Reference](https://docs.hdvisionsystems.com/en/lumiscan-vgr/profinet.html), the handshake in [PROFINET Process Flow and Signals](https://docs.hdvisionsystems.com/en/lumiscan-vgr/plc-settings.html).

## Before you start

- The IPC has a Hilscher cifX card configured as PROFINET IO device, see [PROFINET Device](https://docs.hdvisionsystems.com/en/lumiscan-vgr/profinet.html#device). Vision Controllers from HD Vision Systems with PROFINET are delivered this way.
- A port of the Hilscher card is connected to the PROFINET network of the PLC.
- The device description: [GSDML file (ZIP)](https://docs.hdvisionsystems.com/en/lumiscan-vgr/_attachments/lumiscan-vgr-gsdml-cifx-re-pns-v3.4.zip).
- The PLC engineering software, for example TIA Portal.

## Steps

1. **Import the GSDML file.** Unpack the ZIP file and import `GSDML-V2.31-HILSCHER-CIFX RE PNS-20150709.xml` into the engineering software (in TIA Portal: **Options > Manage general station description files (GSD)**).

2. **Add the device** to the PROFINET network of the PLC: Hilscher, device access point `CIFX RE/PNS V3.4.19 - V3.4.x`. The GSDML file describes several device access points; use this one.

3. **Insert the twelve modules**, in this order:
   - slot 1: `64 Bytes Input`
   - slots 2–8: `32 Bytes Input`
   - slots 9–12: `64 Bytes Output`

   Give the input modules consecutive addresses, and the output modules too: several values span two modules. See [Device Modules](https://docs.hdvisionsystems.com/en/lumiscan-vgr/profinet.html#device-modules).

4. **Name the device and assign its address.** Device name: `cifxrepns`, the name the card starts with. IP address: from the PLC project; the card has none of its own.

5. **Map the signals** in the PLC program with the byte addresses from [Memory Layout](https://docs.hdvisionsystems.com/en/lumiscan-vgr/profinet.html#memory-layout). Convert the byte order of the floating-point values and write the IDs as arrays of characters, as described in [Data Types and Byte Order](https://docs.hdvisionsystems.com/en/lumiscan-vgr/profinet.html#byte-order).

6. **Toggle the heartbeat:** the PLC program toggles `IN_HeartBeat` cyclically; LumiScan VGR mirrors it in `OUT_HeartBeat`.

7. **Download** the configuration and the program to the PLC.

8. **Select PROFINET in LumiScan VGR:** `communicationProtocol` is `Profinet` in the settings file (the default when the key is missing). Start LumiScan VGR with the settings file.

9. **Check the connection:** activate admin mode with **Ctrl + Shift + A** (not manual mode) and open the **PROFINET** tab. `IN_HeartBeat` and `OUT_HeartBeat` blink red and green.

10. **Switch to automatic mode:** run Set Parameter with `IN_ParamId` `0` (`SET_OPERATION_MODE`) and `IN_ParamArgByte` `1` (`AUTOMATIC`), following the [handshake](https://docs.hdvisionsystems.com/en/lumiscan-vgr/plc-settings.html#process-flow). Setup and the processing functions are only ready in automatic mode.

11. **Run Setup** with `IN_SetupRequest`, following the same handshake.

## Check that it worked

- `OUT_OperationMode` is `1` (`AUTOMATIC`).
- After Setup, `OUT_ReturnCode` is `0` (`SUCCESS`) and `OUT_IsSetup` is `1`.
- Trigger Camera (`IN_TriggerCameraRequest`) returns `0`, and the image appears in the **Image** tab.

## If something goes wrong

- LumiScan VGR reports `Error while connecting the Hilscher Card.`: see [LumiScan VGR cannot connect to the Hilscher card](https://docs.hdvisionsystems.com/en/lumiscan-vgr/troubleshooting.html#ts-hilscher-card).
- The heartbeat does not blink, or the PLC reports a module difference: see [The PLC reports a module difference or exchanges no data](https://docs.hdvisionsystems.com/en/lumiscan-vgr/troubleshooting.html#ts-profinet-no-data-exchange).
- Values are implausible, or an ID is not recognized: see [The PLC reads implausible values](https://docs.hdvisionsystems.com/en/lumiscan-vgr/troubleshooting.html#ts-profinet-wrong-values).
- A function does not respond: see [LumiScan VGR does not respond after GripBestResult](https://docs.hdvisionsystems.com/en/lumiscan-vgr/troubleshooting.html#faq-no-reaction-plc-request).
