Kunbus C Series User manual

d:\project\700391_crio_pn\anwenderdoku\device\version_2.3 - vipm\gettingstarted_crio_pn_io-device.doc
Revision History
Version
Date
Description
Resp.
V2.3
20.09.2017
Kunbus Branding, Location of Example / GSD changed
because of VIPM package
AME
V2.2
23.06.2015
Schreibfehler Seite 15 Slot von 0-16 auf 1-16 korrigiert
SKR
V2.1
24.03.2014
Read/Write record index and error codes added
MF
V2.0
09.12.2013
Change from MDK 1.0 to MDK 2.0
MF, JK
V1.1
07.03.2011
Initial Version
JK
Version
Product Manager
Project Manager Software
V2.3
Joachim Kurpat
Joachim Kurpat
GmbH
Robert-Bosch-Straße 12A
76275 Ettlingen
Phone +49 7243 51449 - 00
Copyright 2017 by 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.

Getting started Contents
cRIO PN-GettingStarted-V2.3/20.09.2017 i
Business Confidential/ Proprietary
Contents
1Introduction................................................................................................................... 1
1.1 Worldwide Support and Services.........................................................................1
1.2 Prerequisites:....................................................................................................... 1
2Installation ....................................................................................................................2
3Configuring the PN IO-Controller with the cRIO PN IO-Device module.........................3
4FPGA Method Nodes....................................................................................................4
4.1 IO Data Methode Nodes......................................................................................5
4.1.1 Read/Write IO Data Method...................................................................5
4.1.2 Get Output Data Method........................................................................5
4.1.3 Set Input Data Method...........................................................................6
4.2 Alarm Data Method Nodes................................................................................... 7
4.2.1 Read/Write Alarm Method...................................................................... 7
4.2.2 Set Diagnostic Data Method...................................................................7
4.2.3 Set Process Data Method ......................................................................8
4.3 Record Data Method Nodes ................................................................................9
4.3.1 Read Record Method...........................................................................10
4.3.2 Get Record Data Method.....................................................................10
4.3.3 Write Record Method........................................................................... 11
4.3.4 Set Record Data Method...................................................................... 11
5LabVIEW RT PROFINET IO Device VI.......................................................................12
5.1 IO Device menu.................................................................................................12
5.1.1 Device I/O-Data ...................................................................................12
5.1.2 Device Alarm Data...............................................................................13
5.1.3 Device Record Data.............................................................................14
6RT Device Example....................................................................................................15
7Error codes.................................................................................................................17

Contents Getting started
ii cRIO PN-GettingStarted-V2.3/20.09.2017
Business Confidential/ Proprietary
List of Figures
Figure 1: Measurement and Automation Explorer..................................................................2
Figure 4: cRIO PN Module API ..............................................................................................4
Figure 5: Read/Write IO Data Method Node...........................................................................5
Figure 6: Get Output Data Method Node................................................................................5
Figure 7: Set Input Data Method Node...................................................................................6
Figure 8: Read/Write Alarm Method Node..............................................................................7
Figure 9: Set Diagnostic Data Method Node..........................................................................8
Figure 10: Set Process Data Method Node............................................................................8
Figure 11: Handling of slot specific acyclic Read- and Write buffers.......................................9
Figure 12: Read Record Method Node.................................................................................10
Figure 13: Get Record Data Method Node...........................................................................10
Figure 14: Write Record Method Node.................................................................................11
Figure 15: Set Record Data Method Node ...........................................................................11
Figure 16: cRIO PN Device menu........................................................................................12
Figure 17: Device I/O-Data VI..............................................................................................12
Figure 18: Device Alarm Data VI..........................................................................................13
Figure 19: Device Record Data VI........................................................................................14

