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
-
Import the GSDML file. Unpack the ZIP file and import
GSDML-V2.31-HILSCHER-CIFX RE PNS-20150709.xmlinto the engineering software (in TIA Portal: Options > Manage general station description files (GSD)). -
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. -
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.
-
-
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. -
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.
-
Toggle the heartbeat: the PLC program toggles
IN_HeartBeatcyclically; LumiScan VGR mirrors it inOUT_HeartBeat. -
Download the configuration and the program to the PLC.
-
Select PROFINET in LumiScan VGR:
communicationProtocolisProfinetin the settings file (the default when the key is missing). Start LumiScan VGR with the settings file. -
Check the connection: activate admin mode with Ctrl + Shift + A (not manual mode) and open the PROFINET tab.
IN_HeartBeatandOUT_HeartBeatblink red and green. -
Switch to automatic mode: run Set Parameter with
IN_ParamId0(SET_OPERATION_MODE) andIN_ParamArgByte1(AUTOMATIC), following the handshake. Setup and the processing functions are only ready in automatic mode. -
Run Setup with
IN_SetupRequest, following the same handshake.
Check that it worked
-
OUT_OperationModeis1(AUTOMATIC). -
After Setup,
OUT_ReturnCodeis0(SUCCESS) andOUT_IsSetupis1. -
Trigger Camera (
IN_TriggerCameraRequest) returns0, 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. -
The heartbeat does not blink, or the PLC reports a module difference: see The PLC reports a module difference or exchanges no data.
-
Values are implausible, or an ID is not recognized: see The PLC reads implausible values.
-
A function does not respond: see LumiScan VGR does not respond after GripBestResult.