Kunbus DF PROFINET IO GettingStarted

Page 1
DF PROFINET IO-GettingStarted-V1.0/27.07.2016
KUNBUS
DF PROFINET IO
V1.0/27.07.2016
Page 2
h:\dokumente\project\700361_df_profinet_io_controller\anwenderdoku\getting started windows
Version
Date
Description
Respons.
V1.0
27.07.2016
Initial Version
Version
Product manager
Project manager software
V1.0
Joachim Kurpat
Christoph Vogt
KUNBUS GmbH Heerweg 15c 73770 Denkendorf Phone +49 711 300 20 676 Fax +49 711 300 20 677
Copyright 2016 by KUNBUS GmbH
Business Confidential/KUNBUS Proprietary
This document includes data that shall not be duplicated, used, or disclosed - in whole or in part - for any purpose other than to evaluate this document. If, however, a contract with a customer is in force, the customer shall have the right to duplicate, use, or disclose the data to the extent provided in this contract. This restriction does not limit the customer’s right to us e the data in this document if it can also be obtained from another source without restriction. The data subject to this restriction are confidential in all pages of this document.
device\version_1.0\gettingstarted_e.doc
Revision History
Page 3
GettingStarted Inhalt
Contents
1 Installation .................................................................................................................... 1
2 Operation as PROFINET IO-Controller ......................................................................... 2
2.1 PROFINET IO-Configuration ............................................................................... 2
1 Description LED's ......................................................................................................... 4
2 PROFINET IO C and C++ Sample ................................................................................ 5
3 Operation as PROFINET IO-Device ............................................................................ 10
3.1 Description LED's .............................................................................................. 10
3.2 PROFINET IO Device C and C++ Sample ......................................................... 11
4 Simoulteanous operation of PN IO Controller and PN IO Device ................................ 20
4.1 Simoulteanous operation of PN IO Controller/Device on a single Ethernet
Port .................................................................................................................... 20
4.2 Description LED's .............................................................................................. 21
4.3 Simoulteanous operation of PN IO Controller/Device on 2 Ethernet Ports ......... 21
KUNBUS DF PROFINET IO-GettingStarted-V1.0/27.07.2016 i
Business Confidential/KUNBUS Proprietary
Page 4
Inhalt GettingStarted
List of Figures
Figure 1: New Hardware Wizard ............................................................................................ 1
Figure 2: Configurator III PROFINET IO Configurations-Tool ................................................. 2
Figure 3: Configurator III PROFINET IO Online-Mode............................................................ 3
Figure 4: Sample Code- Initialization ..................................................................................... 5
Figure 5: Sample Code – Command Overview ................................................................ ...... 6
Figure 6: Sample Code – Identify Devices on Bus ................................................................. 6
Figure 7: Sample Code - Cyclic Transfer ............................................................................... 7
Figure 8: Sample Code - Cyclic Transfer ............................................................................... 8
Figure 9: Sample Code - Cyclic Transfer ............................................................................... 8
Figure 10: Sample Code - Acyclic Transfer ............................................................................ 9
Figure 11: Sample code PN IO device - Initialization ........................................................... 11
Figure 12: Sample code PN IO Device – Command Overview ............................................. 12
Figure 13: Communication State of the PN IO Device before activating the PN IO
communication................................................................................................... 13
Figure 14: Sample code PN IO Device – Start of Profinet .................................................... 13
Figure 15: State of the PN IO Device after activating PROFINET communication ................ 14
Figure 16: Sample code PN IO Device – Identification of connected PN IO Controllers ....... 14
Figure 17: Sample code PN IO Device - Start of PN IO device and Read/Write of cyclic
process data ................................................................................................ ...... 15
Figure 18: Change of output data on PN IO Controller ......................................................... 15
Figure 19: Sample code PN IO Device - Read/Write of cyclic output data and
indication of the changed output data ................................................................ 16
Figure 20: Sample code PN IO Device - Command 4- Pull/Plug Module ............................. 16
Figure 21: Indication of Pull / Plug – Alarms on PN IO Controller ......................................... 17
Figure 22: Sample code PN IO Device - Command 5- Transmitting Process-Alarms ........... 17
Figure 23: Indication of a process-alarm on PN IO Controller............................................... 18
Figure 24: Sample code PN IO Device - Command 6- Set/Reset Diagnostic State ............. 18
Figure 25: Indication of PN IO Device’s diagnostic state on PN IO Controller ...................... 19
Figure 26: Adjusted TCP IP-Adress for the internal PN IO Controller ................................... 20
ii DF PROFINET IO-GettingStarted-V1.0/27.07.2016
Business Confidential/KUNBUS Proprietary
KUNBUS
Page 5
GettingStarted Inhalt
Leerseite
KUNBUS DF PROFINET IO-GettingStarted-V1.0/27.07.2016 iii
Business Confidential/KUNBUS Proprietary
Page 6
Page 7
GettingStarted Installation
1 Installation
Install the DF PROFINET IO PCI/CPCI/PCIe board in the PC system.
Please note, if a DF PROFINET IO CPCI board is used, the board does not support Hot Plugging. If installing/uninstalling the board the Compact PCI system must be switched off and the power supply must be interrupted.
Switch on the PC system. Ignore the “New hardware” – dialog which is popped up automatically after the board
was installed.
Figure 1: New Hardware Wizard
Start the Setup from KUNBUS driver CD within scope of delivery.
KUNBUS DF PROFINET IO-GettingStarted-V1.0/27.07.2016 1
Business Confidential/KUNBUS Proprietary
Page 8
Operation as PROFINET IO-Controller GettingStarted
2 Operation as PROFINET IO-Controller
2.1 PROFINET IO-Configuration
The PROFINET IO configuration is carried out by the KUNBUS PROFINET IO configuration tool configurator III.exe. Configurator III is a powerful tool to create, download and test a PROFINET IO configuration. Refer to the programs on line help menu for all details.
Create a configuration and download it to the DF PROFINET IO board.
Figure 2: Configurator III PROFINET IO Configurations-Tool
2 DF PROFINET IO-GettingStarted-V1.0/27.07.2016
Business Confidential/COMSOFT Proprietary
COMSOFT
Page 9
GettingStarted Operation as PROFINET IO-Controller
In that case, the DF PROFINET IO devices are already connected, use the Online-
Mode of Configurator III to immediately test and troubleshoot the PROFINET IO
configuration.
Figure 3: Configurator III PROFINET IO Online-Mode
KUNBUS DF PROFINET IO-GettingStarted-V1.0/27.07.2016 3
Business Confidential/KUNBUS Proprietary
Page 10
Description LED's GettingStarted
1 Description LED's
Green LED:
ON: Firmware boot was successfull
OFF: Firmware not started
Yellow LED:
ON: PROFINET IO started
OFF: PROFINET IO not started
Red LED:
ON: Error in PROFINET IO Network detected (at minimum 1 configured PN IO
Device does not respond or reports diagnostic)
OFF: All configured PROFINET IO Devices work properly
4 DF PROFINET IO-GettingStarted-V1.0/27.07.2016
Business Confidential/COMSOFT Proprietary
COMSOFT
Page 11
GettingStarted PROFINET IO C and C++ Sample
2 PROFINET IO C and C++ Sample
This example shows exemplarily and in an easy way how to use the driver interface of the DF PROFINET IO board. Before using the example code a PROFINET IO configuration has to be downloaded to the DF PROFINET IO board first.
The example is located in the directory "C:\Program Files\KUNBUS GmbH\Profinet IO Controller\Basic_Profinet_Example” or "C:\Program Files (x86)\KUNBUS GmbH\Profinet IO Controller\Basic_Profinet_Example”.
The sample code is prepared for the use with Microsoft Visual C++ from version Visual C++
2008. The sample code project is a 32-Bit console application. For all details please refer directly to the source code file "Basic_Profinet_Example.cpp". To test and troubleshoot the PROFINET configuration, Configurator III provides a powerful Online Mode with full graphical HMI supporting I/O-data-, Diagnostic- and Alarm handling.
For a first test execute the „Basic_Profinet_Example.exe" application within scope of delivery:
Figure 4: Sample Code- Initialization The application runs step by step. Any keystroke invokes the next step. The following steps
are available:
- Step 1: Check DLL version: Initialization of the underlying DFXX-DLL and creation of a file handle to access the board
- Step 2: Get controller info: Display of the installed board configuration
KUNBUS DF PROFINET IO-GettingStarted-V1.0/27.07.2016 5
Business Confidential/KUNBUS Proprietary
Page 12
PROFINET IO C and C++ Sample GettingStarted
- Step 3: Choose a controller: Selection of a board installed
- LED Green = ON, LED Yellow = OFF, LED Red = OFF
Figure 5: Sample Code – Command Overview
- Command 0: Exit: Sample application will be terminated
- Command 1: Identify Devices on Bus: Detection of all connected PN IO Devices
Figure 6: Sample Code – Identify Devices on Bus
- Step 4: Get information about all devices: DCP Service to identify the connected PN IO Devices and to display the PN IO specific names
6 DF PROFINET IO-GettingStarted-V1.0/27.07.2016
Business Confidential/COMSOFT Proprietary
COMSOFT
Page 13
GettingStarted PROFINET IO C and C++ Sample
- Command 2: Cyclic Transfer: Start of the cyclic data traffic
Figure 7: Sample Code - Cyclic Transfer
- Step 5: Start the Profinet: PROFINET IO will be started
- LED Green = ON, LED Yellow = OFF, LED Red = OFF
- If the LED Red = ON, please check the PN IO Configuration via the Online Mode in
Configurator III.
- Step 6: Select device number: Display of the available PN IO Devices and selection of the PN IO Device number to display input data and to force output data. The PN IO device number can be learned from the PN IO configuration in Configurator III.
KUNBUS DF PROFINET IO-GettingStarted-V1.0/27.07.2016 7
Business Confidential/KUNBUS Proprietary
Page 14
PROFINET IO C and C++ Sample GettingStarted
Figure 8: Sample Code - Cyclic Transfer
- Step 7: Get APDU status: Display of the PN IO Device’s APDU Status
Figure 9: Sample Code - Cyclic Transfer
- Step 8.1 Set output data and get input data: Forcing of the output data, display of the input data
- Simultaneous display of upcoming diagnostic alarms
- Display of the I/O-data related APDU- and Device-Status (sum status)
8 DF PROFINET IO-GettingStarted-V1.0/27.07.2016
Business Confidential/COMSOFT Proprietary
COMSOFT
Page 15
GettingStarted PROFINET IO C and C++ Sample
- Display of the Input- und Output data.
- Any keystroke increments and forces the output data and updates the input data
Figure 10: Sample Code - Acyclic Transfer
- Step 9 Read / Write Record Data: Execution of a ReadRec- and WriteRec service
- The specific parameters for ReadRec and WriteRec are hard coded and can be
modified directly in the related source code within scope of delivery
- The ReadRec and WriteRec service are executed once only
- Step 10 Stop the PROFINET: Deactivation of the PROFINET IO Controller
- LED Green = ON, LED Yellow = OFF, LED Red = OFF
KUNBUS DF PROFINET IO-GettingStarted-V1.0/27.07.2016 9
Business Confidential/KUNBUS Proprietary
Page 16
Operation as PROFINET IO-Device GettingStarted
3 Operation as PROFINET IO-Device
For the operation of the board as PROFINET IO device no configuration must be downloaded by Configurator III.
3.1 Description LED's
Green LED:
ON: Firmware boot was successfull OFF: Firmware not started
Yellow LED:
ON: PROFINET IO started OFF: PROFINET IO not started
Red LED:
On: None or faulty connection to PN IO Controller Off: No error in PROFINET IO Network
10 DF PROFINET IO-GettingStarted-V1.0/27.07.2016
Business Confidential/COMSOFT Proprietary
COMSOFT
Page 17
GettingStarted Operation as PROFINET IO-Device
3.2 PROFINET IO Device C and C++ Sample
This example shows exemplarily and in an easy way how to use the driver interface of the DF PROFINET IO board. Before using the example code a PROFINET IO configuration has to be downloaded to the DF PROFINET IO board first.
The example is located in the directory "C:\Program Files\KUNBUS GmbH\Profinet IO Controller\Basic_Profinet_Device_Example” or "C:\Program Files (x86)\KUNBUS GmbH\Profinet IO Controller\Basic_Profinet_Device_
Example”. The sample code is prepared for the use with Microsoft Visual C++ from version Visual C++
2008. The sample code project is a 32-Bit console application. For all details please refer directly to the source code file "Basic_Profinet_Device_Example.cpp".
For a first test execute the „Basic_Profinet_Device_Example.exe" application within scope of delivery:
Figure 11: Sample code PN IO device - Initialization The application runs step by step. Any keystroke invokes the next step. The following steps
are available:
- Step 1: Check DLL version: Initialization of the underlying DFXX-DLL and creation of a file handle to access the board
KUNBUS DF PROFINET IO-GettingStarted-V1.0/27.07.2016 11
Business Confidential/KUNBUS Proprietary
Page 18
Operation as PROFINET IO-Device GettingStarted
- Step 2: Get board info: Display of the installed board configuration
- Step 3: Choose a board: Selection of a board installed
- LED Green = ON, LED Yellow = OFF, LED Red = OFF
Figure 12: Sample code PN IO Device – Command Overview
- Command 0: Exit: Exit sample application
- Command 1: Identify connected Controllers: Indication of all PN IO Controllers connected
to the PN IO device
- Command 2: Read/Write I/O Data (Cyclic): Read/Write of cyclic process data
- Command 3: Read/Write Record Data (Acyclic): Read/Write of acyclic record data
- Command 4: Pull/Plug Module: Pull/Plug modules, triggers Pull/Plug-Alarms to PN IO
Controller)
- Command 5: Send Process Alarm: Trasnsmitts Process Alarms to PN IO Controller
- Command 6: Set/Reset diagnosis: Set/Reset diagnostic state
12 DF PROFINET IO-GettingStarted-V1.0/27.07.2016
Business Confidential/COMSOFT Proprietary
COMSOFT
Page 19
GettingStarted Operation as PROFINET IO-Device
Figure 13: Communication State of the PN IO Device before activating the PN IO
communication
With the PN IO device still not activated, a second DF PROFINET IO board, configured as PN IO Controller, indicates in Configurator’s on line mode the PN IO Device as faulty (blue frame).
Figure 14: Sample code PN IO Device – Start of Profinet
- Step 4: Start the Profinet: Profinet IO communication is activated
KUNBUS DF PROFINET IO-GettingStarted-V1.0/27.07.2016 13
Business Confidential/KUNBUS Proprietary
Page 20
Operation as PROFINET IO-Device GettingStarted
Figure 15: State of the PN IO Device after activating PROFINET communication After activating the PN IO Device, the PN IO Controller indicates the PN IO Device as
operational (green frame). Exchange of cyclic process data is now possible.
Figure 16: Sample code PN IO Device – Identification of connected PN IO Controllers
- Step 5: Identify connected Controllers: Indication of the connected PN IO controllers
14 DF PROFINET IO-GettingStarted-V1.0/27.07.2016
Business Confidential/COMSOFT Proprietary
COMSOFT
Page 21
GettingStarted Operation as PROFINET IO-Device
Figure 17: Sample code PN IO Device - Start of PN IO device and Read/Write of cyclic
process data
- Step 6: Read/Write Cyclic Data: Read/Write cyclic process data. Additionally the communication status and data sizes are indicated
Figure 18: Change of output data on PN IO Controller
KUNBUS DF PROFINET IO-GettingStarted-V1.0/27.07.2016 15
Business Confidential/KUNBUS Proprietary
Page 22
Operation as PROFINET IO-Device GettingStarted
Figure 19: Sample code PN IO Device - Read/Write of cyclic output data and indication of
the changed output data
Figure 20: Sample code PN IO Device - Command 4- Pull/Plug Module
- Step 4: Start the Profinet: Profinet IO communication is activated
- Step 9: Pull Module / Plug Module – Trigger Pull / Plug – Alarm on the PN IO Controller
16 DF PROFINET IO-GettingStarted-V1.0/27.07.2016
Business Confidential/COMSOFT Proprietary
COMSOFT
Page 23
GettingStarted Operation as PROFINET IO-Device
Figure 21: Indication of Pull / Plug – Alarms on PN IO Controller
Figure 22: Sample code PN IO Device - Command 5- Transmitting Process-Alarms
- Step 4: Start the Profinet: Profinet IO communication is activated
- Step 10: Send an alarm – Transmit a Process-Alarm to the PN IO Controller
KUNBUS DF PROFINET IO-GettingStarted-V1.0/27.07.2016 17
Business Confidential/KUNBUS Proprietary
Page 24
Operation as PROFINET IO-Device GettingStarted
Figure 23: Indication of a process-alarm on PN IO Controller
Figure 24: Sample code PN IO Device - Command 6- Set/Reset Diagnostic State
- Step 4: Start the Profinet: Profinet IO communication is activated
- Step 11: Set/Reset a Diagnosis – Set/Reset diagnostic state
18 DF PROFINET IO-GettingStarted-V1.0/27.07.2016
Business Confidential/COMSOFT Proprietary
COMSOFT
Page 25
GettingStarted Operation as PROFINET IO-Device
Figure 25: Indication of PN IO Device’s diagnostic state on PN IO Controller
KUNBUS DF PROFINET IO-GettingStarted-V1.0/27.07.2016 19
Business Confidential/KUNBUS Proprietary
Page 26
Simultaneous operation of PN IO Controller and PN IO Device GettingStarted
4 Simultaneous operation of PN IO Controller
and PN IO Device
On the DF PROFINET IO board the operation modes PN IO Controller and Device can be processed simultaneously that means the board works as PN IO controller and Device at the same time.
Furthermore the sample applications within scope of delivery for PN IO Controller and PN IO device can be run in parallel for testing purposes.
4.1 Simultaneous operation of PN IO Controller/Device on a single Ethernet Port
With DF PROFINET IO boards equipped with a single Ethernet conection please consider the following configuration requirements:
The TCP/IP address for PN IO controller and PN IO device must be identical. Example: For the operation as PN IO Controller, the TCP IP – address 192.168.20.37 was
adjusted with Configurator III:
Figure 26: Adjusted TCP IP-Adress for the internal PN IO Controller
20 DF PROFINET IO-GettingStarted-V1.0/27.07.2016
Business Confidential/COMSOFT Proprietary
COMSOFT
Page 27
GettingStarted Simultaneous operation of PN IO Controller and PN IO Device
In the DCP-configuration of the external PN IO controller configuration tool (Assignment of PROFINET IO name and TCP IP address for the PN IO Device) the identical TCP IP address
192.168.20.37 must be configured.
4.2 Description LED's
Green LED:
ON: Firmware boot was successfull OFF: Firmware not started
Yellow LED:
ON: PROFINET IO started OFF: PROFINET IO not started
Red LED:
On: Error on PROFINET IO Network Off: No error in PROFINET IO Network
4.3 Simultaneous operation of PN IO Controller/Device on 2 Ethernet Ports
With DF PROFINET IO boards equipped with 2 independent Ethernet ports the PN IO Controller is run on port 1 and the PN IO device is run on port 2. The Ethernet ports are working completely independent so different TCP IP – addresses can be configured.
KUNBUS DF PROFINET IO-GettingStarted-V1.0/27.07.2016 21
Business Confidential/KUNBUS Proprietary
Loading...