Getting started Contents
cRIO PN-GettingStarted-V2.3/20.09.2017 iii
Business Confidential/ Proprietary
List of Tables
Table 1: Read/Write IO Data Parameter ................................................................................5
Table 2: Get Output Data Parameter ..................................................................................... 6
Table 3: Get Input Data Parameter........................................................................................6
Table 4: Read/Write Alarm Parameter ...................................................................................7
Table 5: Set Diagnostic Data Parameter................................................................................8
Table 6: Set Process Data Paramete..................................................................................... 8
Table 7: Available records of the cRIO PN.............................................................................9
Table 8: Read Record Data Parameter................................................................................10
Table 9: Get Record Data Parameter...................................................................................10
Table 10: Read Record Data Parameter..............................................................................11
Table 11: Set Record Data Parameter.................................................................................11
Table 12: Device I/O-Data Parameter.................................................................................. 13
Table 13: Device Alarm Parameter......................................................................................14
Table 14: Device Record Parameter.................................................................................... 14
Table 15: Error codes .......................................................................................................... 17

Getting started Introduction
cRIO PN-GettingStarted-V2.3/20.09.2017 1
Business Confidential/ Proprietary
1 Introduction
This document describes the set into operation procedure of the cRIO PN module as
IO-Device.
1.1 Worldwide Support and Services
The National Instruments website is your complete resource for technical support. At
ni.com/support, you have access to everything from troubleshooting and application
development self-help resources to email and phone assistance from NI Application
Engineers.
1.2 Prerequisites:
Download cRIO PN driver software from LabVIEW Tools Network
National Instruments cRIO system with real time controller and chassis.
The National Instruments LabVIEW Real time and FPGA Development System from
Version 2012 installed on a Windows PC.
A PROFINET IO-Controller System connected to the cRIO PN IO-Device module.

Installation Getting started
2 cRIO PN-GettingStarted-V2.3/20.09.2017
Business Confidential/ Proprietary
2 Installation
Install the cRIO PN according the document cRIO PN –Installation Instructions
Switch on the CompactRIO system
Install the cRIO PN driver software downloaded from Tools Network
Check by the NI MAX (Measurement & Automation explorer) the proper installation of
the cRIO system:
Figure 1: Measurement and Automation Explorer
Note:The cRIO PN module will be not displayed here.

Getting started Configuring the PN IO-Controller with the cRIO PN IO-Device module
cRIO PN-GettingStarted-V2.3/20.09.2017 3
Business Confidential/ Proprietary
3 Configuring the PN IO-Controller with the
cRIO PN IO-Device module
To get the cRIO PN module into operation it must be configured on PN IO-Controller system
to be in use. For this the cRIO PN module ships with a GSDML (GSD) file that can be
imported on the PN IO-Controller configuration tool.
The cRIO PN GSDML file GSDML-Vx.x- Kunbus-cRIO PN-yyyymmdd.xml can be found in
the folder “…\Public\Documents\Kunbus GmbH\GSDML”. Additionally the GSDML file is
included in the auto populating folder “GSDML”inside the PROFINET Device Example
project.

FPGA Method Nodes Getting started
4 cRIO PN-GettingStarted-V2.3/20.09.2017
Business Confidential/ Proprietary
4 FPGA Method Nodes
The lower level cRIO PN Module API consists of FPGA I/O Method and Property Nodes to
be integrated into a FPGA based application. Additionally an easy to use high level RT API is
available (see chapter 6).
3 different APIs are available:
1. IO Data:
Read and Write IO data from/to the cRIO PN I/O-Device.
2. Alarm Data:
Acyclic Alarm handling from/to the cRIO PN I/O-Device.
3. Record Data:
Read and Write Record data from/to the cRIO PN I/O-Device.
Add your FPGA target to a LabVIEW project. LabVIEW will discover your module
automatically if it is connected.
Complete the following steps to add the cRIO PN module to a LabVIEW project if the module
is not connected:
1. Right-click your FPGA Target in the Project Explorer window and select New »
C Series Modules from the shortcut menu to display the Add Targets and Devices
dialog box.
2. Click the New target or device radio button, select C Series Module, and click OK
button to display the New C Series Module dialog box.
3. Select the CS_cRIO-PNAD module from the Module Type pull-down menu and click
the OK button.
After the CS_cRIO-PNAD module is added, the cRIO PN Module API is displayed in the
project as shown in Figure 2.
Figure 2: cRIO PN Module API

