Connect a PLC over PROFINET

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, the handshake in PROFINET Process Flow and Signals.

Before you start

  • The IPC has a Hilscher cifX card configured as PROFINET IO device, see PROFINET 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).

  • 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.

  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. 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.

  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. 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