Getting started FPGA Method Nodes
cRIO PN-GettingStarted-V2.3/20.09.2017 5
Business Confidential/ Proprietary
4.1 IO Data Methode Nodes
4.1.1 Read/Write IO Data Method
The Read/Write IO Data Method transmits input data to the IO Controller and receives output
data from the IO Controller. The related I/O data are stored in the internal memory.
Additionally the method sets the IOPS input status and returns the IOCS output status of the
IO Device Slot. The internal memory can be accessed by the Get Output Data Method and
the Set Input Data Method.
Figure 3: Read/Write IO Data Method Node
Parameter
Value
Description
Slot
1 –16
PROFINET IO Slot
IOPS
Input status
0x00
Bad by Subslot Input data not valid
0x80
Good Input data valid
IOCS
Output status
0x00
Bad by Subslot Input data not valid
0x80
Good Input data valid
Table 1: Read/Write IO Data Parameter
4.1.2 Get Output Data Method
The Get Output Data Method reads a single byte from the IO Controller’s output data stream
from the internal memory. Additionally the method returns the configured output data length
of the IO Device. Use the Read/Write IO Data Method first to update the internal memory
with the latest IO Controller data.
Figure 4: Get Output Data Method Node

FPGA Method Nodes Getting started
6 cRIO PN-GettingStarted-V2.3/20.09.2017
Business Confidential/ Proprietary
Parameter
Value
Description
Slot
1 –16
PROFINET IO Slot
Index
0 –253
Byte-Address of the IO Device output data stream
Index 0 = Output Byte 0; Index 1 = Output Byte 1; …
Data
0 –255
Output data byte
Length
0 –254
Configured cRIO PN Output data size
Note: If the value may not return the real configured
output data length, please contact the KUNBUS GmbH
to get the latest firmware update of the cRIO PN.
Table 2: Get Output Data Parameter
4.1.3 Set Input Data Method
The Set Input Data Method writes a single byte of an IO Device’s input data stream to the
internal memory. Use the Read/Write Data Method subsequently to transmit the input data
stream from the internal memory to the IO Controller. Additionally the method returns the
configured input data length of the IO Device.
Figure 5: Set Input Data Method Node
Parameter
Value
Description
Slot
1 –16
PROFINET IO Slot
Index
0 –253
Byte-Address of the IO Device input data stream
Index 0 = Input Byte 0; Index 1 = Input Byte 1; …
Data
0 –255
Input data byte
Length
0 –254
Max cRIO PN Input data size
Note: If the value may not return the real configured
output data length, please contact the KUNBUS GmbH
to get the latest firmware update of the cRIO PN.
Table 3: Get Input Data Parameter

Getting started FPGA Method Nodes
cRIO PN-GettingStarted-V2.3/20.09.2017 7
Business Confidential/ Proprietary
4.2 Alarm Data Method Nodes
4.2.1 Read/Write Alarm Method
The Read/Write Alarm Method handles specific diagnostic- and alarm messages. The related
diagnostic- and alarm data are stored in the internal memory. The internal memory can be
accessed by the Set Diagnostic Data Method and the Set Process Data Method.
Figure 6: Read/Write Alarm Method Node
Note: All PN IO alarms are always slot specific.
Parameter
Value
Description
Slot
1 –16
PROFINET IO Slot
Alarm
0: Pull Alarm
Triggers a slot related pull alarm on the cRIO PN module
1: Plug Alarm
Triggers a slot related plug alarm on the cRIO PN module
2: Set Diagnostic
Alarm
Activates a slot specific diagnostic alarm on the cRIO PN
module
3: Reset
Diagnostic Alarm
Deactivates a slot specific diagnostic alarm on the cRIO
PN module
4: Set Process
Alarm
Triggers a slot specific process alarm on the cRIO PN
module
Table 4: Read/Write Alarm Parameter
4.2.2 Set Diagnostic Data Method
The Set Diagnostic Data Method writes a single byte of an IO Device’s diagnostic data
stream to the internal memory. Additionally the method returns the maximum diagnostic data
length of the IO Device. Use the Read/Write Alarm Method subsequently to transmit the
diagnostic data stream from the internal memory to the IO Controller.

FPGA Method Nodes Getting started
8 cRIO PN-GettingStarted-V2.3/20.09.2017
Business Confidential/ Proprietary
Figure 7: Set Diagnostic Data Method Node
Parameter
Value
Description
Index
0 –253
Byte-Address of the IO Device diagnostic data stream
Index 0 = Diag Byte 0; Index 1 = Diag Byte 1; …
Data
0 –255
Diagnostic data byte
Length
254
Max cRIO PN Diagnostic data size
Table 5: Set Diagnostic Data Parameter
4.2.3 Set Process Data Method
The Set Process Data Method writes a single byte of an IO Device’s process data stream to
the internal memory. Additionally the method returns the maximum process data length of
the IO Device. Use the Read/Write Alarm Method subsequently to transmit the process data
stream from the internal memory to the IO Controller.
Figure 8: Set Process Data Method Node
Parameter
Value
Description
Index
0 –253
Byte-Address of the IO Device process data stream
Index 0 = Diag Byte 0; Index 1 = Diag Byte 1; …
Data
0 –255
Process data byte
Length
254
Max cRIO PN Process data size
Table 6: Set Process Data Paramete

Getting started FPGA Method Nodes
cRIO PN-GettingStarted-V2.3/20.09.2017 9
Business Confidential/ Proprietary
4.3 Record Data Method Nodes
cRIO PN supports acyclic data exchange in combination with the PN IO-Controller by PN IO
ReadRec- and WriteRec services.
cRIO PN provides internal buffers for every configured PN IO slot storing read- and write
specific acyclic data. These buffers are read and written by the PN IO-Controller using the
PN IO ReadRec- and WriteRec services.
On FPGA level the cRIO PN slot specific acyclic buffers can also be read and written via the
Read and Write Record Data Method Nodes.
Note: cRIO PN supports per slot only 1 acyclic Read/Write buffer.
Figure 9: Handling of slot specific acyclic Read- and Write buffers
Acyclic Requests triggered by the Read Record -and Write Record Method are immediately
acknowledged by the cRIO PN module.
Note: Incoming PN IO WriteRec service events on cRIO PN are not signalled automatically
to the cRIO FPGA controller but must be polled.
Index
Access
Description
0x2010
Record data
This record returns the record data of the cRIO PN
0x2011
Record data
This record transmits the record data to the cRIO PN
0x8028
I/O handling
This record returns the current input data of the cRIO PN
0x8029
I/O handling
This record returns the current output data of the cRIO PN
0xAFF0
I&M data
This record returns I&M data of the cRIO PN
Table 7: Available records of the cRIO PN
Ethernet
Read Record Method
PN IO WriteRec
by Index 0x2011
PN IO ReadRec
by Index 0x2010
SPI
cRIO PN module
PN
IO-Controller
Acyclic
Read/Write buffer
Slot 1 –Slot 16
Write Record Method
cRIO FPGA

FPGA Method Nodes Getting started
10 cRIO PN-GettingStarted-V2.3/20.09.2017
Business Confidential/ Proprietary
4.3.1 Read Record Method
The Read Record Data Method receives read record data from the IO Controller. The read
record data are stored in the internal memory. The internal memory can be accessed by the
Get Record Data Method.
Figure 10: Read Record Method Node
Parameter
Value
Description
Slot
1 –16
PROFINET IO Slot
Table 8: Read Record Data Parameter
4.3.2 Get Record Data Method
The Get Record Data Method reads a single byte from the IO Controller’s record data stream
from the internal memory. Additionally the method returns the maximum record data length of
the IO Device. Use the Read Record Data Method first to update the internal memory with
the latest ReadRec data received from the PN IO controller.
Figure 11: Get Record Data Method Node
Parameter
Value
Description
Index
0 –253
Byte-Address of the IO Device record data stream
Index 0 = Record Byte 0; Index 1 = Record Byte 1; …
Data
0 –255
Record data byte
Length
254
Max cRIO PN Record data size
Table 9: Get Record Data Parameter

Getting started FPGA Method Nodes
cRIO PN-GettingStarted-V2.3/20.09.2017 11
Business Confidential/ Proprietary
4.3.3 Write Record Method
The Write Record Data Method transmits record data to cRIO PN module which then can be
read by the PN IO Controller. The record data are stored in the internal memory. The internal
memory can be accessed by the Set Record Data Method.
Figure 12: Write Record Method Node
Parameter
Value
Description
Slot
1 –16
PROFINET IO Slot
Table 10: Read Record Data Parameter
4.3.4 Set Record Data Method
The Set Record Data Method writes a single byte to record data the internal memory.
Additionally the method returns the maximum record data length. Use the Write Record Data
Method subsequently to update the cRIO PN module with the record data in the internal
memory.
Figure 13: Set Record Data Method Node
Parameter
Value
Description
Index
0 –253
Byte-Address of the IO Device record data stream
Index 0 = Record Byte 0; Index 1 = Record Byte 1; …
Data
0 –255
Record data byte
Length
254
Max cRIO PN Record data size
Table 11: Set Record Data Parameter

LabVIEW RT PROFINET IO Device VI Getting started
12 cRIO PN-GettingStarted-V2.3/20.09.2017
Business Confidential/ Proprietary
5 LabVIEW RT PROFINET IO Device VI
The RT IO Device VI provides access to the PROFINET on RT-Level via the already
described low level FPGA VIs. Refer to the RT Device Example for a fully working
implementation example. The VI specific context help menu describes in detail all VI specific
parameters.
5.1 IO Device menu
Use the cRIO PN palette to access the RT IO Device VIs. Click Functions Palette » Kunbus
GmbH » cRIO PN Device:
Figure 14: cRIO PN Device menu
5.1.1 Device I/O-Data
The CS_cRIO-PN_IO-Device_IOData.vi exchanges I/O-Data and status with the PN
IO-Controller.
Figure 15: Device I/O-Data VI
Parameter
Value
Description
Slot
1 –16
PROFINET IO Slot
Modify input data
[0 –255]
IO-Device input data to be changed

Getting started LabVIEW RT PROFINET IO Device VI
cRIO PN-GettingStarted-V2.3/20.09.2017 13
Business Confidential/ Proprietary
IOPS
Input status
0x00
Bad by Subslot
0x80
Good
Input length
0 –254
Size of cRIO PN IO-Device input data transmitted to the
IO-Controller
Output length
0 –254
Size of cRIO PN IO-Device output data received from
the IO-Controller
Output data
[0 –255]
IO-Device output data
IOCS
Output status
0x80
Good
0x00
Bad by Subslot
Table 12: Device I/O-Data Parameter
5.1.2 Device Alarm Data
The CS_cRIO-PN_IO-Device_AlarmData.vi exchanges Alarm-Data with the PN IO-
Controller.
Figure 16: Device Alarm Data VI
Parameter
Value
Description
Alarm
0: Pull Alarm
Triggers a slot related pull alarm on the cRIO PN module
1: Plug Alarm
Triggers a slot related plug alarm on the cRIO PN module
2: Set Diagnostic
Alarm
Activates a slot specific diagnostic alarm on the cRIO PN
module
3: Reset
Diagnostic Alarm
Deactivates a slot specific diagnostic alarm on the cRIO
PN module
4: Set Process
Alarm
Triggers a slot specific process alarm on the cRIO PN
module

LabVIEW RT PROFINET IO Device VI Getting started
14 cRIO PN-GettingStarted-V2.3/20.09.2017
Business Confidential/ Proprietary
Slot
1 –16
PROFINET IO Slot
Alarm data
[0 –255]
IO-Device alarm data
Table 13: Device Alarm Parameter
5.1.3 Device Record Data
The CS_cRIO-PN_IO-Device_RecordData.vi exchanges Alarm-Data with the PN IO-
Controller.
Figure 17: Device Record Data VI
Parameter
Value
Description
Mode
Read/Write
Reads or writes record data
Slot
1 –16
PROFINET IO Slot
Write record data
[0 –255]
IO-Device write record data
Read record data
[0 –255]
IO-Device read record data
Table 14: Device Record Parameter
This manual suits for next models
1
Table of contents
Other Kunbus Control Unit manuals