Sie sind auf Seite 1von 125

Protocol API

CC-Link Slave

Language: English

www.hilscher.com

CC-Link Slave Protocol API

Revision History
Rev

Date

Name

Revisions

20.11.07

ES

Created.
CC-Link slave firmware version 2.0.1

25.01.08

ES

Support of CC-Link Version 2.0.


Firmware/stack version 2.1.4

06.05.08

RG

Unified description of WS parameters and IO data.


Changed notation of WS parameters. Restructuring.

26.11.08

RG

Firmware/ stack version V2.2.2


Reference to netX Dual-Port Memory Interface Manual Revision 7.
Warmstart -> Set Configuration
Registration/unregistration packet marked as obsolete.
Changed some error numbers to global error numbers
Added section on task structure.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

All rights reserved. No part of this publication may be reproduced.


The Author makes no warranty of any kind with regard to this material, including but not limited to the
implied warranties of merchantability and fitness for a particular purpose. The Author assumes also no
responsibility for any errors that may appear in this document.
Although this software has been developed with great care and was intensively tested, Hilscher
Gesellschaft fr Systemautomation mbH cannot guarantee the suitability of this software for any
purpose not confirmed by us in written form.
Guarantee claims shall be limited to the right to require rectification. Liability for any damages which
may have arisen from the use of this software or its documentation shall be limited to cases of intent.
We reserve the right to modify our products and their specifications at any time in as far as this
contribute to technical progress. The version of the manual supplied with the software applies.
Please notice: Windows 95/98/ME and Windows NT/2000/CE/XP/Vista are registered trademarks of
Microsoft Corporation.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

Table of Contents
1
1.1
1.2
1.3
1.4

Introduction....................................................................................................................................9
Abstract ...................................................................................................................................... 9
System Requirements ................................................................................................................ 9
Intended Audience ..................................................................................................................... 9
Specifications ........................................................................................................................... 10
1.4.1
1.4.2

Protocol Task System .................................................................................................................... 10


Technical Data ............................................................................................................................... 10

1.5
1.6

Terms, Abbreviations and Definitions ...................................................................................... 12


References ............................................................................................................................... 12

2.1
2.2

Fundamentals ..............................................................................................................................13
General Access Mechanisms on netX Systems ...................................................................... 13
Accessing the Protocol Stack by Programming the AP Tasks Queue.................................... 14

2.2.1
2.2.2

2.3

Accessing the Protocol Stack via the Dual Port Memory Interface.......................................... 15
2.3.1
2.3.2
2.3.3

2.4

3.1

Input Process Data......................................................................................................................... 24


Output Process Data...................................................................................................................... 24

Acyclic Data (Mailboxes) .......................................................................................................... 25


3.2.1
3.2.2
3.2.3
3.2.4
3.2.5
3.2.6

3.3

Application as Client....................................................................................................................... 21
Application as Server ..................................................................................................................... 22

Dual-Port Memory........................................................................................................................23
Cyclic Data (Input/Output Data) ............................................................................................... 23
3.1.1
3.1.2

3.2

Communication via Mailboxes ....................................................................................................... 15


Using Source and Destination Variables correctly ......................................................................... 16
Obtaining useful Information about the Communication Channel .................................................. 19

Client/Server Mechanism ......................................................................................................... 21


2.4.1
2.4.2

Getting the Receiver Task Handle of the Process Queue.............................................................. 14


Meaning of Source- and Destination-related Parameters .............................................................. 14

General Structure of Messages or Packets for Non-Cyclic Data Exchange................................... 26


Status & Error Codes ..................................................................................................................... 29
Differences between System and Channel Mailboxes ................................................................... 29
Send Mailbox ................................................................................................................................. 30
Receive Mailbox............................................................................................................................. 30
Channel Mailboxes (Details of Send and Receive Mailboxes) ....................................................... 30

Status ....................................................................................................................................... 31
3.3.1
3.3.2

Common Status ............................................................................................................................. 31


Extended Status............................................................................................................................. 37

3.4

Control Block ............................................................................................................................ 49

4.1
4.2

Getting started / Configuration ..................................................................................................50


Overview about Essential Functionality ................................................................................... 50
Warmstart Parameters ............................................................................................................. 51

4.2.1

4.3

Behavior when receiving a Set Configuration / Warmstart Command............................................ 53

Input and Output Data .............................................................................................................. 54


4.3.1
4.3.2

Input and Output Data for CC-Link Version 1................................................................................. 54


Input and Output Data for CC-Link Version 2................................................................................. 56

4.4

Task Structure of the CC-Link Slave Stack.............................................................................. 60

5.1

The Application Interface............................................................................................................61


The CC-Link APS-Task ............................................................................................................ 62

5.1.1
5.1.2

5.2

CCLINK_APS_WARMSTART_REQ/CNF Set Warmstart Parameters............................................. 63


CCLINK_APS_SET_CONFIGURATION_REQ/CNF Set Configuration .......................................... 73

The CC-Link Slave-Task .......................................................................................................... 79


5.2.1
5.2.2
5.2.3
5.2.4
5.2.5
5.2.6
5.2.7
5.2.8

CCLINK_SLAVE_INITIALIZE_REQ/CNF Initialization of CC-Link Slave .................................. 80


CCLINK_SLAVE_REGISTER_REQ/CNF Register Application .................................................... 83
CCLINK_SLAVE_GET_BUFFER_HANDLE_REQ/CNF Get Buffer Handle................................ 87
CCLINK_SLAVE_SET_BUSPARAM_REQ/CNF Set Bus Parameters ....................................... 91
CCLINK_SLAVE_STARTSTOP_REQ/CNF Start/Stop Communication with Network.................... 97
CCLINK_SLAVE_GET_CCL_STATUS_REQ/CNF Get CC-Link Status ................................... 101
CLINK_SLAVE_CHANGE_SLAVE_STATUS_REQ/CNF Change CC-Link Slave Status......... 105
CCLINK_SLAVE_GET_BUS_PARAM_REQ/CNF Get Bus Parameters................................... 111

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API


5.2.9
5.2.10

6
6.1
6.2
7

CCLINK_SLAVE_STATE_CHANGE_IND/RES Change of State Indication ............................. 114


CCLINK_SLAVE_SET_WATCHDOG_FAIL_REQ/CNF Set Watchdog Fail......................... 119

Status/Error Codes Overview ...................................................................................................121


Status/Error Codes CC-Link APS-Task ................................................................................. 121
Status/Error codes CC-Link Slave-Task ................................................................................ 123
Contact........................................................................................................................................125

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

List of Figures
Figure 1 - The three different Ways to access a Protocol Stack running on a netX System .................................. 13
Figure 2 - Use of ulDest in Channel and System Mailbox ................................................................................... 16
Figure 3 - Using ulSrc and ulSrcId................................................................................................................... 17
Figure 4: Transition Chart Application as Client ..................................................................................................... 21
Figure 5: Transition Chart Application as Server.................................................................................................... 22
Figure 6: Internal Structure of CC-Link Slave Firmware......................................................................................... 60

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

List of Tables
Table 1: Names of Tasks in CC-Link Slave Firmware............................................................................................ 10
Table 2: Terms, Abbreviations and Definitions ...................................................................................................... 12
Table 3: References............................................................................................................................................... 12
Table 4: Names of Queues in CC-Link Slave Firmware......................................................................................... 14
Table 5: Meaning of Source- and Destination-related Parameters. ....................................................................... 14
Table 6: Meaning of Destination-Parameter ulDest.Parameters. ........................................................................... 16
Table 7 Example for correct Use of Source- and Destination-related parameters.: ............................................... 18
Table 8: Input Data Image ..................................................................................................................................... 24
Table 9: Output Data Image................................................................................................................................... 24
Table 10: General Structure of Packets for non-cyclic Data Exchange.................................................................. 26
Table 11: Status and Error Codes.......................................................................................................................... 29
Table 12: Channel Mailboxes. ............................................................................................................................... 30
Table 13: Common Status Block............................................................................................................................ 32
Table 14: ST1 Data Transfer from Master to Slave Station ................................................................................ 39
Table 15: Allowed Values of Master Station (User Application Program) .............................................................. 39
Table 16: Allowed Values of Master Station User Application Program Error Check............................................. 39
Table 17: Allowed Values of Refresh Startup ........................................................................................................ 40
Table 18: Allowed Values of Transient Data Status ............................................................................................... 40
Table 19: Allowed Values of Transient Data Reception Enable ............................................................................. 40
Table 20: Allowed Values of Protocol Version ....................................................................................................... 40
Table 21: Allowed Values of Master Station Type.................................................................................................. 41
Table 22: ST1 Data Transfer from Slave to Master Station ................................................................................ 42
Table 23: Allowed Values of Fuse Status .............................................................................................................. 42
Table 24: Allowed Values of Unit Error/Invalid No. of Points ................................................................................. 43
Table 25: Allowed Values of Refresh Receive ....................................................................................................... 43
Table 26: Allowed Values of Parameter Receive ................................................................................................... 43
Table 27: Allowed Values of Switch Change Detection ......................................................................................... 43
Table 28: Allowed Values of Cyclic Transmission Flag.......................................................................................... 44
Table 29: Allowed Values of Watchdog Timer Error .............................................................................................. 44
Table 30: ST2 Data Transfer from Master to Slave Station ................................................................................ 44
Table 31: RY Information Transmission Points ...................................................................................................... 45
Table 32: RWw Information Transmission Points .................................................................................................. 45
Table 33: ST2 Data Transfer from Slave to Master Station ................................................................................ 46
Table 34: Allowed Values of Transient Data Status ............................................................................................... 46
Table 35: Allowed Values of Transient Receive..................................................................................................... 46
Table 36: Allowed Values of Transient Type.......................................................................................................... 47
Table 37: Allowed Values of Transmission Status ................................................................................................. 47
Table 38: Allowed Values of Extended cycle setting.............................................................................................. 47
Table 39: Communication Control Block................................................................................................................ 49
Table 40: Overview about Essential Functionality.................................................................................................. 50
Table 41: Meaning and allowed Values for Warmstart-Parameters. ...................................................................... 52
Table 42: Available Baud Rate Values................................................................................................................... 53
Table 43: Input and Output Data for Remote I/O Device ....................................................................................... 54
Table 44: Input and Output Data for Remote Device Station with One Occupied Station...................................... 54
Table 45: Input and Output Data for Remote Device Station with Two Occupied Stations .................................... 54
Table 46: Input and Output Data for Remote Device Station with Three Occupied Stations ................................. 54
Table 47: Input and Output Data for Remote Device Station with Four Occupied Stations ................................... 55
Table 48: Input and Output Data for Remote Device Station with One Occupied Stations, Single Setting ............ 56
Table 49: Input and Output Data for Remote Device Station with Two Occupied Stations, Single Setting ............ 56
Table 50: Input and Output Data for Remote Device Station with Three Occupied Stations, Single Setting ......... 56
Table 51: Input and Output Data for Remote Device Station with Four Occupied Stations, Single Setting ........... 56
Table 52: Input and Output Data for Remote Device Station with One Occupied Station, Double Setting ............ 57
Table 53: Input and Output Data for Remote Device Station with Two Occupied Stations, Double Setting........... 57
Table 54: Input and Output Data for Remote Device Station with Three Occupied Stations, Double Setting ........ 57
Table 55: Input and Output Data for Remote Device Station with Four Occupied Stations, Double Setting .......... 57
Table 56: Input and Output Data for Remote Device Station with One Occupied Station, Quadruple Setting ....... 58
Table 57: Input and Output Data for Remote Device Station with Two Occupied Stations, Quadruple Setting ..... 58
Table 58: Input and Output Data for Remote Device Station with Three Occupied Stations, Quadruple Setting... 58
Table 59: Input and Output Data for Remote Device Station with Four Occupied Stations, Quadruple Setting..... 58
Table 60: Input and Output Data for Remote Device Station with One Occupied Station, Octuple Setting ........... 59
Table 61: Input and Output Data for Remote Device Station with Two Occupied Stations, Octuple Setting.......... 59
Table 62: Input and Output Data for Remote Device Station with Three Occupied Stations, Octuple Setting ....... 59
Table 63: Input and Output Data for Remote Device Station with Four Occupied Stations, Octuple Setting ......... 59
Table 64: CC-Link APS-Task Process Queue ....................................................................................................... 62

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

Introduction 8

Table 65: CCLINK_APS_PCK_WARMSTART_REQ_T Set Warmstart Parameter Request.................................... 67


Table 66: CCLINK_APS_PCK_WARMSTART_CNF_T Set Warmstart Parameter Confirmation ............................. 71
Table 67: CCLINK_APS_PCK_WARMSTART_CNF Packet Status/Error ................................................................ 72
Table 68: CCLINK_APS_PCK_SET_CONFIGURATION_REQ_T Set Warmstart Parameter Request................... 77
Table 69: CCLINK_APS_PCK_SET_CONFIGURATION_CNF_T Set Warmstart Parameter Confirmation............ 78
Table 70: CC-Link APS-Task Process Queue ....................................................................................................... 79
Table 71: CCLINK_SLAVE_PACKET_INITIALIZE_REQ_T Initialization of CC-Link Slave Request ................. 81
Table 72: CCLINK_SLAVE_PACKET_INITIALIZE_CNF_T Initialization of CC-Link Slave Confirmation .......... 82
Table 73: CCLINK_SLAVE_PACKET_APP_REGISTER_REQ_T Register Application Request ........................... 84
Table 74: CCLINK_SLAVE_REGISTER_REQ Packet Status/Error ...................................................................... 84
Table 75: CCLINK_SLAVE_PACKET_APP_REGISTER_CNF_T Register Application Confirmation .................... 85
Table 76: CCLINK_SLAVE_REGISTER_CNF Packet Status/Error ...................................................................... 86
Table 77: CCLINK_SLAVE_PACKET_GET_BUFFER_HANDLE_REQ_T Get Buffer Handle Request .................... 88
Table 78: CCLINK_SLAVE_GET_BUFFER_HANDLE_CNF_T Get Buffer Handle Confirmation ............................ 90
Table 79: CCLINK_SLAVE_CFG_BUS_PARAM_T - Bus Parameter Configuration.................................................. 93
Table 80: CCLINK_SLAVE_CFG_ADD_PARAM_T - Additional Configuration.......................................................... 93
Table 81: CCLINK_SLAVE_SET_BUSPARAM_REQ_DATA_T Set Bus Parameter Request ................................. 95
Table 82: CCLINK_SLAVE_PACKET_SET_BUSPARAM_CNF_T Set Bus Parameter Confirmation ....................... 96
Table 83: CCLINK_SLAVE_PACKET_STARTSTOP_REQ_T Start/Stop Communication Request ........................ 98
Table 84: CCLINK_SLAVE_PACKET_STARTSTOP_CNF_T Start/Stop Communication Confirmation ............... 100
Table 85: CCLINK_SLAVE_PACKET_GET_CCL_STATUS_REQ_T Get CC-Link Status Request ...................... 102
Table 86: CCLINK_SLAVE_PACKET_GET_CCL_STATUS_CNF_T Get CC-Link Status Confirmation ............... 104
Table 87: CCLINK_SLAVE_PACKET_CHANGE_SLAVE_STATUS_REQ_T Change CC-Link Slave Status Request
................................................................................................................................................................... 107
Table 88: CCLINK_SLAVE_PACKET_CHANGE_SLAVE_STATUS_CNF_T Change CC-Link Slave Status
Confirmation ............................................................................................................................................... 110
Table 89: CCLINK_SLAVE_PACKET_GET_BUS_PARAM_REQ_T Get Bus Parameter Request ........................ 111
Table 90: CCLINK_SLAVE_PACKET_GET_BUS_PARAM_CNF_T Get Bus Parameter Confirmation.................. 113
Table 91: CCLINK_SLAVE_PACKET_STATE_CHANGE_IND_T Change of State Indication ............................. 115
Table 92: CCLINK_SLAVE_PACKET_STATE_CHANGE_RES_T Change of State Response............................. 118
Table 93: CCLINK_SLAVE_PACKET_SET_WATCHDOG_FAIL_REQ_T Set Watchdog Fail Request ................. 119
Table 94: CCLINK_SLAVE_PACKET_SET_WATCHDOG_FAIL_CNF_T Set Watchdog Fail Confirmation .......... 120
Table 95: Status/Error Codes CC-Link APS-Task................................................................................................ 122
Table 96: Status/Error Codes CC-Link Slave-Task.............................................................................................. 124

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

Introduction 9

1 Introduction
1.1

Abstract

This manual describes the application interface of the CC-Link Slave- stack, with the aim to support
and lead you during the integration process of the given stack into your own application.
Stack development is based on Hilschers Task Layer Reference Programming Model. This model
defines the general template used to create a task including a combination of appropriate functions
belonging to the same type of protocol layer. Furthermore, it defines of how different tasks have to
communicate with each other in order to exchange data between each communication layer. This
Reference Model is used by all programmers at Hilscher and shall be used by the developer when
writing an application task on top of the stack.

1.2

System Requirements

This software package has the following environmental system requirements:


netX-Chip as CPU hardware platform
Operating system for task scheduling required

1.3

Intended Audience

This manual is suitable for software developers with the following background:
Knowledge of the programming language C
Knowledge of the use of the real time operating system rcX
Knowledge of the Hilscher Task Layer Reference Model
Knowledge of the CC-Link Specification BAP-05026-J

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Introduction 10

CC-Link Slave Protocol API

1.4

Specifications

This stack has been written to meet the requirements outlined in the CC-Link specification Ver.2.00
BAP-05026-J.

1.4.1

Protocol Task System

To manage the CC-Link Slave implementation 2 tasks are involved into the system. To send packets
to a task, the task main queue has to be identified. For the identifier for the tasks and there Queues
are the following naming conversion:

Task Name

Queue Name

Description

CCLINK_SLAVE

QUE_CCLSLAVE

CC-Link Slave protocol task

CCLINK_APS

QUE_CCLAPS

CC-Link Slave application task

Table 1: Names of Tasks in CC-Link Slave Firmware

1.4.2

Technical Data

The data below applies to the CC-Link firmware and stack version V2.2.2 The firmware/stack support
CC-Link Version 2.0 and 1.11
This firmware/stack has been written to meet the requirements outlined in the CC-Link specification
Ver.2.00 BAP-05026-J.
Technical Data
Data for firmware/stack working according to CC-Link Version 2.0
Station Types

Remote device station, up to four occupied


stations

Maximum input data

368 bytes

Maximum output data

368 bytes

Input data remote device station

112 bytes (RY) and 256 bytes (RWw)

Output data remote device station

112 bytes (RX) and 256 bytes (RWr)

Extension cycles

1, 2, 4, 8

Baud rates

156 KBit/s, 625 KBit/s, 2500 kBit/s, 5 MBit/s,


10 MBit/s

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Introduction 11

CC-Link Slave Protocol API


Data for firmware/stack working according to CC-Link Version 1.11
Station Types

Remote I/O station,


Remote device station (Up to four occupied
stations)

Maximum input data

48 bytes

Maximum output data

48 bytes

Input data remote I/O station

4 bytes (RY)

Output data remote I/O station

4 bytes (RX)

Input data remote device station

4 bytes (RY) and 8 bytes (RWw) per occupied


station

Output data remote device station

4 bytes (RX) and 8 bytes (RWr) per occupied


station

Baud rates

156 KBit/s, 625 KBit/s, 2500 kBit/s, 5 MBit/s,


10 MBit/s

Firmware/stack available for netX


netX 50

yes

netX 100, netX 500

yes

Configuration
Configuration by packet to transfer warmstart parameters
Diagnostic
Firmware supports common and extended diagnostic in the dual-port-memory for loadable firmware
Limitations
Intelligent Device Station not supported yet

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

1.5

Introduction 12

Terms, Abbreviations and Definitions

Term

Description

AP

Application on top of the Stack

RX

Receive bit data (Remote I/O Station and Remote Device Station)

RY

Send bit data (Remote I/O Station and Remote Device Station)

RWr

Receive register data (Remote Device Station only)

RWw

Send register data (Remote Device Station only)

Table 2: Terms, Abbreviations and Definitions

All variables, parameters, and data used in this manual have the LSB/MSB (Intel) data
representation. This corresponds to the convention of the Microsoft C Compiler.

1.6

References

This document is based on the following specifications:

netX DPM Interface Manual, Hilscher GmbH

CC-Link Specification BAP-05026-J

Table 3: References

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Fundamentals 13

CC-Link Slave Protocol API

2 Fundamentals
2.1

General Access Mechanisms on netX Systems

This chapter explains the possible ways to access a Protocol Stack running on a netX system :
1. By accessing the Dual Port Memory Interface directly or via a driver.
2. By accessing the Dual Port Memory Interface via a shared memory.
3. By interfacing with the Stack Task of the Protocol Stack.
The picture below visualizes these three ways:

1
2

(Extended) Status Block

Send Mailbox

Reveive Mailbox

Output Data Image

Input Data Image

AP Task

Fieldbus Task(s)

Network Abstraction Layer

Network

Figure 1 - The three different Ways to access a Protocol Stack running on a netX System

This chapter explains how to program the stack (alternative 3) correctly while the next chapter
describes accessing the protocol stack via the dual-port memory interface according to alternative 1
(and 2, if the user application is executed on the netX chip in the context of the rcX operating system
and uses the shared DPM). Finally, chapter 1 titled describes the entire interface to the protocol
stack in detail.
Depending on you choose the stack-oriented approach or the Dual Port Memory-based approach, you
will need either the information given in this chapter or those of the next chapter to be able to work
with the set of functions described in chapter 5. All of those functions use the four parameters
ulDest, ulSrc, ulDestId and ulSrcId. This chapter and the next one inform about how to
work with these important parameters.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Fundamentals 14

CC-Link Slave Protocol API

2.2

Accessing the Protocol Stack by Programming the AP Tasks


Queue

In general, programming the AP task or the stack has to be performed according to the rules
explained in the Hilscher Task Layer Reference Manual. There you can also find more information
about the variables discussed in the following.

2.2.1

Getting the Receiver Task Handle of the Process Queue

To get the handle of the process queue of the CC-Link Slave Protocol-Task or the CC-Link
Slave Application-Task the Macro TLR_QUE_IDENTIFY() needs to be used. It is described in
detail within section 10.1.9.3 of the Hilscher Task Layer Reference Model Manual. This macro delivers
a pointer to the handle of the intended queue to be accessed (which is returned within the third
parameter, phQue), if you provide it with the name of the queue (and an instance of your own task).
The correct ASCII-queue names for accessing the CC-Link Slave Protocol-Task or the CCLink Slave Application-Task, which you have to use as current value for the first parameter
(pszIdn), is

ASCII Queue name

Description

"QUE_CCLSLAVE

Name of the CC-Link Slave Protocol-Task process queue

"QUE_CCLAPS

Name of the CC-Link Slave Application-Task process queue

Table 4: Names of Queues in CC-Link Slave Firmware

The returned handle has to be used as value ulDest in all initiator packets the AP-Task intends to
send to the CC-Link Slave-Task . This handle is the same handle that has to be used in
conjunction with the macros like TLR_QUE_SENDPACKET_FIFO/LIFO() for sending a packet to the
respective task.

2.2.2

Meaning of Source- and Destination-related Parameters

The meaning of the source- and destination-related parameters is explained in the following table:
Variable

Meaning

ulDest

Application mailbox used for confirmation

ulSrc

Queue handle returned by TLR_QUE_IDENTIFY() as described above.

ulSrcId

Used for addressing at a lower level

Table 5: Meaning of Source- and Destination-related Parameters.

For more information about programming the AP tasks stack queue, please refer to the Hilscher Task
Layer Reference Model Manual. Especially the following sections might be of interest in this context:
1. Chapter 7 Queue-Packets
2. Section 10.1.9 Queuing Mechanism

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

2.3

Fundamentals 15

Accessing the Protocol Stack via the Dual Port Memory


Interface

This chapter defines the application interface of the CC-Link Slave Stack.

2.3.1

Communication via Mailboxes

The mailbox of each communication channel has two areas that are used for non-cyclic message
transfer to and from the netX.

Send Mailbox
Packet transfer from host system to netX firmware

Receive Mailbox
Packet transfer from netX firmware to host system

For more details about acyclic data transfer via mailboxes, see section 3.2. Acyclic Data (Mailboxes) in
this context, is described in detail in section 3.2.1 General Structure of Messages or Packets for NonCyclic Data Exchange while the possible codes that may appear are listed in section 3.2.2. Status &
Error Codes.
However, this section concentrates on correct addressing the mailboxes.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Fundamentals 16

CC-Link Slave Protocol API

2.3.2

Using Source and Destination Variables correctly

2.3.2.1

How to use ulDest for Addressing rcX and the netX Protocol Stack by the System
and Channel Mailbox

System
Mailbox

Channel 0
Mainbox

ulDest = 0x02

ulDest = 0x01

ulDest = 0x00

ulDest = 0x20

ulDest = 0x02

ulDest = 0x01

ulDest = 0x00

ulDest = 0x20

ulDest = 0x02

ulDest = 0x01

ulDest = 0x00

ulDest = 0x20

The preferred way to address the netX operating system rcX is through the system mailbox; the
preferred way to address a protocol stack is through its channel mailbox. All mailboxes, however, have
a mechanism to route packets to a communication channel or the system channel, respectively.
Therefore, the destination identifier ulDest in a packet header has to be filled in according to the
targeted receiver. See the following example:

Channel 1
Mailbox

netX OS
rcX
AP Task 1
AP Task 2

Figure 2 - Use of ulDest in Channel and System Mailbox

For use in the destination queue handle, the tasks have been assigned to hexadecimal numerical
values as described in the following table:

ulDest

Description

0x00000000

Packet is passed to the netX operating system rcX

0x00000001

Packet is passed to communication channel 0

0x00000002

Packet is passed to communication channel 1

0x00000003

Packet is passed to communication channel 2

0x00000004

Packet is passed to communication channel 3

0x00000020

Packet is passed to communication channel of the mailbox

else

Reserved, do not use

Table 6: Meaning of Destination-Parameter ulDest.Parameters.

The figure and the table above both show the use of the destination identifier ulDest.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

Fundamentals 17

A remark on the special channel identifier 0x00000020 (= Channel Token). The Channel Token is
valid for any mailbox. That way the application uses the same identifier for all packets without actually
knowing which mailbox or communication channel is applied. The packet stays 'local'. The system
mailbox is a little bit different, because it is used to communicate to the netX operating system rcX.
The rcX has its own range of valid commands codes and differs from a communication channel.
Unless there is a reply packet, the netX operating system returns it to the same mailbox the request
packet went through. Consequently, the host application has to return its reply packet to the mailbox
the request was received from.

2.3.2.2

How to use ulSrc and ulSrcId

Generally, a netX protocol stack can be addressed through its communication channel mailbox. The
example below shows how a host application addresses a protocol stack running in the context of a
netX chip. The application is identified by a number (#444 in this example). The application consists
of three processes identified by the numbers #11, #22 and #33. These processes communicate
through the channel mailbox with the AP task of the protocol stack. Have a look at the following figure:

Process #33

Process #22

Process #11

Application #444

Channel
Mainbox

netX Protocol stack


AP Task 1

Figure 3 - Using ulSrc and ulSrcId

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Fundamentals 18

CC-Link Slave Protocol API


Example:

This example applies to command messages initiated by a process in the context of the host
application. If the process #22 sends a packet through the channel mailbox to the AP task, the packet
header has to be filled in as follows:

Object

Variable
Name

Numeric Value

Explanation

Destination
Queue
Handle

ulDest

= 32

This value needs always to be set to 0x00000020 (the channel


token) when accessing the protocol stack via the local
communication channel mailbox.

Source
Queue
Handle

ulSrc

= 444

Denotes the host application (#444).

Destination
Identifier

ulDestId

= 0

In this example, it is not necessary to use the destination


identifier.

Source
Identifier

ulSrcId

= 22

Denotes the process number of the process within the host


application and needs therefore to be supplied by the programmer
of the host application.

(0x00000020)

Table 7 Example for correct Use of Source- and Destination-related parameters.:

For packets through the channel mailbox, the application uses 32 (= 0x20, Channel Token) for the
destination queue handler ulDest. The source queue handler ulSrc and the source identifier ulSrcId
are used to identify the originator of a packet. The destination identifier ulDestId can be used to
address certain resources in the protocol stack. It is not used in this example. The source queue
handler ulSrc has to be filled in. Therefore, its use is mandatory; the use of ulSrcId is optional.
The netX operating system passes the request packet to the protocol stack's AP task. The protocol
stack then builds a reply to the packet and returns it to the mailbox. The application has to make sure
that the packet finds its way back to the originator (process #22 in the example).
2.3.2.3

How to Route rcX Packets

To route an rcX packet the source identifier ulSrcId and the source queues handler ulSrc in the packet
header hold the identification of the originating process. The router saves the original handle from
ulSrcId and ulSrc. The router uses a handle of its own choices for ulSrcId and ulSrc before it sends the
packet to the receiving process. That way the router can identify the corresponding reply packet and
matches the handle from that packet with the one stored earlier. Now the router replaces its handles
with the original handles and returns the packet to the originating process.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

2.3.3

Fundamentals 19

Obtaining useful Information about the Communication Channel

A communication channel represents a part of the Dual Port Memory and usually consists of the
following elements:

Output Data Image


is used to transfer cyclic process data to the network (normal or high-priority)
Input Data Image
is used to transfer cyclic process data from the network (normal or high-priority)
Send Mailbox
is used to transfer non-cyclic data to the netX
Receive Mailbox
is used to transfer non-cyclic data from the netX
Control Block
allows the host system to control certain channel functions
Common Status Block
holds information common to all protocol stacks
Extended Status Block
holds protocol specific network status information

This section describes a procedure how to obtain useful information for accessing the communication
channel(s) of your netX device and to check if it is ready for correct operation.
Proceed as follows:
1) Start with reading the channel information block within the system channel (usually starting at
address 0x0030).
2) Then you should check the hardware assembly options of your netX device. They are located
within the system information block following offset 0x0010 and stored as data type UINT16.
The following table explains the relationship between the offsets and the corresponding xC
Ports of the netX device:

0x0010

Hardware Assembly Options for xC Port[0]

0x0012

Hardware Assembly Options for xC Port[1]

0x0014

Hardware Assembly Options for xC Port[2]

0x0016

Hardware Assembly Options for xC Port[3]

Check each of the hardware assembly options whether its value has been set to
RCX_HW_ASSEMBLY_CCLINK = 0x0070. If true, this denotes that this xCPort is suitable for
running the CC-Link Slave protocol stack. Otherwise, this port is designed for another
communication protocol. In most cases, xC Port[2] will be used for field bus systems, while xC
Port[0] and xC Port[1] are normally used for Ethernet communication.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Fundamentals 20

CC-Link Slave Protocol API

3) You can find information about the corresponding communication channel (03) under the
following addresses:

0x0050

Communication Channel 0

0x0060

Communication Channel 1

0x0070

Communication Channel 2

0x0080

Communication Channel 3

In devices which support only one communication system which is usually the case (either a
single field bus system or a single standard for Industrial-Ethernet communication), always
communication channel 0 will be used. In devices supporting more than one communication
system you should also check the other communication channels.
4) There you can find such information as the ID (containing channel number and port number)
of the communication channel, the size and the location of the handshake cells, the overall
number of blocks within the communication channel and the size of the channel in bytes.
Evaluate this information precisely in order to access the communication channel correctly.
The information is delivered as follows:
Size of Channel in Bytes
Address

Data Type

Description

0x0050

UINT8

Channel Type = COMMUNICATION


(must have the fixed value
define RCX_CHANNEL_TYPE_COMMUNICATION = 0x05)

0x0051

UINT8

ID (Channel Number, Port Number)

0x0052

UINT8

Size / Position Of Handshake Cells

0x0053

UINT8

Total Number Of Blocks Of This Channel

0x0054

UINT32

Size Of Channel In Bytes

0x0058

UINT8[8]

Reserved (set to zero)

These addresses correspond to communication channel 0, for communication channels 1, 2


and 3 you have to add an offset of 0x0010, 0x0020 or 0x0030 to the address values,
respectively.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Fundamentals 21

CC-Link Slave Protocol API

2.4

Client/Server Mechanism

2.4.1 Application as Client


The host application may send request packets to the netX firmware at any time (transition 1 2).
Depending on the protocol stack running on the netX, parallel packets are not permitted (see protocol
specific manual for details). The netX firmware sends a confirmation packet in return, signaling
success or failure (transition 3 4) while processing the request.
The host application has to register with the netX firmware in order to receive indication packets
(transition 5 6). Depending on the protocol stack, this is done either implicit (if application opens a
TCP/UDP socket) or explicit (if application wants to receive unsolicited DPV1 packets). Details on
when and how to register for certain events is described in the protocol specific manual. Depending on
the command code of the indication packet, a response packet to the netX firmware may or may not
be required (transition 7 8).
Application

netX

n
o
p
q

r
s
t
u
Figure 4: Transition Chart Application as Client

n o The host application sends request packets to the netX firmware.


p q The netX firmware sends a confirmation packet in return.
r s The host application receives indication packets from the netX firmware.
t u The host application sends response packet to the netX firmware (may not be required).
Request

Confirmation

Indication

Response

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Fundamentals 22

CC-Link Slave Protocol API

2.4.2

Application as Server

The host application has to register with the netX firmware in order to receive indication packets.
Depending on the protocol stack, this is done either implicit (if application opens a TCP/UDP socket)
or explicit (if application wants to receive unsolicited DPV1 packets). Details on when and how to
register for certain events is described in the protocol specific manual.
When an appropriate event occurs and the host application is registered to receive such a notification,
the netX firmware passes an indication packet through the mailbox (transition 1 2). The host
application is expected to send a response packet back to the netX firmware (transition 3 4).
Application

netX
n

o
p
q
Figure 5: Transition Chart Application as Server

n o The netX firmware passes an indication packet through the mailbox.


p q The host application sends response packet to the netX firmware.
Indication

Response

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

Dual-Port Memory 23

3 Dual-Port Memory
All data in the dual-port memory is structured in blocks. According to their functions, these blocks use
different data transfer mechanisms. For example, data transfer through mailboxes uses a
synchronized handshake mechanism between host system and netX firmware. The same is true for IO
data images, when a buffered handshake mode is configured. Other blocks, like the status block, are
read by the host application and use no synchronization mechanism.
Types of blocks in the dual-port memory are outlined below:

3.1

Mailbox
transfer non-cyclic messages or packages with a header for routing information
Data Area
holds the process image for cyclic I/O data or user defined data structures
Control Block
is used to signal application related state to the netX firmware
Status Block
holds information regarding the current network state
Change of State
collection of flags that initiate execution of certain commands or signal a change of state

Cyclic Data (Input/Output Data)

The input block holds the process data image received from the network whereas the output block
holds data sent to the network
Process data transfer through the data blocks can be synchronized by using a handshake mechanism
(configurable). If in uncontrolled mode, the protocol stack updates the process data in the input and
output data image in the dual-port memory for each valid bus cycle. No handshake bits are evaluated
and no buffers are used. The application can read or write process data at any given time without
obeying the synchronization mechanism otherwise carried out via handshake location. This transfer
mechanism is the simplest method of transferring process data between the protocol stack and the
application. This mode can only guarantee data consistency over a byte.
For the controlled / buffered mode, the protocol stack updates the process data in the internal input
buffer for each valid bus cycle. Each IO block uses handshake bits for access synchronization. Input
and output data block handshake operates independently from each other. When the application
toggles the input handshake bit, the protocol stack copies the data from the internal buffer into the
input data image of the dual-port memory. Now the application can copy data from the dual-port
memory and then give control back to the protocol stack by toggling the appropriate input handshake
bit. When the application/driver toggles the output handshake bit, the protocol stack copies the data
from the output data image of the dual-port memory into the internal buffer. From there the data is
transferred to the network. The protocol stack toggles the handshake bits back, indicating to the
application that the transfer is finished and a new data exchange cycle may start. This mode
guarantees data consistency over both input and output area.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 24

CC-Link Slave Protocol API

3.1.1

Input Process Data

The input data block is used by field bus and industrial Ethernet protocols that utilize a cyclic data
exchange mechanism. The input data image is used to receive cyclic data from the network.

The default size of the input data image is 5760 byte. However, not all available space is actually used
by the protocol stack. Depending on the specific protocol, the area actually available for user data
might be much smaller than 5760 byte. An input data block may or may not be available in the dualport memory. It is always available in the default memory map (see the netX Dual-Port Memory
Manual).
Input Data Image
Offset

Type

Name

Description

0x2680

UINT8

abPd0Input[5760]

Input Data Image


Cyclic Data From The
Network

Table 8: Input Data Image

3.1.2

Output Process Data

The output data block is used by field bus and industrial Ethernet protocols that utilize a cyclic data
exchange mechanism. The output data Image is used to send cyclic data from the host to the
network.

The default size of the output data image is 5760 byte. However, not all available space is actually
used by the protocol stack. Depending on the specific protocol, the area actually available for user
data might be much smaller than 5760 byte. An output data block may or may not be available in the
dual-port memory. It is always available in the default memory map (see netX DPM Manual).
Output Data Image
Offset

Type

Name

Description

0x1000

UINT8

abPd0Output[5760]

Output Data Image


Cyclic Data To The
Network

Table 9: Output Data Image

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

3.2

Dual-Port Memory 25

Acyclic Data (Mailboxes)

The mailbox of each communication channel has two areas that are used for non-cyclic message
transfer to and from the netX processor.

Send Mailbox
Packet transfer from host system to firmware

Receive Mailbox
Packet transfer from firmware to host system

The send and receive mailbox areas are used by field bus and industrial Ethernet protocols providing
a non-cyclic data exchange mechanism. Another use of the mailbox system is to allow access to the
firmware running on the netX chip itself for diagnostic and identification purposes.

The send mailbox is used to transfer acyclic data to the network or to the firmware. The receive
mailbox is used to transfer acyclic data from the network or from the firmware.
A send/receive mailbox may or may not be available in the communication channel. It depends on the
function of the firmware whether or not a mailbox is needed. The location of the system mailbox and
the channel mailbox is described in the netX DPM Interface Manual.

Note: Each mailbox can hold one packet at a time. The netX firmware stores
packets that are not retrieved by the host application in a packet queue. This
queue has limited space and may fill up so new packets maybe lost. To avoid
these data loss situations, it is strongly recommended to empty the mailbox
frequently, even if packets are not expected by the host application.
Unexpected command packets should be returned to the sender with an
Unknown Command in the status field; unexpected reply messages can be
discarded.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 26

CC-Link Slave Protocol API

3.2.1

General Structure of Messages or Packets for Non-Cyclic Data


Exchange

The non-cyclic packets through the netX mailbox have the following structure:
Structure Information
Area Variable

Type

Value / Range

Description

Head Structure Information

Data

ulDest

UINT32

Destination Queue Handle

ulSrc

UINT32

Source Queue Handle

ulDestId

UINT32

Destination Queue Reference

ulSrcId

UINT32

Source Queue Reference

ulLen

UINT32

Packet Data Length (In Bytes)

ulId

UINT32

Packet Identification As Unique Number

ulSta

UINT32

Status / Error Code

ulCmd

UINT32

Command / Response

ulExt

UINT32

Extension Flags

ulRout

UINT32

Routing Information

Structure Information

User Data
Specific To The Command

Table 10: General Structure of Packets for non-cyclic Data Exchange.

Some of the fields are mandatory; some are conditional; others are optional. However, the size of a
packet is always at least 10 double-words or 40 bytes. Depending on the command, a packet may or
may not have a data field. If present, the content of the data field is specific to the command,
respectively the reply.

Destination Queue Handle


The ulDest field identifies a task queue in the context of the netX firmware. The task queue represents
the final receiver of the packet and is assigned to a protocol stack. The ulDest field has to be filled out
in any case. Otherwise, the netX operating system cannot route the packet. This field is mandatory.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

Dual-Port Memory 27

Source Queue Handle


The ulSrc field identifies the sender of the packet. In the context of the netX firmware (inter-task
communication) this field holds the identifier of the sending task. Usually, a driver uses this field for its
own handle, but it can hold any handle of the sending process. Using this field is mandatory. The
receiving task does not evaluate this field and passes it back unchanged to the originator of the
packet.

Destination Identifier
The ulDestId field identifies the destination of an unsolicited packet from the netX firmware to the host
system. It can hold any handle that helps to identify the receiver. Therefore, its use is mandatory for
unsolicited packets. The receiver of unsolicited packets has to register for this.

Source Identifier
The ulSrcId field identifies the originator of a packet. This field is used by a host application, which
passes a packet from an external process to an internal netX task. The ulSrcId field holds the handle
of the external process. When netX operating system returns the packet, the application can identify
the packet and returns it to the originating process. The receiving task on the netX does not evaluate
this field and passes it back unchanged. For inter-task communication, this field is not used.

Length of Data Field


The ulLen field holds the size of the data field in bytes. It defines the total size of the packets payload
that follows the packets header. The size of the header is not included in ulLen. So the total size of a
packet is the size from ulLen plus the size of packets header. Depending on the command, a data
field may or may not be present in a packet. If no data field is included, the length field is set to zero.

Identifier
The ulId field is used to identify a specific packet among others of the same kind. That way the
application or driver can match a specific reply or confirmation packet to a previous request packet.
The receiving task does not change this field and passes it back to the originator of the packet. Its use
is optional in most of the cases. However, it is mandatory for sequenced packets.
Example: Downloading big amounts of data that does not fit into a single packet. For a sequence of
packets the identifier field is incremented by one for every new packet.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

Dual-Port Memory 28

Status / Error Code


The ulSta field is used in response or confirmation packets. It informs the originator of the packet
about success or failure of the execution of the command. The field may be also used to hold status
information in a request packet.

Command / Response
The ulCmd field holds the command code or the response code, respectively. The command/response
is specific to the receiving task. If a task is not able to execute certain commands, it will return the
packet with an error indication. A command is always even (the least significant bit is zero). In the
response packet, the command code is incremented by one indicating a confirmation to the request
packet.

Extension Flags
The extension field ulExt is used for controlling packets that are sent in a sequenced manner. The
extension field indicates the first, last or a packet of a sequence. If sequencing is not required, the
extension field is not used and set to zero.

Routing Information
The ulRout field is used internally by the netX firmware only. It has no meaning to a driver type
application and therefore set to zero.

User Data Field


This field contains data related to the command specified in ulCmd field. Depending on the command,
a packet may or may not have a data field. The length of the data field is given in the ulLen field.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 29

CC-Link Slave Protocol API

3.2.2

Status & Error Codes

The following status and error codes can be returned in ulSta:


Status and Error Codes
Code (Symbolic Constant)

Numerical Value

Meaning

RCX_S_OK

0x00000000

SUCCESS, STATUS OKAY

RCX_S_QUE_UNKNOWN

0xC02B0001

UNKNOWN QUEUE

RCX_S_QUE_INDEX_UNKNOWN

0xC02B0002

UNKNOWN QUEUE INDEX

RCX_S_TASK_UNKNOWN

0xC02B0003

UNKNOWN TASK

RCX_S_TASK_INDEX_UNKNOWN

0xC02B0004

UNKNOWN TASK INDEX

RCX_S_TASK_HANDLE_INVALID

0xC02B0005

INVALID TASK HANDLE

RCX_S_TASK_INFO_IDX_UNKNOWN

0xC02B0006

UNKNOWN INDEX

RCX_S_FILE_XFR_TYPE_INVALID

0xC02B0007

INVALID TRANSFER TYPE

RCX_S_FILE_REQUEST_INCORRECT

0xC02B0008

INVALID FILE REQUEST

RCX_S_UNKNOWN_DESTINATION

0xC0000005

UNKNOWN DESTINATION

RCX_S_UNKNOWN_DESTINATION_ID

0xC0000006

UNKNOWN DESTINATION ID

RCX_S_INVALID_LENGTH

0xC0000007

INVALID LENGTH

RCX_S_UNKNOWN_COMMAND

0xC0000004

UNKNOWN COMMAND

RCX_S_INVALID_EXTENSION

0xC0000008

INVALID EXTENSION

Table 11: Status and Error Codes.

3.2.3

Differences between System and Channel Mailboxes

The mailbox system on netX provides a non-cyclic data transfer channel for field bus and industrial
Ethernet protocols. Another use of the mailbox is allowing access to the firmware running on the netX
chip itself for diagnostic purposes. There is always a send and a receive mailbox. Send and receive
mailboxes utilize handshake bits to synchronize these data or diagnostic packages through the
mailbox. There is a pair of handshake bits for both the send and receive mailbox.

The netX operating system rcX only uses the system mailbox.

The system mailbox, however, has a mechanism to route packets to a communication


channel.
A channel mailbox passes packets to its own protocol stack only.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 30

CC-Link Slave Protocol API

3.2.4

Send Mailbox

The send mailbox area is used by protocols utilizing a non-cyclic data exchange mechanism. Another
use of the mailbox system is to provide access to the firmware running on the netX chip itself. The
send mailbox is used to transfer non-cyclic data to the network or to the protocol stack.

The size is 1596 bytes for the send mailbox in the default memory layout. The mailbox is accompanied
by counters that hold the number of packages that can be accepted.

3.2.5

Receive Mailbox

The receive mailbox area is used by protocols utilizing a non-cyclic data exchange mechanism.
Another use of the mailbox system is to provide access to the firmware running on the netX chip itself.
The receive mailbox is used to transfer non-cyclic data from the network or from the protocol stack.

The size is 1596 bytes for the receive mailbox in the default memory layout. The mailbox is
accompanied by counters that hold the number of waiting packages (for the receive mailbox).

3.2.6

Channel Mailboxes (Details of Send and Receive Mailboxes)

Master Status
Offset

Type

Name

Description

0x0200

UINT16

usPackagesAccepted

Packages Accepted
Number of Packages that
can be Accepted

0x0202

UINT16

usReserved

Reserved
Set to 0

0x0204

UINT8

abSendMbx[ 1596 ]

Send Mailbox
Non Cyclic Data To The
Network or to the Protocol
Stack

0x0840

UINT16

usWaitingPackages

Packages waiting
Counter of packages that
are waiting to be
processed

0x0842

UINT16

usReserved

Reserved
Set to 0

0x0844

UINT8

abRecvMbx[ 1596 ]

Receive Mailbox
Non Cyclic Data from the
network or from the

protocol stack
Table 12: Channel Mailboxes.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

Dual-Port Memory 31

Channel Mailboxes Structure


typedef struct tagNETX_SEND_MAILBOX_BLOCK
{
UINT16 usPackagesAccepted;
UINT16 usReserved;
UINT8 abSendMbx[ 1596 ];
} NETX_SEND_MAILBOX_BLOCK;
typedef struct tagNETX_RECV_MAILBOX_BLOCK
{
UINT16 usWaitingPackages;
UINT16 usReserved;
UINT8 abRecvMbx[ 1596 ];
} NETX_RECV_MAILBOX_BLOCK;

3.3

Status

A status block is present in both system and communication channel. It contains information about
network and task related issues. In some respects, status and control block are used together in order
to exchange information between host application and netX firmware. The application reads a status
block whereas the control block is written by the application. Both status and control block have
registers that use the Change of State mechanism (see section 0).

3.3.1 Common Status


The Common Status Block contains information that is the same for all communication channels. The
start offset of this block depends on the size and location of the preceding blocks. The status block is
always present in the dual-port memory.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 32

CC-Link Slave Protocol API

3.3.1.1

All Implementations

The structure outlined below is common to all protocol stacks:


Common Status Block
Offset

Type

Name

Description

0x0010

UINT32

ulCommunicationCOS

Communication Change of State


READY, RUN, RESET REQUIRED, NEW
CONFIG AVAILABLE, CONFIG LOCKED

0x0014

UINT32

ulCommunicationState

Communication State
NOT CONFIGURED, STOP, IDLE, OPERATE

0x0018

UINT32

ulCommunicationError

Communication Error
Unique Error Number According to Protocol Stack

0x001C

UINT16

usVersion

Version
Version Number of this Diagnosis Structure

0x001E

UINT16

usWatchdogTime

Watchdog Timeout
Configured Watchdog Time

0x0020

UINT16[ ]

ausProtocolClass[2]

Protocol Class
MASTER, SLAVE, CLIENT, SERVER,
GATEWAY

0x0024

UINT32

ulHostWatchdog

Host Watchdog
Joint Supervision Mechanism
Protocol Stack Writes, Host System Reads

0x0028

UINT32

ulErrorCount

Error Count
Total Number of Detected Error Since Power-Up
or Reset

0x002C

UINT32

ulErrorLogInd

Error Log Indicator


Total Number Of Entries In The Error Log
Structure (not supported yet)

0x0030

UINT32[ ]

aulReserved[2]

Reserved
Set to 0

Table 13: Common Status Block

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

Dual-Port Memory 33

Common Status Block Structure


typedef struct NETX_COMMON_STATUS_BLOCK_Ttag
{
UINT32 ulCommunicationCOS;
UINT32 ulCommunicationState;
UINT32 ulCommunicationError;
UINT16 usVersion;
UINT16 usWatchdogTime;
UINT16 ausProtocolClass[2];
UINT32 ulHostWatchdog;
UINT32 ulErrorCount;
UINT32 ulErrorLogInd;
UINT32 aulReserved[2];
union
{
NETX_MASTER_STATUS tMasterStatus;
/* for master implementation */
UINT32
aulReserved[6];
/* otherwise reserved
*/
} uStackDepended;
} NETX_COMMON_STATUS_BLOCK_T;

Communication Change of State (All Implementations)


The communication change of state register contains information about the current operating status of
the communication channel and its firmware. Every time the status changes, the netX protocol stack
toggles the netX Change of State Command flag in the netX communication flags register (see section
3.2.2.1 of the netX DPM Interface Manual). The application then has to toggle the netX Change of
State Acknowledge flag back acknowledging the new state (see section 3.2.2.2 of the netX DPM
Interface Manual).).
Operating State

READY
#define RCX_COMM_COS_READY
0x00000001
The Ready flag is set as soon as the protocol stack is started properly. Then the protocol stack is
awaiting a configuration.

RUNNING
#define RCX_COMM_COS_RUN
0x00000002
The Running flag is set when the protocol stack has been configured properly. Then the protocol
stack is awaiting a network connection.

RESTART REQUIRED
#define RCX_COMM_COS_RESTART_REQUIRED 0x00000004
The Restart Required flag is set when the channel firmware requests to be reset. This may be
caused if a new configuration was downloaded form the host application or if a configuration
upload via the network took place.

CONFIGURATION AVAILABLE #define RCX_COMM_COS_CONFIG_AVAIL


0x00000008
The Configuration Available flag is set when a new configuration file is available for the channel
firmware which has not been yet set active. This flag may be set together with the Restart
Required flag.

CONFIGURATION LOCKED
#define RCX_COMM_COS_CONFIG_LOCKED
0x00000010
The Configuration Locked flag is set, if the communication channel firmware has locked the
configuration database against being overwritten. Re-initializing the channel is not allowed in this
state. To unlock the database, the application has to clear the Lock Configuration flag in the
control block (see section 3.2.4 of the netX DPM Interface Manual). The flag is defined, but not
supported yet.

Others are reserved.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 34

CC-Link Slave Protocol API


Communication State (All Implementations)

The communication state field contains information regarding the current network status of the
communication channel. Depending on the implementation, all or a subset of the definitions below is
supported.

UNKNOWN

#define RCX_COMM_STATE_UNKNOWN

NOT CONFIGURED

#define RCX_COMM_STATE_NOT_CONFIGURED 0x00000001

STOP

#define RCX_COMM_STATE_STOP

0x00000002

IDLE

#define RCX_COMM_STATE_IDLE

0x00000003

OPERATE

#define RCX_COMM_STATE_OPERATE

0x00000004

0x00000000

Communication Channel Error (All Implementations)


This field holds the current error code of the communication channel. If the error is resolved, the
communication error field is set to zero (= RCX_COMM_SUCCESS) again. Not all of the error codes are
supported in every implementation. Protocol stacks may use a subset of the error codes below.

SUCCESS

#define RCX_COMM_SUCCESS

0x00000000

#define RCX_COMM_WATCHDOG_TIMEOUT

0xC000000C

Runtime Failures

WATCHDOG TIMEOUT

Initialization Failures

(General) INITIALIZATION FAULT


#define RCX_COMM_INIT_FAULT
DATABASE ACCESS FAILED

0xC0000100

#define RCX_COMM_DATABASE_ACCESS_FAILED
0xC0000101

Configuration Failures

(General) CONFIGURATION FAULT


#define RCX_COMM_CONFIGURATION_FAULT

0xC0000120

INCONSISTENT DATA SET

#define RCX_COMM_INCONSISTENT_DATA_SET
0xC0000121

DATA SET MISMATCH

#define RCX_COMM_DATA_SET_MISMATCH

INSUFFICIENT LICENSE

#define RCX_COMM_INSUFFICIENT_LICENSE
0xC0000123

PARAMETER ERROR

#define RCX_COMM_PARAMETER_ERROR

INVALID NETWORK ADDRESS #define RCX_COMM_INVALID_NETWORK_ADDRESS


0xC0000125

0xC0000122

0xC0000124

Network Failures

(General) NETWORK FAULT

#define RCX_COMM_NETWORK_FAULT

0xC0000140

CONNECTION CLOSED

#define RCX_COMM_CONNECTION_CLOSED

0xC0000141

CONNECTION TIMED OUT

#define RCX_COMM_CONNECTION_TIMEOUT

0xC0000142

LONELY NETWORK

#define RCX_COMM_LONELY_NETWORK

0xC0000143

DUPLICATE NODE

#define RCX_COMM_DUPLICATE_NODE

0xC0000144

CABLE DISCONNECT

#define RCX_COMM_CABLE_DISCONNECT

0xC0000145

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 35

CC-Link Slave Protocol API


Version (All Implementations)

The version field holds version of this structure. It starts with one; zero is not defined.

STRUCTURE VERSION

#define RCX_STATUS_BLOCK_VERSION

0x0001

Watchdog Timeout (All Implementations)


This field holds the configured watchdog timeout value in milliseconds. The application may set its
watchdog trigger interval accordingly. If the application fails to copy the value from the host watchdog
location to the device watchdog location, the protocol stack will interrupt all network connections
immediately regardless of their current state. For details, see section 4.13 of the netX DPM Interface
Manual.
Protocol Class (All Implementations)
This field identifies the protocol class of the communication channel. The field is split into a
communication class field and communication sub class field. The first array element represents the
communication class; the second element is the communication sub class.
Communication Class
This array element holds further information regarding the protocol stack. It is intended to help
identifying the 'communication class' or 'device class' of the protocol.

UNDEFINED

#define RCX_COMM_CLASS_UNDEFINED

0x0000

UNCLASSIFIABLE

#define RCX_COMM_CLASS_UNCLASSIFIABLE

0x0001

MASTER

#define RCX_COMM_CLASS_MASTER

0x0002

SLAVE

#define RCX_COMM_CLASS_SLAVE

0x0003

SCANNER

#define RCX_COMM_CLASS_SCANNER

0x0004

ADAPTER

#define RCX_COMM_CLASS_ADAPTER

0x0005

MESSAGING

#define RCX_COMM_CLASS_MESSAGING

0x0006

CLIENT

#define RCX_COMM_CLASS_CLIENT

0x0007

SERVER

#define RCX_COMM_CLASS_SERVER

0x0008

IO-CONTROLLER

#define RCX_COMM_CLASS_IO_CONTROLLER

0x0009

IO-DEVICE

#define RCX_COMM_CLASS_IO_DEVICE

0x000A

IO-SUPERVISOR

#define RCX_COMM_CLASS_IO_SUPERVISOR

0x000B

GATEWAY

#define RCX_COMM_CLASS_GATEWAY

0x000C

MONITOR

#define RCX_COMM_CLASS_MONITOR

0x000D

PRODUCER

#define RCX_COMM_CLASS_PRODUCER

0x000E

CONSUMER

#define RCX_COMM_CLASS_CONSUMER

0x000F

SWITCH

#define RCX_COMM_CLASS_SWITCH

0x0010

HUB

#define RCX_COMM_CLASS_HUB

0x0011

Others are reserved.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 36

CC-Link Slave Protocol API


Communication Sub Class

The communication sub class of a device is determined by the implementation and therefore
described in a separate manual.

UNDEFINED

#define RCX_COMM_SUB_CLASS_UNDEFINED

UNCLASSIFIABLE

#define RCX_COMM_SUB_CLASS_UNCLASSIFIABLE 0x0001

NOT USED

#define RCX_COMM_SUB_CLASS_NOT_USED

Others are determined by the protocol stack and therefore defined in a separate manual.

0x0000

0x0002

Host Watchdog (All Implementations)


The protocol stack supervises the host system using the watchdog function. If the application fails to
copy the value from the device watchdog location (section 3.2.5 of the netX DPM Interface Manual) to
the host watchdog location (section 3.2.4 of the netX DPM Interface Manual), the protocol stack
assumes that the host system has some sort of problem and shuts down all network connections. For
details on the watchdog function, refer to section 4.13 of the netX DPM Interface Manual.
Error Count (All Implementations)
This field holds the total number of errors detected since power-up, respectively after reset. The
protocol stack counts all sorts of errors in this field no matter if they were network related or caused
internally.
Error Log Indicator (All Implementations)
The error log indicator field holds the number of entries in the internal error log. If all entries are read
from the log, the field is set to zero. The error log indicator is not supported yet.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

3.3.1.2

Dual-Port Memory 37

Master Implementation

In addition to the common status block as outlined in the previous section, a master firmware
maintains the additional structures for the administration of all slaves which are connected to the
master. These are not discussed here as they are not relevant for the slave.
3.3.1.3

Slave Implementation

The slave firmware uses only the common structure as outlined in section 3.2.5.1 of the Hilscher netX
Dual-Port-Memory Manual.

3.3.2 Extended Status


The content of the channel specific extended status block is specific to the implementation. Depending
on the protocol, a status area may or may not be present in the dual-port memory. It is always
available in the default memory map (see section 3.2.1 of netX Dual-Port Memory Manual).
Note: Have in mind, that all offsets mentioned in this section are relative to the beginning
of the common status block, as the start offset of this block depends on the size
and location of the preceding blocks.
typedef struct NETX_EXTENDED_STATUS_BLOCK_Ttag
{
UINT8 abExtendedStatus[432];
} NETX_EXTENDED_STATUS_BLOCK_T

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

Dual-Port Memory 38

For the CC-Link Slave protocol implementation, the extended status area is structured as follows:
typedef struct CCLINK_SLAVE_EXTENDED_STATE_Ttag
CCLINK_SLAVE_EXTENDED_STATE_T;
#define CCLINK_SLAVE_EXT_STATE_FLAG_WDG 0x00000001L
#define CCLINK_SLAVE_EXT_STATE_CTRL
0x00000002L
#define CCLINK_SLAVE_EXT_STATE_NRDY
0x00000004L
#define
#define
#define
#define
#define
#define
#define

CCLINK_SLAVE_CCL_MASTER_ST1_MAS_STAT_USER_APP_PRG_MSK
CCLINK_SLAVE_CCL_MASTER_ST1_MAS_STAT_USER_APP_PRG_ERR_CHK_MSK
CCLINK_SLAVE_CCL_MASTER_ST1_REFRESH_STARTUP_MSK
CCLINK_SLAVE_CCL_MASTER_ST1_TRANSIENT_DATA_STATUS_MSK
CCLINK_SLAVE_CCL_MASTER_ST1_TRANSIENT_DATA_RECEPTION_EN_MSK
CCLINK_SLAVE_CCL_MASTER_ST1_PROTOCOL_VERSION_MSK
CCLINK_SLAVE_CCL_MASTER_ST1_MASTER_STATION_TYPE_MSK

0x00000001L
0x00000002L
0x00000004L
0x00000008L
0x00000010L
0x00000060L
0x00000080L

#define CCLINK_SLAVE_CCL_MASTER_ST2_RY_INFO_TRANSMISSION_POINTS_MSK
#define CCLINK_SLAVE_CCL_MASTER_ST2_RWW_INFO_TRANSMISSION_POINTS_MSK

0x00000F00L
0x0000F000L

#define
#define
#define
#define
#define
#define
#define
#define

CCLINK_SLAVE_CCL_SLAVE_ST1_FUSE_STATUS_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_UNIT_ERROR_INVAL_NUM_OF_POINTS_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_NO_REFRESH_RECEIVE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_NO_PARAMETER_RECEIVE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_SWITCH_CHANGE_DETECTION_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_CYCLIC_COMMUNICATION_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_RES1_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_WDT_ERROR_MSK

0x00000001L
0x00000002L
0x00000004L
0x00000008L
0x00000010L
0x00000020L
0x00000040L
0x00000080L

#define
#define
#define
#define
#define
#define
#define

CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSIENT_DATA_STATUS_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSIENT_DATA_RECEPTION_EN_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSIENT_TYPE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_RES2_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSMISSION_ROUTE_STATUS_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_RES_FIXED_TO_ONE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_SETTING_MSK

0x00000100L
0x00000200L
0x00000400L
0x00000800L
0x00001000L
0x00002000L
0x0000C000L

#define
#define
#define
#define

CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_SINGLE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_DOUBLE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_QUADRUPLE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_OCTUPLE_MSK

0x00000000L
0x00004000L
0x00008000L
0x0000C000L

struct CCLINK_SLAVE_EXTENDED_STATE_Ttag
{
TLR_UINT32 ulFlags;
TLR_UINT32 ulMasterState;
TLR_UINT32 ulSlaveState;
TLR_UINT32 ulRxByteCount;
TLR_UINT32 ulRWrByteCount;
TLR_UINT32 ulRyByteCount;
TLR_UINT32 ulRWwByteCount;
};

The meaning of these parameters is:

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 39

CC-Link Slave Protocol API


ST1 Data transfer from master to slave station
Flag Name

Value

Meaning

CCLINK_SLAVE_CCL_MASTER_ST1_MAS_STAT_USER_APP_PRG_MSK

0x01L

Master
station (user
application
program)

CCLINK_SLAVE_CCL_MASTER_ST1_MAS_STAT_USER_APP_PRG_ERR_CHK_MSK

0x02L

Master
station user
application
program
error check

CCLINK_SLAVE_CCL_MASTER_ST1_REFRESH_STARTUP_MSK

0x04L

Refresh
startup

CCLINK_SLAVE_CCL_MASTER_ST1_TRANSIENT_DATA_STATUS_MSK

0x08L

Transient
data status

CCLINK_SLAVE_CCL_MASTER_ST1_TRANSIENT_DATA_RECEPTION_EN_MSK

0x10L

Transient
data
reception
enable

CCLINK_SLAVE_CCL_MASTER_ST1_PROTOCOL_VERSION_MSK

0x60L

Protocol
version

CCLINK_SLAVE_CCL_MASTER_ST1_MASTER_STATION_TYPE_MSK

0x80L

Master
station type

Table 14: ST1 Data Transfer from Master to Slave Station

Master Station (User Application Program)


This entry contains the information about the operation status the master station user application
program, i.e. whether the application program is running or not. Allowed options are:
Value

Meaning

Stop

Run

Table 15: Allowed Values of Master Station (User Application Program)

Master Station User Application Program Error Check


This entry contains the information whether an error occurred at the master station user application
program. Allowed options are:
Value

Meaning

Normal

Abnormal

Table 16: Allowed Values of Master Station User Application Program Error Check

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 40

CC-Link Slave Protocol API


Refresh Startup

This entry contains the information whether link refresh has been started or stopped.
Value

Meaning

Stop

Start

Table 17: Allowed Values of Refresh Startup

Transient Data Status


This entry contains the information about the transient data status, i.e. whether transient data is
included.
Value

Meaning

Not present

Present

Table 18: Allowed Values of Transient Data Status

Transient Data Reception Enable


This entry contains the information whether transient data reception is enabled or not.
Value

Meaning

Disabled

Enabled

Table 19: Allowed Values of Transient Data Reception Enable

Protocol Version
This entry contains the protocol version
Value

Meaning

Version 1

Version 2

Version 3 (Future function)

Version 4 (Future function)

Table 20: Allowed Values of Protocol Version

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 41

CC-Link Slave Protocol API


Master Station Type

This entry contains the information whether the station is an (ordinary) master station or a standby
master station.
Value

Meaning

Master station

Standby master station

Table 21: Allowed Values of Master Station Type

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 42

CC-Link Slave Protocol API


ST1 Data transfer from Slave to Master Station
Flag Name

Value

Meaning

CCLINK_SLAVE_CCL_SLAVE_ST1_FUSE_STATUS_MSK

0x01

Fuse status

CCLINK_SLAVE_CCL_SLAVE_ST1_UNIT_ERROR_INVAL_NUM_OF_POINTS_MSK

0x02

Unit
error/invalid
No. of points

CCLINK_SLAVE_CCL_SLAVE_ST1_NO_REFRESH_RECEIVE_MSK

0x04

Refresh
receive

CCLINK_SLAVE_CCL_SLAVE_ST1_NO_PARAMETER_RECEIVE_MSK

0x08

Parameter
receive

CCLINK_SLAVE_CCL_SLAVE_ST1_SWITCH_CHANGE_DETECTION_MSK

0x10

Switch
change
detection

CCLINK_SLAVE_CCL_SLAVE_ST1_CYCLIC_COMMUNICATION_MSK

0x20

Cyclic
transmission
flag

CCLINK_SLAVE_CCL_SLAVE_ST1_RES1_MSK

0x40

Reserved

CCLINK_SLAVE_CCL_SLAVE_ST1_WDT_ERROR_MSK

0x80

WDT error

Table 22: ST1 Data Transfer from Slave to Master Station

Fuse Status
This entry contains the information about the state of the fuse. Allowed values are:
Value

Meaning

Normal

Abnormal

Data link is continued.


Table 23: Allowed Values of Fuse Status

Unit Error/Invalid No. of Points


This entry contains the information whether
either a unit error has occurred (in case the slave station is a remote I/O station).
or the invalid number of points flag has been set (in case the slave station is no remote I/O
station)

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 43

CC-Link Slave Protocol API


Allowed values are:
Value

Meaning

No

Yes

Data link is aborted.


Table 24: Allowed Values of Unit Error/Invalid No. of Points

Refresh Receive
This entry contains the information whether a refresh has been received. Allowed values are:
Value

Meaning

Receive completed

Not received

Data link is aborted.


Table 25: Allowed Values of Refresh Receive

Parameter Receive
This entry contains the information whether a parameter has been received. Allowed values are:
Value

Meaning

Receive completed

Not received

Table 26: Allowed Values of Parameter Receive

Switch Change Detection


This entry contains the information whether the position of a switch has been changed. Allowed values
are:
Value

Meaning

No change

A change has occurred

Data link is continued.


Table 27: Allowed Values of Switch Change Detection

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 44

CC-Link Slave Protocol API


Cyclic Transmission Flag

This entry contains the information whether cyclic data transmission is active. Allowed values are:
Value

Meaning

Cyclic data transmission is enabled

Cyclic data transmission is disabled

Table 28: Allowed Values of Cyclic Transmission Flag

Watchdog Timer Error


This entry contains the information whether a watchdog timer error has been detected. Allowed values
are:
Value

Meaning

No watchdog timer error has been detected

A watchdog timer error has been detected

Data link is continued.


Table 29: Allowed Values of Watchdog Timer Error

ST2 Data Transfer from Master to Slave Station


Flag Name

Value

Meaning

CCLINK_SLAVE_CCL_MASTER_ST2_RY_INFO_TRANSMISSION_POINTS_MSK

0x00000F00

RY
information
transmission
points, see
below

CCLINK_SLAVE_CCL_MASTER_ST2_RWW_INFO_TRANSMISSION_POINTS_MSK

0x0000F000

RWw
information
transmission
points, see
below

Table 30: ST2 Data Transfer from Master to Slave Station

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

Dual-Port Memory 45

RY Information Transmission Points


The number of RY information transmission points is determined depending on the four lower bits of
status byte ST2 according to the following table:

RY Information Transmission Points


D3

D2

D1

D0

Number of RY information transmission points

Number of bytes

256

32

512

64

768

96

1024

128

1280

160

1536

192

1792

224

2048

256

All other combinations


(1001 to 1111)

Reserved

Table 31: RY Information Transmission Points

RWw Information Transmission Points


The number of RWw information transmission points is determined depending on the four upper bits of
status byte ST2 according to the following table:
RWw Information Transmission Points
D3

D2

D1

D0

Number of RWw information transmission points

Number of bytes

32

64

64

128

96

192

128

256

160

320

192

384

224

448

256

512

All other combinations


(1001 to 1111)

Reserved

Table 32: RWw Information Transmission Points

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 46

CC-Link Slave Protocol API


ST2 Data Transfer from Slave to Master Station
Flag Name

Value

Meaning

CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSIENT_DATA_STATUS_MSK

0x01

Transient data
status

CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSIENT_DATA_RECEPTION_EN_MSK

0x02

Transient
receive

CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSIENT_TYPE_MSK

0x04

Transient type

CCLINK_SLAVE_CCL_SLAVE_ST2_RES2_MSK

0x08

Reserved

CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSMISSION_ROUTE_STATUS_MSK

0x10

Transmission
status

CCLINK_SLAVE_CCL_SLAVE_ST2_RES_FIXED_TO_ONE_MSK

0x20

Reserved (set
to 1)

CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_SETTING_MSK

0x40

Extended cycle
setting

CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_SETTING_MSK

0x80

Extended cycle
setting

Table 33: ST2 Data Transfer from Slave to Master Station

Transient Data Status


This entry contains the information about the transient data status. Allowed values are:
Value

Meaning

Not present

Present

Table 34: Allowed Values of Transient Data Status

Transient Receive
This entry contains the information whether transient data have been received. Allowed values are:
Value

Meaning

Disabled

Enabled

Table 35: Allowed Values of Transient Receive

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 47

CC-Link Slave Protocol API


Transient Type

This entry contains the information which type of transient data has been selected.
Allowed values are:
Value

Meaning

1:n

n:n

Table 36: Allowed Values of Transient Type

Transmission Status
This entry contains the information about the current transmission status. Allowed values are:
Value

Meaning

Normal

Abnormal

Table 37: Allowed Values of Transmission Status

Extended Cycle Setting


This entry contains the information about the current extended cycle setting. Allowed values are:
Value

Meaning

0x00

Single setting

0x40

Double setting

0x80

Quadruple setting

0xC0

Octuple setting

Table 38: Allowed Values of Extended cycle setting

ulRxByteCount
This entry contains the data count of RX data in bytes.
ulRWrByteCount
This entry contains the data count of RWr data in bytes
ulRyByteCount
This entry contains the data count of RY data in bytes.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

Dual-Port Memory 48

ulRWwByteCount
This entry contains the data count of RWw data in bytes.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Dual-Port Memory 49

CC-Link Slave Protocol API

3.4

Control Block

A control block is always present within the communication channel. In some respects, control and
status block are used together in order to exchange information between host application and netX
firmware. The control block is written by the application, whereas the application reads a status block.
Both control and status block have registers that use the Change of State mechanism (see also
section 2.2.1 of the netX Dual-Port-Memory Manual.)
The following gives an example of the use of control and status block. The host application wishes to
lock the configuration settings of a communication channel to protect them against changes. The
application sets the Lock Configuration flag in the control block to the communication channel
firmware. As a result, the channel firmware sets the Configuration Locked flag in the status block (see
below), indicating that the current configuration settings cannot be deleted, altered, overwritten or
otherwise changed.
The control block of a dual-port memory features a watchdog function to allow the operating system
running on the netX supervise the host application and vice versa. The control area is always present
in the dual-port memory.
Control Block
Offset

Type

Name

Description

0x0008

UINT32

ulApplicationCOS

Application Change Of
State
State Of The Application
Program
INITIALIZATION, LOCK
CONFIGURATION

0x000C

UINT32

ulDeviceWatchdog

Device Watchdog
Host System Writes,
Protocol Stack Reads

Table 39: Communication Control Block

Communication Control Block Structure


typedef struct NETX_CONTROL_BLOCK_Ttag
{
UINT32 ulApplicationCOS;
UINT32 ulDeviceWatchdog;
} NETX_CONTROL_BLOCK_T;

For more information concerning the Control Block please refer to the netX DPM Interface Manual.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Getting started / Configuration 50

CC-Link Slave Protocol API

4 Getting started / Configuration


This section explains some essential information you should know when starting to work with the CCLink Slave Protocol API.

4.1

Overview about Essential Functionality

You can find the most commonly used functionality of the CC-Link Slave Protocol API within the
following sections of this document:

Topic

Section
Number

Section Name

Configure CCLink Salve

5.1.2

CCLINK_APS_SET_CONFIGURATION_REQ/CNF Set Configuration

Start/Stop
network
communication

5.2.5

CCLINK_SLAVE_STARTSTOP_REQ/CNF Start/Stop Communication


with Network

Initialization

5.2.1

CCLINK_SLAVE_INITIALIZE_REQ/CNF Initialization of CC-Link


Slave

Table 40: Overview about Essential Functionality

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

4.2

Getting started / Configuration 51

Warmstart Parameters

The following table contains relevant information about the warmstart parameters for the CC-Link
Slave firmware such as an explanation of the meaning of the parameter and ranges of allowed values:

Parameter

Meaning

System Flags

System flags

Range of Value / Value

BIT 0: AUTOSTART / APPLICATION CONTROLLED


communication with a controller after a device
start is allowed without BUS_ON flag, but the
communication will be interrupted if the BUS_ON
flag changes state to 0
communication with controller is allowed only with
the BUS_ON flag.
BIT 1: I/O STATUS DISABLED/ ENABLED
Not supported yet
BIT 2: IO STATUS 32 BIT
Not supported yet
BIT 3 - 31: Reserved for further use, set to zero
CcLink Flags

CC-Link flags
Bit 0: Vendor Code DISABLED/ ENABLED
Parameter ulVendorCode will be evaluated if
this bit is set. Otherwise the default value will be
used
Bit 1: Model Type DISABLED/ ENABLED
Parameter ulModelType will be evaluated if this
bit is set. Otherwise the default value will be used
Bit 2: SW Version DISABLED/ ENABLED
Parameter ulSwVersion will be evaluated if this
bit is set. Otherwise the default value will be used
BIT 3 - 31: Reserved for further use, set to zero

Watchdog Time

Watchdog supervision time [ms]


within which the device watchdog
must be retriggered from the
application program while the
application program monitoring is
activated.
Watchdog supervision deactivated
Watchdog supervision activated

Slave Station
Address

0
20 .. 65535

Station address of CC-Link Slave


Warmstart parameter
Parameter taken from rotary switch
(Allowed for devices with rotary
switches)

1 .. 64
255

Note: The number of occupied


stations and station address must
not exceed the maximum station
address (Address + Number of
occupied stations - 1 <= 64).

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Getting started / Configuration 52

CC-Link Slave Protocol API

Baud rate

Network transmission rate

See Table 42: Available Baud Rate Values

Note: Parameter is taken from rotary


switch if station address is set to 255
(Allowed for devices with rotary
switches).
Station type

Type of CC-Link station


Remote I/O Station:
Remote Device Station:

Number of
occupied stations

0
1

Number of occupied stations


Remote I/O Station:
Remote Device Station:

1
1 .. 4

Note: The number of occupied stations


and station address must not exceed
the maximum station address (Address
+ Number of occupied stations - 1 <=
64).
CC-Link Version

CC-Link version
CC-Link Version 1
CC-Link Version 2

Extension Cycle

0
1

Number of extension cycles


Allowed numbers for CC-Link version 1
Single / One cycle

Allowed numbers for CC-Link version 2


Single / One cycle
Double / Two cycles
Quadruple / Four cycles
Octuple / Eight cycles

0
1
2
3

Reserved

Reserved for further use, set to zero

HoldClrMode

Behavior in case of bus error


Clear output data
Hold last received output data

0
1

Vendor Code

Vendor code (If corresponding bit in


parameter ulCcLinkFlags parameter
is set)

0 . 65535

Model Type

Model type (If corresponding bit in


parameter ulCcLinkFlags parameter
is set)

0 .. 255

Sw Version

Software version (If corresponding bit in


parameter ulCcLinkFlags parameter
is set)

0 .. 63

Table 41: Meaning and allowed Values for Warmstart-Parameters.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Getting started / Configuration 53

CC-Link Slave Protocol API

The applicable baud rates can be coded with the values given in the following table:
Baud rate

Symbolic Constant

Value

156 kBaud

CCLINK_SLAVE_BAUD_156K

625 kBaud

CCLINK_SLAVE_BAUD_625K

2500 kBaud

CCLINK_SLAVE_BAUD_2500K

5 MBaud

CCLINK_SLAVE_BAUD_5M

10 MBaud

CCLINK_SLAVE_BAUD_10M

Table 42: Available Baud Rate Values

4.2.1

Behavior when receiving a Set Configuration / Warmstart Command

The following rules apply for the behavior of the CC-Link Slave protocol stack when receiving a set
configuration command:
The configuration packets name is CCLINK_APS_SET_CONFIGURATION_REQ for the request
and CCLINK_APS_SET_CONFIGURATION_CNF for the confirmation.
The configuration data are checked for consistency and integrity.
In case of failure no data are accepted.
In case of success the configuration parameters are stored internally (within the RAM).
The parameterized data will be activated only after a channel init has been performed.
No automatic registration of the application at the stack happens.
The confirmation packet CCLINK_APS_SET_CONFIGURATION_CNF only transfers simple
status information, but does not repeat the whole parameter set.
For all versions up to firmware version V2.1.8.0, only the warmstart command (the predecessor of the
set configuration command) was present showing up the following deviations from the behavior
described above:
1. Contrary to the situation when receiving a set configuration command, on every received
warmstart packet an automatic channel-init is performed..
2. The
entire
parameter
set
is
completely
delivered
within
CCLINK_APS_SET_CONFIGURATION_CNF or CCLINK_APS_WARMSTART_CNF packet.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

the

54

CC-Link Slave Protocol API

4.3

Input and Output Data

Depending on the CC-Link Slave configuration, the input and output data area is subdivided into
different sections:

4.3.1

Input and Output Data for CC-Link Version 1

Input and Output Data for Remote I/O Station


I/O Offset

Area

Length (Byte)

Type

Output block

RX

Input block

RY

Table 43: Input and Output Data for Remote I/O Device

Input and Output Data for Remote Device Station with One Occupied Station
I/O Offset

Area

Length (Byte)

Type

Output block

RX

Output block

RWr

Input block

RY

Input block

RWw

Table 44: Input and Output Data for Remote Device Station with One Occupied Station

Input and Output Data for Remote Device Station with Two Occupied Stations
I/O Offset

Area

Length (Byte)

Type

Output block

RX

Output block

16

RWr

Input block

RY

Input block

16

RWw

Table 45: Input and Output Data for Remote Device Station with Two Occupied Stations

Input and Output Data for Remote Device Station with Three Occupied Stations
I/O Offset

Area

Length (Byte)

Type

Output block

12

RX

12

Output block

24

RWr

Input block

12

RY

12

Input block

24

RWw

Table 46: Input and Output Data for Remote Device Station with Three Occupied Stations

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

55

CC-Link Slave Protocol API

Input and Output Data for Remote Device Station with Four Occupied Stations
I/O Offset

Area

Length (Byte)

Type

Output block

16

RX

16

Output block

32

RWr

Input block

16

RY

16

Input block

32

RWw

Table 47: Input and Output Data for Remote Device Station with Four Occupied Stations

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

56

CC-Link Slave Protocol API

4.3.2

Input and Output Data for CC-Link Version 2

Depending on the CC-Link Slave configuration, the input and output data area is subdivided into
different sections:
Input and Output Data for Remote Device Station with One Occupied Station, Single Setting
I/O Offset

Area

Length (Byte)

Type

Output block

RX

Output block

RWr

Input block

RY

Input block

RWw

Table 48: Input and Output Data for Remote Device Station with One Occupied Stations, Single Setting

Input and Output Data for Remote Device Station with Two Occupied Stations, Single Setting
I/O Offset

Area

Length (Byte)

Type

Output block

RX

Output block

16

RWr

Input block

RY

Input block

16

RWw

Table 49: Input and Output Data for Remote Device Station with Two Occupied Stations, Single Setting

Input and Output Data for Remote Device Station with Three Occupied Stations, Single Setting
I/O Offset

Area

Length (Byte)

Type

Output block

12

RX

12

Output block

24

RWr

Input block

12

RY

12

Input block

24

RWw

Table 50: Input and Output Data for Remote Device Station with Three Occupied Stations, Single Setting

Input and Output Data for Remote Device Station with Four Occupied Stations, Single Setting
I/O Offset

Area

Length (Byte)

Type

Output block

16

RX

16

Output block

32

RWr

Input block

16

RY

16

Input block

32

RWw

Table 51: Input and Output Data for Remote Device Station with Four Occupied Stations, Single Setting

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

57

CC-Link Slave Protocol API

Input and Output Data for Remote Device Station with One Occupied Station, Double Setting
I/O Offset

Area

Length (Byte)

Type

Output block

RX

Output block

16

RWr

Input block

RY

Input block

16

RWw

Table 52: Input and Output Data for Remote Device Station with One Occupied Station, Double Setting

Input and Output Data for Remote Device Station with Two Occupied Stations, Double Setting
I/O Offset

Area

Length (Byte)

Type

Output block

12

RX

12

Output block

32

RWr

Input block

12

RY

12

Input block

32

RWw

Table 53: Input and Output Data for Remote Device Station with Two Occupied Stations, Double Setting

Input and Output Data for Remote Device Station with Three Occupied Stations, Double Setting
I/O Offset

Area

Length (Byte)

Type

Output block

20

RX

20

Output block

48

RWr

Input block

20

RY

20

Input block

48

RWw

Table 54: Input and Output Data for Remote Device Station with Three Occupied Stations, Double Setting

Input and Output Data for Remote Device Station with Four Occupied Stations, Double Setting
I/O Offset

Area

Length (Byte)

Type

Output block

28

RX

28

Output block

64

RWr

Input block

28

RY

28

Input block

64

RWw

Table 55: Input and Output Data for Remote Device Station with Four Occupied Stations, Double Setting

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

58

CC-Link Slave Protocol API


Input and Output Data for Remote Device Station with One Occupied Station, Quadruple
Setting
I/O Offset

Area

Length (Byte)

Type

Output block

RX

Output block

32

RWr

Input block

RY

Input block

32

RWw

Table 56: Input and Output Data for Remote Device Station with One Occupied Station, Quadruple Setting

Input and Output Data for Remote Device Station with Two Occupied Stations, Quadruple
Setting
I/O Offset

Area

Length (Byte)

Type

Output block

24

RX

24

Output block

64

RWr

Input block

24

RY

24

Input block

64

RWw

Table 57: Input and Output Data for Remote Device Station with Two Occupied Stations, Quadruple Setting

Input and Output Data for Remote Device Station with Three Occupied Stations, Quadruple
Setting
I/O Offset

Area

Length (Byte)

Type

Output block

40

RX

40

Output block

96

RWr

Input block

40

RY

40

Input block

96

RWw

Table 58: Input and Output Data for Remote Device Station with Three Occupied Stations, Quadruple Setting

Input and Output Data for Remote Device Station with Four Occupied Stations, Quadruple
Setting
I/O Offset

Area

Length (Byte)

Type

Output block

56

RX

56

Output block

128

RWr

Input block

56

RY

56

Input block

128

RWw

Table 59: Input and Output Data for Remote Device Station with Four Occupied Stations, Quadruple Setting

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

59

CC-Link Slave Protocol API

Input and Output Data for Remote Device Station with One Occupied Station, Octuple Setting
I/O Offset

Area

Length (Byte)

Type

Output block

16

RX

16

Output block

64

RWr

Input block

16

RY

16

Input block

64

RWw

Table 60: Input and Output Data for Remote Device Station with One Occupied Station, Octuple Setting

Input and Output Data for Remote Device Station with Two Occupied Stations, Octuple Setting
I/O Offset

Area

Length (Byte)

Type

Output block

48

RX

48

Output block

128

RWr

Input block

48

RY

48

Input block

128

RWw

Table 61: Input and Output Data for Remote Device Station with Two Occupied Stations, Octuple Setting

Input and Output Data for Remote Device Station with Three Occupied Stations, Octuple
Setting
I/O Offset

Area

Length (Byte)

Type

Output block

80

RX

80

Output block

192

RWr

Input block

80

RY

80

Input block

192

RWw

Table 62: Input and Output Data for Remote Device Station with Three Occupied Stations, Octuple Setting

Input and Output Data for Remote Device Station with Four Occupied Stations, Octuple Setting
I/O Offset

Area

Length (Byte)

Type

Output block

112

RX

112

Output block

256

RWr

Input block

112

RY

112

Input block

256

RWw

Table 63: Input and Output Data for Remote Device Station with Four Occupied Stations, Octuple Setting

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

4.4

60

Task Structure of the CC-Link Slave Stack

The illustration below displays the internal structure of the tasks which together represent the CC-Link
Slave Stack:

Figure 6: Internal Structure of CC-Link Slave Firmware

The dual-port memory is used for exchange of information, data and packets. Configuration and IO
data will be transferred using this way.
The user application only accesses the task located in the highest layer namely the AP task which
constitutes the application interface of the CC-Link Slave stack.
The triple buffer mechanism provides a consistent synchronous access procedure from both sides
(DPM and AP task). The triple buffer technique ensures that the access will always affect the last
written cell.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

The Application Interface 61

5 The Application Interface


This chapter defines the application interface of the CC-Link Slave stack.
The application itself has to be developed as a task according to the Hilschers Task Layer Reference
Model. The application task is named AP-Task in the following sections and chapters.
The AP-Tasks process queue shall keep track of its incoming packets. It provides the communication
channel for the underlying CC-Link Slave Stack. Once, the CC-Link Slave stack communication is
established, events received by the stack are mapped to packets that are sent to the AP-Tasks
process queue. Every packet has to be evaluated in the AP-Tasks context and corresponding actions
be executed. Additionally, Initiator-Services that are to be requested by the application are sent via
predefined queue macros to the underlying CC-Link Slave stack queues via packets as well.
The following chapters describe the packets that may be received or sent by the AP-Task.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 62

CC-Link Slave Protocol API

5.1

The CC-Link APS-Task

The CC-Link APS-Task coordinates, within the CC-Link Slave stack, the overlaying functions.
It is responsible for all application interactions and represents the counterpart of the AP-Task within
the existing CC-Link Slave stack implementation.
To get the handle of the process queue of the CC-Link APS-Task-Task the Macro
TLR_QUE_IDENTIFY() has to be used in conjunction with the following ASCII-queue name

ASCII Queue name

Description

"QUE_CCLAPS

Name of the CC-Link APS-Task process queue

Table 64: CC-Link APS-Task Process Queue

The returned handle has to be used as value ulDest in all initiator packets the AP-Task intends to
send to the CC-Link APS -Task. This handle is the same handle that has to be used in conjunction
with the macros TLR_QUE_SENDPACKET_FIFO/LIFO() for sending a packet to the CC-Link APSTask.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

5.1.1

The Application Interface 63

CCLINK_APS_WARMSTART_REQ/CNF Set Warmstart Parameters

This service can be used by the user application in order to configure the AP-task with warmstart
parameters. After this request is received, the AP-task will configure the CC-Link Slave task with the
given parameters from this request and, if configured, starts the communication with the CC-Link
network. This request will be denied if the configuration lock flag is set (for more information on this
topic see section 3.3.1.1).
Note: The packet described in this section is obsolete and will not longer be supported
after September, 1, 2009. Do not use this packet for all new developments! It is
replaced by the packet CCLINK_APS_SET_CONFIGURATION_REQ/CNF Set
Configuration described in the next section and has to be used for new
developments.

Packet Structure Reference


typedef struct CCLINK_APS_WARMSTART_REQ_DATA_Ttag
CCLINK_APS_WARMSTART_REQ_DATA_T;
#define CCLINK_APS_SYS_FLAG_COM_CONTROLLED_RELEASE
#define CCLINK_APS_SYS_FLAG_IO_STATUS_ENABLED
#define CCLINK_APS_SYS_FLAG_IO_STATUS_32_BIT

0x00000001L
0x00000002L
0x00000004L

#define CCLINK_APS_WD_OFF
#define CCLINK_APS_WD_MIN_TIMEOUT
#define CCLINK_APS_WD_MAX_TIMEOUT

0x00000000L
0x00000014L
0x0000FFFFL

#define CCLINK_APS_CCLS_FLAGS_CFG_VENDOR_CODE
#define CCLINK_APS_CCLS_FLAGS_CFG_MODEL_TYPE
#define CCLINK_APS_CCLS_FLAGS_CFG_SW_VERSION

0x00000001L
0x00000002L
0x00000004L

#define CCLINK_APS_STATION_ADDR_CFG_ROTARY_SWITCH

0x000000FFL

struct CCLINK_APS_WARMSTART_REQ_DATA_Ttag
{
TLR_UINT32
ulSystemFlags;
TLR_UINT32
ulCcLinkFlags;
TLR_UINT32

ulWdgTime;

TLR_UINT32
TLR_UINT32

ulSlaveStationAddr;
ulBaudRate;

TLR_UINT32
TLR_UINT32
TLR_UINT32
TLR_UINT32
TLR_UINT32
TLR_BOOLEAN32

ulStationType;
ulNoStation;
ulCcLinkVersion;
ulExtensionCycle;
ulReserved;
fHoldClrMode;

TLR_UINT32
TLR_UINT32
TLR_UINT32
};

ulVendorCode;
ulModelType;
ulSwVersion;

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

The Application Interface 64

typedef struct CCLINK_APS_PCK_WARMSTART_REQ_Ttag


CCLINK_APS_PCK_WARMSTART_REQ_T;
struct CCLINK_APS_PCK_WARMSTART_REQ_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_APS_WARMSTART_REQ_DATA_T tData;
}

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 65

CC-Link Slave Protocol API


Packet Description
structure CCLINK_APS_PCK_WARMSTART_REQ_T
Type: Request
Area

Variable

Type

Value / Range

Description

tHead structure TLR_PACKET_HEADER_T


ulDest

UINT32

Destination Queue-Handle

ulSrc

UINT32

Source Queue-Handle

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process.
Set to 0 for the Initialization Packet

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

56

Packet Data Length in bytes


32

ulId

UINT32

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet

ulSta

UINT32

ulCmd

UINT32

0x00004600

CCLINK_APS_WARMSTART_REQ - Command

ulExt

UINT32

Extension not in use, set to zero for compatibility


reasons

ulRout

UINT32

Routing, do not touch

See section 6.1Status/Error Codes CC-Link APS-Task

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 66

CC-Link Slave Protocol API

tData

structure CCLINK_APS_WARMSTART_REQ_DATA_T
ulSystemFlags

System Flags

UINT32

BIT 0: AUTOSTART / APPLICATION CONTROLLED


0

Communication with a controller after a device start


is allowed without BUS_ON flag, but the
communication will be interrupted if the BUS_ON
flag changes state to 0.
communication with controller is allowed only with
the BUS_ON flag.
BIT 1: I/O STATUS DISABLED/ ENABLED
Not supported yet
BIT 2: IO STATUS 32 BIT
Not supported yet
BIT 3 - 31: Reserved for further use, set to zero

ulCcLinkFlags

CC-Link Flags

UINT32

Bit 0: CONFIG VENDOR CODE


DISABLED/ENABLED
0
1

Default Vendor Code is used


Value from parameter ulVendorCode is used
Bit 1: CONFIG MODEL TYPE
DISABLED/ENABLED

0
1

Default Model Type is used


Value from parameter ulModelType is used
Bit 2: CONFIG SW VERSION
DISABLED/ENABLED

0
1
ulWdgTime

Watchdog supervision

UINT32
0
20 .. 65535

ulSlaveStationAddr

UINT32

Watchdog supervision deactivated


Watchdog time in milliseconds
Slave Station Address

1 .. 64
255
ulBaudRate

Default Software Version is used


Value from parameter ulSwVersion is used

UINT32

Slave Station Address from Packet


Slave Station Address and Baudrate from rotary
switches (On devices with rotary switches, only)
Baudrate

0
1
2
3
4

156 kBaud
625 kBaud
2500 kBaud
5 MBaud
10 MBaud
Note: Parameter will not be used if rotary switches
are used for configuration. Parameter
ulSlaveStationAddr has to be set to 255 in
order to activate rotary switch configuration (On
devices with rotary switches, only)

ulStationType

Station Type

UINT32
0
1

Remote I/O Station


Remote Device Station

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 67

CC-Link Slave Protocol API


ulNoStation

Number of Occupied Stations

UINT32
1
1 .. 4

ulCcLinkVersion

CC-Link Version

UINT32
0
1

ulExtensionCycle

Range for Remote I/O Station


Range for Remote Device Station

UINT32

Version 1
Version 2 (Remote Device Station only)
Number of extension cycles for CC-Link Version 1

Single setting / one cycle


Number of extension cycles for CC-Link Version 2

ulReserved

UINT32

fHoldClrMode

BOOLEAN32

0
1
2
3

Single setting / one cycle


Double setting / two cycles
Quadruple setting / four cycles
Octuple setting / eight cycles

Reserved for further use, set to zero


Behavior in case of bus error

0
1

Clear output data


Hold last received output data

ulVendorCode

UINT32

0 .. 65535

Vendor code (If corresponding bit in parameter


ulCcLinkFlags parameter is set)

ulModelType

UINT32

0 .. 255

Model type (If corresponding bit in parameter


ulCcLinkFlags is set)

ulSwVersion

UINT32

0 .. 63

Software version (If corresponding bit in parameter


ulCcLinkFlags is set)

Table 65: CCLINK_APS_PCK_WARMSTART_REQ_T Set Warmstart Parameter Request

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

The Application Interface 68

Packet Structure Reference


typedef struct CCLINK_APS_WARMSTART_CNF_DATA_Ttag
CCLINK_APS_WARMSTART_CNF_DATA_T;
struct CCLINK_APS_WARMSTART_CNF_DATA_Ttag
{
TLR_UINT32
ulSystemFlags;
TLR_UINT32
ulCcLinkFlags;
TLR_UINT32

ulWdgTime;

TLR_UINT32
TLR_UINT32

ulSlaveStationAddr;
ulBaudRate;

TLR_UINT32

ulStationType;

TLR_UINT32

ulNoStation;

TLR_UINT32
TLR_UINT32

ulCcLinkVersion;
ulExtensionCycle;

TLR_UINT32
ulReserved;
TLR_BOOLEAN32 fHoldClrMode;
TLR_UINT32
TLR_UINT32
TLR_UINT32
};

ulVendorCode;
ulModelType;
ulSwVersion;

typedef struct CCLINK_APS_PCK_WARMSTART_CNF_Ttag


CCLINK_APS_PCK_WARMSTART_CNF_T;
struct CCLINK_APS_PCK_WARMSTART_CNF_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_APS_WARMSTART_CNF_DATA_T tData;
};

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 69

CC-Link Slave Protocol API


Packet Description
structure CCLINK_APS_PCK_WARMSTART_CNF_T
Type: Request
Area

Variable

Type

Value / Range

Description

tHead structure TLR_PACKET_HEADER_T


ulDest

UINT32

Destination Queue-Handle

ulSrc

UINT32

Source Queue-Handle

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process.
Set to 0 for the Initialization Packet

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

56

Packet Data Length in bytes


32

ulId

UINT32

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet

ulSta

UINT32

ulCmd

UINT32

0x00004601

CCLINK_APS_WARMSTART_CNF - Command

ulExt

UINT32

Extension not in use, set to zero for compatibility


reasons

ulRout

UINT32

Routing, do not touch

See section 6.1Status/Error Codes CC-Link APS-Task

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 70

CC-Link Slave Protocol API

tData

structure CCLINK_APS_WARMSTART_CNF_DATA_T
ulSystemFlags

System Flags

UINT32

BIT 0: AUTOSTART / APPLICATION CONTROLLED


0

communication with a controller after a device start


is allowed without BUS_ON flag, but the
communication will be interrupted if the BUS_ON
flag changes state to 0.
communication with controller is allowed only with
the BUS_ON flag.
BIT 1: I/O STATUS DISABLED/ ENABLED
Not supported yet
BIT 2: IO STATUS 32 BIT
Not supported yet
BIT 3 - 31: Reserved for further use, set to zero

ulCcLinkFlags

CC-Link Flags

UINT32

Bit 0: CONFIG VENDOR CODE


DISABLED/ENABLED
0
1

Default Vendor Code is used


Value from parameter ulVendorCode is used
Bit 1: CONFIG MODEL TYPE
DISABLED/ENABLED

0
1

Default Model Type is used


Value from parameter ulModelType is used
Bit 2: CONFIG SW VERSION
DISABLED/ENABLED

0
1
ulWdgTime

Watchdog supervision

UINT32
0
20 .. 65535

ulSlaveStationAddr

UINT32

Watchdog supervision deactivated


Watchdog time in milliseconds
Slave Station Address

1 .. 64
255
ulBaudRate

Default Software Version is used


Value from parameter ulSwVersion is used

UINT32

Slave Station Address from Packet


Slave Station Address and Baudrate from rotary
switches (Allowed for devices with rotary switches)
Baudrate

0
1
2
3
4

156 kBaud
625 kBaud
2500 kBaud
5 MBaud
10 MBaud
Note: Parameter will not be used if rotary switches
are used for configuration. Parameter
ulSlaveStationAddr has to be set to 255 in
order to activate rotary switch configuration (On
devices with rotary switches, only)

ulStationType

Station Type

UINT32
0
1

Remote I/O Station


Remote Device Station

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 71

CC-Link Slave Protocol API


ulNoStation

Number of Occupied Stations

UINT32
1
1 .. 4

ulCcLinkVersion

CC-Link Version

UINT32
0
1

ulExtensionCycle

Range for Remote I/O Station


Range for Remote Device Station

UINT32

Version 1
Version 2 (Remote Device Station only)
Number of extension cycles for CC-Link Version 1

Single setting / one cycle


Number of extension cycles for CC-Link Version 2

ulReserved

UINT32

fHoldClrMode

BOOLEAN32

0
1
2
3

Single setting / one cycle


Double setting / two cycles
Quadruple setting / four cycles
Octuple setting / eight cycles

Reserved for further use, set to zero


Behavior in case of bus error

0
1

Clear output data


Hold last received output data

ulVendorCode

UINT32

0 .. 65535

Vendor code (If corresponding bit in parameter


ulCcLinkFlags parameter is set)

ulModelType

UINT32

0 .. 255

Model type (If corresponding bit in parameter


ulCcLinkFlags is set)

ulSwVersion

UINT32

0 .. 63

Software version (If corresponding bit in parameter


ulCcLinkFlags is set)

Table 66: CCLINK_APS_PCK_WARMSTART_CNF_T Set Warmstart Parameter Confirmation

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 72

CC-Link Slave Protocol API


Packet Status/Error
Definition / (Value)

Description

TLR_S_OK
(0x00000000)

Status ok

TLR_I_CCLINK_APS_CONFIG_LOCK
(0x406B0009)

Configuration is locked.

TLR_E_CCLINK_APS_PACKET_LENGTH
(0xC06B0008)

Invalid packet length.

TLR_E_CCLINK_APS_STATION_TYPE_
PARAMETER
(0xC06B001A)

Invalid parameter for station type.

TLR_E_CCLINK_APS_NO_STATION_
PARAMETER
(0xC06B000D)

Invalid parameter for number of stations.

TLR_E_CCLINK_APS_STATION_ADDR_
WITH_NO_STATIONS_PARAMETER
(0xC06B001B)

Invalid parameter for station address in combination with number


of stations.

TLR_E_CCLINK_APS_CCLINK_VERSION
_PARAMETER
(0xC06B0019)

Invalid parameter for CC-Link version.

TLR_E_CCLINK_APS_VENDOR_CODE_
PARAMETER
(0xC06B000F)

Invalid parameter for vendor code.

TLR_E_CCLINK_APS_MODEL_TYPE_
PARAMETER
(0xC06B0012)

Invalid parameter for model type.

TLR_E_CCLINK_APS_SW_VERSION_
PARAMETER
(0xC06B0011)

Invalid parameter for software version.

TLR_E_CCLINK_APS_DATABASE_FOUND
(0xC06B000A)

Configuration database found.

TLR_E_CCLINK_APS_REQUEST_RUNNING
(0xC06B0014)

Request already running.

TLR_E_CCLINK_APS_EXTENSION_
CYCLE_PARAMETER
(0xC06B001C)

Invalid parameter extension cycle.

TLR_E_CCLINK_APS_STATION_TYPE_
WITH_CCLINK_VERSION_PARAMETER
(0xC06B001D)

Invalid parameter for station type in combination with CC-Link


version.

Table 67: CCLINK_APS_PCK_WARMSTART_CNF Packet Status/Error

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

5.1.2

The Application Interface 73

CCLINK_APS_SET_CONFIGURATION_REQ/CNF Set Configuration

This service can be used by the user application in order to configure the AP-task with warmstart
parameters. After this request is received, the AP-task will configure the CC-Link Slave task with the
given parameters from this request and, if configured, starts the communication with the CC-Link
network. The following applies:
Configuration parameters will be stored internally.
In case of any error no data will be stored at all.
A channel init is required to activate the parameterized data.
This packet does not perform any registration at the stack automatically. Registering must be
performed with a separate packet such as the registration packet described in the netX DualPort-Memory Manual (RCX_REGISTER_APP_REQ, code 0x2F10).
This request will be denied if the configuration lock flag is set
(for more information on this topic see section 3.3.1.1).

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

The Application Interface 74

Packet Structure Reference


typedef struct CCLINK_APS_SET_CONFIGURATION_REQ_DATA_Ttag
CCLINK_APS_SET_CONFIGURATION_REQ_DATA_T;
#define CCLINK_APS_SYS_FLAG_COM_CONTROLLED_RELEASE
#define CCLINK_APS_SYS_FLAG_IO_STATUS_ENABLED
#define CCLINK_APS_SYS_FLAG_IO_STATUS_32_BIT

0x00000001L
0x00000002L
0x00000004L

#define CCLINK_APS_WD_OFF
#define CCLINK_APS_WD_MIN_TIMEOUT
#define CCLINK_APS_WD_MAX_TIMEOUT

0x00000000L
0x00000014L
0x0000FFFFL

#define CCLINK_APS_CCLS_FLAGS_CFG_VENDOR_CODE
#define CCLINK_APS_CCLS_FLAGS_CFG_MODEL_TYPE
#define CCLINK_APS_CCLS_FLAGS_CFG_SW_VERSION

0x00000001L
0x00000002L
0x00000004L

#define CCLINK_APS_STATION_ADDR_CFG_ROTARY_SWITCH

0x000000FFL

struct CCLINK_APS_SET_CONFIGURATION_REQ_DATA_Ttag
{
TLR_UINT32
ulSystemFlags;
TLR_UINT32
ulWdgTime;
TLR_UINT32
ulCcLinkFlags;
TLR_UINT32
TLR_UINT32

ulSlaveStationAddr;
ulBaudRate;

TLR_UINT32
TLR_UINT32
TLR_UINT32
TLR_UINT32
TLR_UINT32
TLR_BOOLEAN32

ulStationType;
ulNoStation;
ulCcLinkVersion;
ulExtensionCycle;
ulReserved;
fHoldClrMode;

TLR_UINT32
TLR_UINT32
TLR_UINT32
};

ulVendorCode;
ulModelType;
ulSwVersion;

typedef struct CCLINK_APS_PCK_SET_CONFIGURATION_REQ_Ttag


CCLINK_APS_PCK_SET_CONFIGURATION_REQ_T;
struct CCLINK_APS_PCK_SET_CONFIGURATION_REQ_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_APS_SET_CONFIGURATION_REQ_DATA_T tData;
}

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 75

CC-Link Slave Protocol API


Packet Description
structure CCLINK_APS_PCK_SET_CONFIGURATION_REQ_T
Type: Request
Area

Variable

Type

Value / Range

Description

tHead structure TLR_PACKET_HEADER_T


ulDest

UINT32

Destination Queue-Handle

ulSrc

UINT32

Source Queue-Handle

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process.
Set to 0 for the Initialization Packet

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

56

Packet Data Length in bytes


32

ulId

UINT32

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet

ulSta

UINT32

ulCmd

UINT32

0x00004604

CCLINK_APS_SET_CONFIGURATION_REQ Command

ulExt

UINT32

Extension not in use, set to zero for compatibility


reasons

ulRout

UINT32

Routing, do not touch

See section 6.1Status/Error Codes CC-Link APS-Task

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 76

CC-Link Slave Protocol API

tData

structure CCLINK_APS_SET_CONFIGURATION_REQ_DATA_T
ulSystemFlags

System Flags

UINT32

BIT 0: AUTOSTART / APPLICATION CONTROLLED


0

Communication with a controller after a device start


is allowed without BUS_ON flag, but the
communication will be interrupted if the BUS_ON
flag changes state to 0.
communication with controller is allowed only with
the BUS_ON flag.
BIT 1: I/O STATUS DISABLED/ ENABLED
Not supported yet
BIT 2: IO STATUS 32 BIT
Not supported yet
BIT 3 - 31: Reserved for further use, set to zero

ulWdgTime

Watchdog supervision

UINT32
0
20 .. 65535

ulCcLinkFlags

Watchdog supervision deactivated


Watchdog time in milliseconds
CC-Link Flags

UINT32

Bit 0: CONFIG VENDOR CODE


DISABLED/ENABLED
0
1

Default Vendor Code is used


Value from parameter ulVendorCode is used
Bit 1: CONFIG MODEL TYPE
DISABLED/ENABLED

0
1

Default Model Type is used


Value from parameter ulModelType is used
Bit 2: CONFIG SW VERSION
DISABLED/ENABLED

0
1
ulSlaveStationAddr

UINT32

Slave Station Address


1 .. 64
255

ulBaudRate

Default Software Version is used


Value from parameter ulSwVersion is used

UINT32

Slave Station Address from Packet


Slave Station Address and Baudrate from rotary
switches (On devices with rotary switches, only)
Baudrate

0
1
2
3
4

156 kBaud
625 kBaud
2500 kBaud
5 MBaud
10 MBaud
Note: Parameter will not be used if rotary switches
are used for configuration. Parameter
ulSlaveStationAddr has to be set to 255 in
order to activate rotary switch configuration (On
devices with rotary switches, only)

ulStationType

Station Type

UINT32
0
1

Remote I/O Station


Remote Device Station

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 77

CC-Link Slave Protocol API


ulNoStation

Number of Occupied Stations

UINT32
1
1 .. 4

ulCcLinkVersion

CC-Link Version

UINT32
0
1

ulExtensionCycle

Range for Remote I/O Station


Range for Remote Device Station

UINT32

Version 1
Version 2 (Remote Device Station only)
Number of extension cycles for CC-Link Version 1

Single setting / one cycle


Number of extension cycles for CC-Link Version 2

ulReserved

UINT32

fHoldClrMode

BOOLEAN32

0
1
2
3

Single setting / one cycle


Double setting / two cycles
Quadruple setting / four cycles
Octuple setting / eight cycles

Reserved for further use, set to zero


Behavior in case of bus error

0
1

Clear output data


Hold last received output data

ulVendorCode

UINT32

0 .. 65535

Vendor code (If corresponding bit in parameter


ulCcLinkFlags parameter is set)

ulModelType

UINT32

0 .. 255

Model type (If corresponding bit in parameter


ulCcLinkFlags is set)

ulSwVersion

UINT32

0 .. 63

Software version (If corresponding bit in parameter


ulCcLinkFlags is set)

Table 68: CCLINK_APS_PCK_SET_CONFIGURATION_REQ_T Set Warmstart Parameter Request

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 78

CC-Link Slave Protocol API


Packet Structure Reference

typedef struct CCLINK_APS_PCK_SET_CONFIGURATION_CNF_Ttag


CCLINK_APS_PCK_SET_CONFIGURATION_CNF_T;
struct CCLINK_APS_PCK_SET_CONFIGURATION_CNF_Ttag
{
TLR_PACKET_HEADER_T
tHead;
};

Packet Description
structure CCLINK_APS_PCK_SET_CONFIGURATION_CNF_T
Type: Request
Area

Variable

Type

Value / Range

Description

tHead structure TLR_PACKET_HEADER_T


ulDest

UINT32

Destination Queue-Handle

ulSrc

UINT32

Source Queue-Handle

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process.
Set to 0 for the Initialization Packet

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

Packet Data Length in bytes


32

ulId

UINT32

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet

ulSta

UINT32

ulCmd

UINT32

0x00004605

CCLINK_APS_SET_CONFIGURATION_CNF Command

ulExt

UINT32

Extension not in use, set to zero for compatibility


reasons

ulRout

UINT32

Routing, do not touch

See section 6.1Status/Error Codes CC-Link APS-Task

Table 69: CCLINK_APS_PCK_SET_CONFIGURATION_CNF_T Set Warmstart Parameter Confirmation

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 79

CC-Link Slave Protocol API

5.2

The CC-Link Slave-Task

The CC-Link Slave-Task handles, within the CC-Link Slave stack, the CC-Link protocol.
To get the handle of the process queue of the CC-Link Slave-Task-Task the Macro
TLR_QUE_IDENTIFY() has to be used in conjunction with the following ASCII-queue name

ASCII Queue name

Description

"QUE_CCLSLAVE

Name of the CC-Link Slave-Task process queue

Table 70: CC-Link APS-Task Process Queue

The returned handle has to be used as value ulDest in all initiator packets the AP-Task intends to
send to the CC-Link Slave-Task. This handle is the same handle that has to be used in conjunction
with the macros TLR_QUE_SENDPACKET_FIFO/LIFO() for sending a packet to the CC-Link SlaveTask.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

5.2.1

The Application Interface 80

CCLINK_SLAVE_INITIALIZE_REQ/CNF Initialization of CC-Link Slave

This request is used in order to reset the CC-Link Slave. This request will be denied if the
configuration lock flag is set (for more information on this topic see section 3.3.1.1).
Note: This command does not delete configuration databases. If the CC-Link Slave is
configured by configuration database, this configuration is reloaded again after the
initialize command is completed.

Packet Structure Reference


typedef struct CCLINK_SLAVE_INITIALIZE_REQ_DATA_Ttag
CCLINK_SLAVE_INITIALIZE_REQ_DATA_T;
struct CCLINK_SLAVE_INITIALIZE_REQ_DATA_Ttag
{
TLR_UINT32 ulReserved;
};
typedef struct CCLINK_SLAVE_PACKET_INITIALIZE_REQ_Ttag
CCLINK_SLAVE_PACKET_INITIALIZE_REQ_T;
struct CCLINK_SLAVE_PACKET_INITIALIZE_REQ_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_INITIALIZE_REQ_DATA_T tData;
};

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 81

CC-Link Slave Protocol API


Packet Description

Structure Information CCLINK_SLAVE_PACKET_INITIALIZE_REQ_T


Type: Request
Area

Variable

tHead

Structure TLR_PACKET_HEADER_T

tData

Type

Value / Range

Description

ulDest

UINT32

Destination Queue-Handle of CC-Link Slave Task


Process Queue

ulSrc

UINT32

Source Queue-Handle of AP-Task Process Queue

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

0x00004500

CCLINK_SLAVE_INITIALIZE_REQ Command

ulExt

UINT32

Reserved

ulRout

UINT32

Routing Information

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link Slave-Task

Structure CCLINK_SLAVE_INITIALIZE_REQ_DATA_T
ulReserved

UINT32

Reserved for further use, set to zero

Table 71: CCLINK_SLAVE_PACKET_INITIALIZE_REQ_T Initialization of CC-Link Slave Request

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 82

CC-Link Slave Protocol API


Packet Structure Reference
typedef struct CCLINK_SLAVE_INITIALIZE_CNF_DATA_Ttag
CCLINK_SLAVE_INITIALIZE_CNF_DATA_T;
struct CCLINK_SLAVE_INITIALIZE_CNF_DATA_Ttag
{
TLR_UINT32 ulReserved;
};
typedef struct CCLINK_SLAVE_PACKET_INITIALIZE_CNF_Ttag
CCLINK_SLAVE_PACKET_INITIALIZE_CNF_T;
struct CCLINK_SLAVE_PACKET_INITIALIZE_CNF_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_INITIALIZE_CNF_DATA_T tData;
};

Packet Description
Structure Information CCLINK_SLAVE_PACKET_INITIALIZE_CNF_T
Type: Confirmation
Area

Variable

tHead

Structure TLR_PACKET_HEADER_T

tData

Type

Value / Range

Description

ulDest

UINT32

Destination Queue-Handle, untouched

ulSrc

UINT32

Source Queue-Handle, untouched

ulDestId

UINT32

Destination End Point Identifier, untouched

ulSrcId

UINT32

Source End Point Identifier, untouched

ulLen

UINT32

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

ulExt

UINT32

Extension, reserved

ulRout

UINT32

Routing Information, do not change

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link Slave-Task

0x00004501

CCLINK_SLAVE_INITIALIZE_CNF - Command

Structure CCLINK_SLAVE_INITIALIZE_CNF_DATA_T
ulReserved

UINT32

Reserved for further use, set to zero

Table 72: CCLINK_SLAVE_PACKET_INITIALIZE_CNF_T Initialization of CC-Link Slave Confirmation

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

5.2.2

The Application Interface 83

CCLINK_SLAVE_REGISTER_REQ/CNF Register Application

This packet is used in order to register to the CC-Link Slave-Task. After this request is performed
successfully, indication packets are sent from the CC-Link Slave-Task to the source queue of this
request packet.
Note: This packet is used by the AP-task only and will not be routed from the user
application to the CC-Link Slave-Task.

Note: This packet will no longer be supported by the firmware described in this document
after September 1, 2009.
Use the registering functionality described in the netX Dual-Port-Memory Manual
instead (RCX_REGISTER_APP_REQ, code 0x2F10).

Packet Structure Reference


typedef struct CCLINK_SLAVE_APP_REGISTER_REQ_DATA_Ttag
CCLINK_SLAVE_APP_REGISTER_REQ_DATA_T;
struct CCLINK_SLAVE_APP_REGISTER_REQ_DATA_Ttag
{
TLR_UINT32 ulReserved;
};
typedef struct CCLINK_SLAVE_PACKET_APP_REGISTER_REQ_Ttag
CCLINK_SLAVE_PACKET_APP_REGISTER_REQ_T;
struct CCLINK_SLAVE_PACKET_APP_REGISTER_REQ_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_APP_REGISTER_REQ_DATA_T tData;
};

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 84

CC-Link Slave Protocol API


Packet Description

Structure Information CCLINK_SLAVE_PACKET_APP_REGISTER_REQ_T


Type: Request
Area

Variable

tHead

Structure TLR_PACKET_HEADER_T

tData

Type

Value / Range

Description

ulDest

UINT32

Destination Queue-Handle of CC-Link Slave-Task


Process Queue

ulSrc

UINT32

Source Queue-Handle of AP-Task Process Queue

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

0x00004502

CCLINK_SLAVE_REGISTER_REQ - Command

ulExt

UINT32

Reserved

ulRout

UINT32

Routing Information

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See Table 74: CCLINK_SLAVE_REGISTER_REQ
Packet Status/Error

structure CCLINK_SLAVE_APP_REGISTER_REQ_DATA_T
ulReserved

UINT32

Reserved for further use, set to zero

Table 73: CCLINK_SLAVE_PACKET_APP_REGISTER_REQ_T Register Application Request

Packet Status/Error
Definition / (Value)

Description

TLR_S_OK
(0x00000000)

Status ok

Table 74: CCLINK_SLAVE_REGISTER_REQ Packet Status/Error

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 85

CC-Link Slave Protocol API


Packet Structure Reference
typedef struct CCLINK_SLAVE_APP_REGISTER_CNF_DATA_Ttag
CCLINK_SLAVE_APP_REGISTER_CNF_DATA_T;
struct CCLINK_SLAVE_APP_REGISTER_CNF_DATA_Ttag
{
TLR_UINT32 ulReserved;
};

typedef struct CCLINK_SLAVE_PACKET_APP_REGISTER_CNF_Ttag


CCLINK_SLAVE_PACKET_APP_REGISTER_CNF_T;
struct CCLINK_SLAVE_PACKET_APP_REGISTER_CNF_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_APP_REGISTER_CNF_DATA_T tData;
};

Packet Description
Structure Information CCLINK_SLAVE_PACKET_APP_REGISTER_CNF
Type: Confirmation
Area

Variable

tHead

Structure TLR_PACKET_HEADER_T

tData

Type

Value / Range

Description

ulDest

UINT32

Destination Queue-Handle, untouched

ulSrc

UINT32

Source Queue-Handle, untouched

ulDestId

UINT32

Destination End Point Identifier, untouched

ulSrcId

UINT32

Source End Point Identifier, untouched

ulLen

UINT32

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

ulExt

UINT32

Extension, reserved

ulRout

UINT32

Routing Information, do not change

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See Table 76: CCLINK_SLAVE_REGISTER_CNF
Packet Status/Error

0x00004503

CCLINK_SLAVE_REGISTER_CNF - Command

Structure CCLINK_SLAVE_APP_REGISTER_CNF_DATA_T
ulReserved

UINT32

Reserved for further use, set to zero

Table 75: CCLINK_SLAVE_PACKET_APP_REGISTER_CNF_T Register Application Confirmation

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

The Application Interface 86

Packet Status/Error
Definition / (Value)

Description

TLR_S_OK
(0x00000000)

Status ok

TLR_E_CCLINK_SLAVE_
PACKET_LENGTH
(0xC06A0004)

Invalid length in packet.

Table 76: CCLINK_SLAVE_REGISTER_CNF Packet Status/Error

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

5.2.3

The Application Interface 87

CCLINK_SLAVE_GET_BUFFER_HANDLE_REQ/CNF Get Buffer


Handle

This packet can be used in order to get the handle for the send and receive triple buffer for data
exchange between APS- and CC-Link Slave-Task.
Note: This packet is used by the AP-Task only and will not be routed from the user
application to the CC-Link Slave-Task.
The received handles can be used with the macros TLR_GETEXCHGED_TRIBUFF() and
TLR_EXCHANGE_TRIBUFF() in order to exchange data with the CC-Link network.
Packet Structure Reference
typedef struct CCLINK_SLAVE_GET_BUFFER_HANDLE_REQ_DATA_Ttag
CCLINK_SLAVE_GET_BUFFER_HANDLE_REQ_DATA_T;
struct CCLINK_SLAVE_GET_BUFFER_HANDLE_REQ_DATA_Ttag
{
TLR_UINT32 ulReserved;
};
typedef struct CCLINK_SLAVE_PACKET_GET_BUFFER_HANDLE_REQ_Ttag
CCLINK_SLAVE_PACKET_GET_BUFFER_HANDLE_REQ_T;
struct CCLINK_SLAVE_PACKET_GET_BUFFER_HANDLE_REQ_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_GET_BUFFER_HANDLE_REQ_DATA_T tData;
};

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 88

CC-Link Slave Protocol API


Packet Description

Structure Information CCLINK_SLAVE_PACKET_GET_BUFFER_HANDLE_REQ_T


Type: Request
Area

Variable

tHead

Structure TLR_PACKET_HEADER_T

tData

Type

Value / Range

Description

ulDest

UINT32

Destination Queue-Handle of CC-Link Slave-Task


Process Queue

ulSrc

UINT32

Source Queue-Handle of AP-Task Process Queue

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

0x00004504

CCLINK_SLAVE_GET_BUFFER_HANDLE_REQ Command

ulExt

UINT32

Reserved

ulRout

UINT32

Routing Information

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link Slave-Task

Structure CCLINK_SLAVE_GET_BUFFER_HANDLE_REQ_DATA_T
ulReserved

UINT32

Reserved, set to zero

Table 77: CCLINK_SLAVE_PACKET_GET_BUFFER_HANDLE_REQ_T Get Buffer Handle Request

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

The Application Interface 89

Packet Structure Reference


typedef struct CCLINK_SLAVE_GET_BUFFER_HANDLE_CNF_DATA_Ttag
CCLINK_SLAVE_GET_BUFFER_HANDLE_CNF_DATA_T;
#define CCLINK_SLAVE_SEND_RECV_BUFFER_SIZE 384
struct CCLINK_SLAVE_GET_BUFFER_HANDLE_CNF_DATA_Ttag
{
TLR_UINT32 ulReserved;
TLR_UINT32 ulRecvBuffer;
TLR_UINT32 ulSendBuffer;
};
typedef struct CCLINK_SLAVE_PACKET_GET_BUFFER_HANDLE_CNF_Ttag
CCLINK_SLAVE_PACKET_GET_BUFFER_HANDLE_CNF_T;
struct CCLINK_SLAVE_PACKET_GET_BUFFER_HANDLE_CNF_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_GET_BUFFER_HANDLE_CNF_DATA_T tData;
};

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 90

CC-Link Slave Protocol API


Packet Description

Structure Information CCLINK_SLAVE_PACKET_GET_BUFFER_HANDLE_CNF


Type: Confirmation
Area

Variable

Type

Value / Range

tHead

Structure TLR_PACKET_HEADER_T

Description

ulDest

UINT32

Destination Queue-Handle, untouched

ulSrc

UINT32

Source Queue-Handle, untouched

ulDestId

UINT32

Destination End Point Identifier, untouched

ulSrcId

UINT32

Source End Point Identifier, untouched

ulLen

UINT32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

12

Packet Data Length in bytes


32

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link SlaveTask

0x00004505

CCLINK_SLAVE_GET_BUFFER_HANDLE_CNF Command

tData

ulExt

UINT32

Extension, reserved

ulRout

UINT32

Routing Information, do not change

Structure CCLINK_SLAVE_GET_BUFFER_HANDLE_CNF_DATA_T
ulReserved

UINT32

Reserved for further use

ulRecvBuffer

UINT32

Receive Buffer

ulSendBuffer

UINT32

Send Buffer

Table 78: CCLINK_SLAVE_GET_BUFFER_HANDLE_CNF_T Get Buffer Handle Confirmation

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 91

CC-Link Slave Protocol API

5.2.4

CCLINK_SLAVE_SET_BUSPARAM_REQ/CNF Set Bus Parameters

This packet is used by the APS-Task in order to set the bus parameters for the CC-Link Slave Task,
but can also be sent from the user application This request will be denied if the configuration lock flag
is set (see section 3.3.1.1 of this document).
Note: The user application should use the warmstart request for configuration of the CCLink
Slave
stack.
This
request
is
described
in
section
CCLINK_APS_SET_CONFIGURATION_REQ/CNF Set Configuration.

Bus parameter Structure Reference


typedef struct CCLINK_SLAVE_BUS_PARAM_Ttag
CCLINK_SLAVE_BUS_PARAM_T;
#define CCLINK_SLAVE_MIN_SLAVE_STATION_ADDR
#define CCLINK_SLAVE_MAX_SLAVE_STATION_ADDR
#define
#define
#define
#define
#define

CCLINK_SLAVE_BAUD_156K
CCLINK_SLAVE_BAUD_625K
CCLINK_SLAVE_BAUD_2500K
CCLINK_SLAVE_BAUD_5M
CCLINK_SLAVE_BAUD_10M

0x00000001L
0x00000040L

0x00000000L
0x00000001L
0x00000002L
0x00000003L
0x00000004L

#define CCLINK_SLAVE_STATION_TYPE_IO_DEVICE
0x00000000L
#define CCLINK_SLAVE_STATION_TYPE_REMOTE_DEVICE 0x00000001L
#define CCLINK_SLAVE_NO_STATION_IO_DEVICE

0x00000001L

#define CCLINK_SLAVE_MIN_NO_STAIONS_REMOTE_DEVICE 0x00000001L


#define CCLINK_SLAVE_MAX_NO_STAIONS_REMOTE_DEVICE 0x00000004L
#define CCLINK_SLAVE_CCLINK_VERSION_1
#define CCLINK_SLAVE_CCLINK_VERSION_2
#define
#define
#define
#define

0x00000000L
0x00000001L

CCLINK_SLAVE_CCLINK_EXTENSION_CYCLE_SINGLE
CCLINK_SLAVE_CCLINK_EXTENSION_CYCLE_DOUBLE
CCLINK_SLAVE_CCLINK_EXTENSION_CYCLE_QUADRUPLE
CCLINK_SLAVE_CCLINK_EXTENSION_CYCLE_OCTUPLE

0x00000000L
0x00000001L
0x00000002L
0x00000003L

struct CCLINK_SLAVE_BUS_PARAM_Ttag
{
TLR_UINT32
ulSlaveStationAddr;
TLR_UINT32
ulBaudRate;
TLR_UINT32
TLR_UINT32

ulStationType;
ulNoStation;

TLR_UINT32
TLR_UINT32

ulCcLinkVersion;
ulExtensionCycle;

TLR_UINT32
ulReserved;
TLR_BOOLEAN32 fHoldClrMode;
};

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 92

CC-Link Slave Protocol API


typedef struct CCLINK_SLAVE_ADD_PARAM_Ttag
CCLINK_SLAVE_ADD_PARAM_T;
#define CCLINK_SLAVE_MAX_VENDOR_CODE
#define CCLINK_SLAVE_MAX_MODEL_TYPE
#define CCLINK_SLAVE_MAX_SW_VERSION

0x0000FFFFL
0x000000FFL
0x0000003FL

struct CCLINK_SLAVE_ADD_PARAM_Ttag
{
TLR_UINT32 ulVendorCode;
TLR_UINT32 ulModelType;
TLR_UINT32 ulSwVersion;
};

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 93

CC-Link Slave Protocol API

Variable

Type

Value / Range

Description

ulSlaveStationAddr

UINT32

1 .. 64

Slave Station Address

ulBaudRate

UINT32

Baudrate
0
1
2
3
4

ulStationType

UINT32

Station Type
0
1

ulNoStation

UINT32

UINT32

Range for Remote I/O Station


Range for Remote Device Station
Version of CC-Link protocol

0
1
ulExtensionCycle

Remote I/O Station


Remote Device Station
Number of occupied stations

1
1 .. 4
ulCcLinkVersion

156 kBaud
625 kBaud
2500 kBaud
5 MBaud
10 MBaud

Version 1
Version 2 (Remote Device Station only)
Number of extension cycles for CC-Link
Version 1

UINT32
0

Single setting / one cycle


Number of extension cycles for CC-Link
Version 2

ulReserved

UINT32

fHoldClrMode

BOOLEAN32

0
1
2
3

Single setting / one cycle


Double setting / two cycles
Quadruple setting / four cycles
Octuple setting / eight cycles

Reserved for further use, set to zero


Behavior in case of bus error

0
1

Clear output data


Hold last received output data

Table 79: CCLINK_SLAVE_CFG_BUS_PARAM_T - Bus Parameter Configuration


Variable

Type

Range

Description

ulVendorCode

UINT32

0 .. 65535

Vendor Code

ulModelType

UINT32

0 . 255

Model Type

ulSwVersion

UINT32

0 .. 63

Software Version

Table 80: CCLINK_SLAVE_CFG_ADD_PARAM_T - Additional Configuration

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 94

CC-Link Slave Protocol API


Packet Structure Reference

typedef struct CCLINK_SLAVE_SET_BUS_PARAM_REQ_DATA_Ttag


CCLINK_SLAVE_SET_BUS_PARAM_REQ_DATA_T;
struct CCLINK_SLAVE_SET_BUS_PARAM_REQ_DATA_Ttag
{
CCLINK_SLAVE_BUS_PARAM_T tBusParam;
CCLINK_SLAVE_ADD_PARAM_T tAddParam;
};
typedef struct CCLINK_SLAVE_PACKET_SET_BUS_PARAM_REQ_Ttag
CCLINK_SLAVE_PACKET_SET_BUS_PARAM_REQ_T;
struct CCLINK_SLAVE_PACKET_SET_BUS_PARAM_REQ_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_SET_BUS_PARAM_REQ_DATA_T tData;
};

Packet Description
Structure Information CCLINK_SLAVE_PACKET_SET_BUSPARAM_REQ_T
Type: Request
Area

Variable

Type

Value / Range

tHead

Structure TLR_PACKET_HEADER_T

Description

ulDest

UINT32

Destination Queue-Handle of CC-Link Slave-Task


Process Queue

ulSrc

UINT32

Source Queue-Handle of AP-Task Process Queue

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

44

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

0x00004506

CCLINK_SLAVE_SET_BUS_PARAM_REQ - Command

ulExt

UINT32

Reserved

ulRout

UINT32

Routing Information

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link Slave-Task

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

tData

The Application Interface 95

Structure CCLINK_SLAVE_SET_BUSPARAM_REQ_DATA_T
CCLINK_
See Table 79: CCLINK_SLAVE_CFG_BUS_PARAM_T - Bus Parameter
SLAVE_CFG_
BUS_PARAM_T
CCLINK_
See Table 80: CCLINK_SLAVE_CFG_ADD_PARAM_T - Additional Configuration
SLAVE_CFG_
ADD_PARAM_T

Table 81: CCLINK_SLAVE_SET_BUSPARAM_REQ_DATA_T Set Bus Parameter Request

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 96

CC-Link Slave Protocol API


Packet Structure Reference
typedef struct CCLINK_SLAVE_SET_BUSPARAM_CNF_DATA_Ttag
CCLINK_SLAVE_SET_BUSPARAM_CNF_DATA_T;
struct CCLINK_SLAVE_SET_BUSPARAM_CNF_DATA_Ttag
{
CCLINK_SLAVE_CFG_BUS_PARAM_T tCfgBusParam;
CCLINK_SLAVE_CFG_ADD_PARAM_T tCfgAddParam;
};

typedef struct CCLINK_SLAVE_PACKET_SET_BUSPARAM_CNF_Ttag


CCLINK_SLAVE_PACKET_SET_BUSPARAM_REQ_T;
struct CCLINK_SLAVE_PACKET_SET_BUSPARAM_REQ_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_SET_BUSPARAM_REQ_DATA_T tData;
};

Packet Description
Structure Information CCLINK_SLAVE_PACKET_SET_BUSPARAM_CNF_T
Type: Confirmation
Area

Variable

tHead

Structure TLR_PACKET_HEADER_T

tData

Type

Value / Range

Description

ulDest

UINT32

Destination Queue-Handle, untouched

ulSrc

UINT32

Source Queue-Handle, untouched

ulDestId

UINT32

Destination End Point Identifier, untouched

ulSrcId

UINT32

Source End Point Identifier, untouched

ulLen

UINT32

44

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

ulExt

UINT32

Extension, reserved

ulRout

UINT32

Routing Information, do not change

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link Slave-Task

0x00004507

CCLINK_SLAVE_SET_BUSPARAM_CNF - Command

Structure CCLINK_SLAVE_SET_BUSPARAM_REQ_DATA_T
CCLINK_
See Table 79: CCLINK_SLAVE_CFG_BUS_PARAM_T - Bus Parameter
SLAVE_CFG_
BUS_PARAM_T
CCLINK_
See Table 80: CCLINK_SLAVE_CFG_ADD_PARAM_T - Additional Configuration
SLAVE_CFG_
ADD_PARAM_T

Table 82: CCLINK_SLAVE_PACKET_SET_BUSPARAM_CNF_T Set Bus Parameter Confirmation

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 97

CC-Link Slave Protocol API

5.2.5

CCLINK_SLAVE_STARTSTOP_REQ/CNF Start/Stop Communication with


Network

This packet starts or stops the communication with the CC-Link network depending on the value of the
ulMode parameter.
Note: This packet is obsolete and will not longer supported after September,1, 2009. It is
replaced by packet RCX_START_STOP_COMM_REQ/CNF which contains
identical functionality. Do not use this packet for all new developments

Packet Structure Reference


typedef struct CCLINK_SLAVE_STARTSTOP_REQ_DATA_Ttag
CCLINK_SLAVE_STARTSTOP_REQ_DATA_T;
#define CCLINK_SLAVE_STOP_CCLINK
#define CCLINK_SLAVE_START_CCLINK

0x00000000L
0x00000001L

struct CCLINK_SLAVE_STARTSTOP_REQ_DATA_Ttag
{
TLR_UINT32 ulMode;
};
typedef struct CCLINK_SLAVE_PACKET_STARTSTOP_REQ_Ttag
CCLINK_SLAVE_PACKET_STARTSTOP_REQ_T;
struct CCLINK_SLAVE_PACKET_STARTSTOP_REQ_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_STARTSTOP_REQ_DATA_T tData;
};

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 98

CC-Link Slave Protocol API


Packet Description
Structure Information CCLINK_SLAVE_PACKET_STARTSTOP_REQ_T
Type: Request
Area

Variable

tHead

Structure TLR_PACKET_HEADER_T

tData

Type

Value / Range

Description

ulDest

UINT32

Destination Queue-Handle of CC-Link Slave-Task


Process Queue

ulSrc

UINT32

Source Queue-Handle of AP-Task Process Queue

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

0x00004508

CCLINK_SLAVE_STARTSTOP_REQ - Command

ulExt

UINT32

Reserved

ulRout

UINT32

Routing Information

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link Slave-Task

Structure CCLINK_SLAVE_STARTSTOP_REQ_DATA_T
ulMode

UINT32

Depending on this assignment, communication is either


started or stopped:
0
1

Stop communication with Network


Start communication with Network

Table 83: CCLINK_SLAVE_PACKET_STARTSTOP_REQ_T Start/Stop Communication Request

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 99

CC-Link Slave Protocol API


Packet Structure Reference
typedef struct CCLINK_SLAVE_STARTSTOP_CNF_DATA_Ttag
CCLINK_SLAVE_STARTSTOP_CNF_DATA_T;
#define CCLINK_SLAVE_STOP_CCLINK
#define CCLINK_SLAVE_START_CCLINK

0x00000000L
0x00000001L

struct CCLINK_SLAVE_STARTSTOP_CNF_DATA_Ttag
{
TLR_UINT32 ulMode;
};
typedef struct CCLINK_SLAVE_PACKET_STARTSTOP_CNF_Ttag
CCLINK_SLAVE_PACKET_STARTSTOP_CNF_T;
struct CCLINK_SLAVE_PACKET_STARTSTOP_CNF_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_STARTSTOP_CNF_DATA_T tData;
};

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 100

CC-Link Slave Protocol API


Packet Description

Structure Information CCLINK_SLAVE_PACKET_STARTSTOP_CNF_T


Type: Confirmation
Area

Variable

tHead

Structure TLR_PACKET_HEADER_T

tData

Type

Value / Range

Description

ulDest

UINT32

Destination Queue-Handle, untouched

ulSrc

UINT32

Source Queue-Handle, untouched

ulDestId

UINT32

Destination End Point Identifier, untouched

ulSrcId

UINT32

Source End Point Identifier, untouched

ulLen

UINT32

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

ulExt

UINT32

Extension, reserved

ulRout

UINT32

Routing Information, do not change

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link Slave-Task

0x00004509

CCLINK_SLAVE_STARTSTOP_CNF - Command

structure CCLINK_SLAVE_STARTSTOP_CNF_DATA_T
ulMode

UINT32

Depending on this assignment, communication is


either started or stopped:
0
1

Stop communication with network


Start communication with network

Table 84: CCLINK_SLAVE_PACKET_STARTSTOP_CNF_T Start/Stop Communication Confirmation

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

5.2.6

The Application Interface 101

CCLINK_SLAVE_GET_CCL_STATUS_REQ/CNF Get CC-Link Status

This request can be used in order to get the status of the CC-Link Master and Slave.
Packet Structure Reference
typedef struct CCLINK_SLAVE_GET_CCL_STATUS_REQ_DATA_Ttag
CCLINK_SLAVE_GET_CCL_STATUS_REQ_DATA_T;
struct CCLINK_SLAVE_GET_CCL_STATUS_REQ_DATA_Ttag
{
TLR_UINT32 ulReserved;
};
typedef struct CCLINK_SLAVE_PACKET_GET_CCL_STATUS_REQ_Ttag
CCLINK_SLAVE_PACKET_GET_CCL_STATUS_REQ_T;
struct CCLINK_SLAVE_PACKET_GET_CCL_STATUS_REQ_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_GET_CCL_STATUS_REQ_DATA_T tData;
};

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 102

CC-Link Slave Protocol API


Packet Description

Structure Information CCLINK_SLAVE_PACKET_GET_CCL_STATUS_REQ_T


Type: Request
Area

Variable

tHead

Structure TLR_PACKET_HEADER_T

tData

Type

Value / Range

Description

ulDest

UINT32

Destination Queue-Handle of CC-Link Slave-Task


Process Queue

ulSrc

UINT32

Source Queue-Handle of AP-Task Process Queue

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

0x0000450A

CCLINK_SLAVE_GET_CCL_STATUS_REQ - Command

ulExt

UINT32

Reserved

ulRout

UINT32

Routing Information

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link Slave-Task

Structure CCLINK_SLAVE_GET_CCL_STATUS_REQ_DATA_T
ulReserved

UINT32

Reserved for further use, set to zero

Table 85: CCLINK_SLAVE_PACKET_GET_CCL_STATUS_REQ_T Get CC-Link Status Request

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

The Application Interface 103

Packet Structure Reference


typedef struct CCLINK_SLAVE_GET_CCL_STATUS_CNF_DATA_Ttag
CCLINK_SLAVE_GET_CCL_STATUS_CNF_DATA_T;
#define CCLINK_SLAVE_CCL_MASTER_ST1_MAS_STAT_USER_APP_PRG_MSK
0x00000001L
#define CCLINK_SLAVE_CCL_MASTER_ST1_MAS_STAT_USER_APP_PRG_ERR_CHK_MSK 0x00000002L
#define CCLINK_SLAVE_CCL_MASTER_ST1_REFRESH_STARTUP_MSK
0x00000004L
#define CCLINK_SLAVE_CCL_MASTER_ST1_TRANSIENT_DATA_STATUS_MSK
0x00000008L
#define CCLINK_SLAVE_CCL_MASTER_ST1_TRANSIENT_DATA_RECEPTION_EN_MSK
0x00000010L
#define CCLINK_SLAVE_CCL_MASTER_ST1_PROTOCOL_VERSION_MSK
0x00000060L
#define CCLINK_SLAVE_CCL_MASTER_ST1_MASTER_STATION_TYPE_MSK
0x00000080L
#
define CCLINK_SLAVE_CCL_MASTER_ST2_RY_INFO_TRANSMISSION_POINTS_MSK
0x00000F00L
#define CCLINK_SLAVE_CCL_MASTER_ST2_RWW_INFO_TRANSMISSION_POINTS_MSK 0x0000F000L
#define
#define
#define
#define
#define
#define
#define
#define

CCLINK_SLAVE_CCL_SLAVE_ST1_FUSE_STATUS_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_UNIT_ERROR_INVAL_NUM_OF_POINTS_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_NO_REFRESH_RECEIVE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_NO_PARAMETER_RECEIVE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_SWITCH_CHANGE_DETECTION_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_CYCLIC_COMMUNICATION_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_RES1_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_WDT_ERROR_MSK

0x00000001L
0x00000002L
0x00000004L
0x00000008L
0x00000010L
0x00000020L
0x00000040L
0x00000080L

#define
#define
#define
#define
#define
#define
#define

CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSIENT_DATA_STATUS_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSIENT_DATA_RECEPTION_EN_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSIENT_TYPE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_RES2_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSMISSION_ROUTE_STATUS_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_RES_FIXED_TO_ONE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_SETTING_MSK

0x00000100L
0x00000200L
0x00000400L
0x00000800L
0x00001000L
0x00002000L
0x0000C000L

#define
#define
#define
#define

CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_SINGLE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_DOUBLE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_QUADRUPLE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_OCTUPLE_MSK

0x00000000L
0x00004000L
0x00008000L
0x0000C000L

struct CCLINK_SLAVE_GET_CCL_STATUS_CNF_DATA_Ttag
{
TLR_UINT32 ulReserved;
TLR_UINT32 ulMasterState;
TLR_UINT32 ulSlaveState;
};
typedef struct CCLINK_SLAVE_PACKET_GET_CCL_STATUS_CNF_Ttag
CCLINK_SLAVE_PACKET_GET_CCL_STATUS_CNF_T;
struct CCLINK_SLAVE_PACKET_GET_CCL_STATUS_CNF_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_GET_CCL_STATUS_CNF_DATA_T tData;
};

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 104

CC-Link Slave Protocol API


Packet Description

Structure Information CCLINK_SLAVE_PACKET_GET_CCL_STATUS_CNF_T


Type: Confirmation
Area

Variable

tHead

Structure TLR_PACKET_HEADER_T

tData

Type

Value / Range

Description

ulDest

UINT32

Destination Queue-Handle, untouched

ulSrc

UINT32

Source Queue-Handle, untouched

ulDestId

UINT32

Destination End Point Identifier, untouched

ulSrcId

UINT32

Source End Point Identifier, untouched

ulLen

UINT32

12

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

ulExt

UINT32

Extension, reserved

ulRout

UINT32

Routing Information, do not change

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link SlaveTask

0x0000450B

CCLINK_SLAVE_GET_CCL_STATUS_CNF - Command

structure CCLINK_SLAVE_GET_CCL_STATUS_CNF_DATA_T
ulReserved

UINT32

Reserved for further use

ulMasterState UINT32

See section Extended Status

ulSlaveState

See section Extended Status

UINT32

Table 86: CCLINK_SLAVE_PACKET_GET_CCL_STATUS_CNF_T Get CC-Link Status Confirmation

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 105

CC-Link Slave Protocol API

5.2.7

CLINK_SLAVE_CHANGE_SLAVE_STATUS_REQ/CNF Change CC-Link


Slave Status

This request can be used in order to change several flags within the status of the CC-Link Slave.
Note: The switch change flag cannot be changed from the user application if the rotary
switches are handled by the APS-Task.

Packet Structure Reference


typedef struct CCLINK_SLAVE_CHANGE_SLAVE_STATUS_REQ_DATA_Ttag
CCLINK_SLAVE_GET_CCL_STATUS_REQ_DATA_T;
#define CCLINK_SLAVE_EVAL_FUSE_STATE_PARAM_MSK
#define CCLINK_SLAVE_EVAL_SWITCH_CHANGE_PARAM_MSK
#define CCLINK_SLAVE_EVAL_WATCHDOG_ERROR_PARAM_MSK

0x00000001L
0x00000002L
0x00000004L

struct CCLINK_SLAVE_CHANGE_SLAVE_STATUS_REQ_DATA_Ttag
{
TLR_UINT32
ulFlags;
TLR_BOOLEAN32 fFuseStatus;
TLR_BOOLEAN32 fSwitchChange;
TLR_BOOLEAN32 fWatchdogError;
};
typedef struct CCLINK_SLAVE_PACKET_CHANGE_SLAVE_STATUS_REQ_Ttag
CCLINK_SLAVE_PACKET_CHANGE_SLAVE_STATUS_REQ_T;
struct CCLINK_SLAVE_PACKET_CHANGE_SLAVE_STATUS_REQ_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_CHANGE_SLAVE_STATUS_REQ_DATA_T tData;
};

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 106

CC-Link Slave Protocol API


Packet Description

Structure Information CCLINK_SLAVE_PACKET_CHANGE_SLAVE_STATUS_REQ_T


Type: Request
Area

Variable

Type

Value / Range

tHead

Structure TLR_PACKET_HEADER_T

Description

ulDest

UINT32

Destination Queue-Handle of CC-Link Slave-Task


Process Queue

ulSrc

UINT32

Source Queue-Handle of AP-Task Process Queue

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

16

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

0x0000450C

CCLINK_SLAVE_CHANGE_SLAVE_STATUS_REQ Command

ulExt

UINT32

Reserved

ulRout

UINT32

Routing Information

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link Slave-Task

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 107

CC-Link Slave Protocol API

tData

Structure CCLINK_SLAVE_CHANEGE_SLAVE_STATUS_REQ_DATA_T
ulFlags

UINT32

Flags
Bit 0:Parameter fFuseStatus will be evaluated if
this bit is set
Bit 1:Parameter fSwitchChange will be evaluated if
this bit is set
Bit 2:Parameter fWatchdogError will be evaluated
if this bit is set
Bit 3 .. 31: Reserved for further use, set to zero

fFuseStatus

UINT32

This parameter will be evaluated if corresponding bit


in parameter ulFlags is set
FALSE
TRUE

fSwitchChange

This parameter will be evaluated if corresponding bit


in parameter ulFlags is set

UINT32
FALSE
TRUE

fWatchdogError

Fuse status set to ok


Fuse status set to error

UINT32

Switch change status set to no change


Switch change status set to change detected
This parameter will be evaluated if corresponding bit
in parameter ulFlags is set

FALSE
TRUE

Clear watchdog error


Set watchdog error

Table 87: CCLINK_SLAVE_PACKET_CHANGE_SLAVE_STATUS_REQ_T Change CC-Link Slave Status Request

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

The Application Interface 108

Packet Structure Reference


typedef struct CCLINK_SLAVE_CHANGE_SLAVE_STATUS_CNF_DATA_Ttag
CCLINK_SLAVE_CHANGE_SLAVE_STATUS_CNF_DATA_T;
struct CCLINK_SLAVE_CHANGE_SLAVE_STATUS_CNF_DATA_Ttag
{
TLR_UINT32 ulFlags;
TLR_BOOLEAN32 fFuseStatus;
TLR_BOOLEAN32 fSwitchChange;
TLR_BOOLEAN32 fWatchdogError;
};
typedef struct CCLINK_SLAVE_PACKET_CHANGE_SLAVE_STATUS_CNF_Ttag
CCLINK_SLAVE_PACKET_CHANGE_SLAVE_STATUS_CNF_T;
struct CCLINK_SLAVE_PACKET_CHANGE_SLAVE_STATUS_CNF_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_CHANGE_SLAVE_STATUS_CNF_DATA_T tData;
};

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 109

CC-Link Slave Protocol API


Packet Description

Structure Information CCLINK_SLAVE_PACKET_CHANGE_SLAVE_STATUS_CNF_T


Type: Confirmation
Area

Variable

Type

Value / Range

tHead

Structure TLR_PACKET_HEADER_T

Description

ulDest

UINT32

Destination Queue-Handle, untouched

ulSrc

UINT32

Source Queue-Handle, untouched

ulDestId

UINT32

Destination End Point Identifier, untouched

ulSrcId

UINT32

Source End Point Identifier, untouched

ulLen

UINT32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

16

Packet Data Length in bytes


32

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link SlaveTask

0x0000450D

CCLINK_SLAVE_CHANGE_SLAVE_STATUS_CNF Command

ulExt

UINT32

Extension, reserved

ulRout

UINT32

Routing Information, do not change

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 110

CC-Link Slave Protocol API

tData

structure CCLINK_SLAVE_CHNAGE_SLAVE_STATUS_CNF_DATA_T
ulFlags

UINT32

Flags
Bit 0:Parameter fFuseStatus will be evaluates if this
bit is set
Bit 1:Parameter fSwitchChange will be evaluates if
this bit is set
Bit 2:Parameter fWatchdogError will be evaluates if
this bit is set
Bit 3 .. 31: Reserved for further use, set to zero

fFuseStatus

UINT32

This parameter will be evaluated if bit 0 in parameter


ulFlags is set
FALSE
TRUE

fSwitchChange

This parameter will be evaluated if bit 1 in parameter


ulFlags is set

UINT32
FALSE
TRUE

fWatchdogError

Fuse status set to ok


Fuse status set to error

UINT32

Switch change status set to no change


Switch change status set to change detected
This parameter will be evaluated if bit 2 in parameter
ulFlags is set

FALSE
TRUE

Clear watchdog error


Set watchdog error

Table 88: CCLINK_SLAVE_PACKET_CHANGE_SLAVE_STATUS_CNF_T Change CC-Link Slave Status


Confirmation

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 111

CC-Link Slave Protocol API

5.2.8

CCLINK_SLAVE_GET_BUS_PARAM_REQ/CNF Get Bus Parameters

This request can be used in order to get the current bus parameters.
Packet Structure Reference
typedef struct CCLINK_SLAVE_PACKET_GET_BUS_PARAM_REQ_Ttag
CCLINK_SLAVE_PACKET_GET_BUS_PARAM_REQ_T;
struct CCLINK_SLAVE_PACKET_GET_BUS_PARAM_REQ_Ttag
{
TLR_PACKET_HEADER_T tHead;
};

Packet Description
Structure Information CCLINK_SLAVE_PACKET_GET_BUS_PARAM_REQ_T
Type: Request
Area

Variable

Type

Value / Range

tHead

Structure TLR_PACKET_HEADER_T

Description

ulDest

UINT32

Destination Queue-Handle of CC-Link Slave-Task


Process Queue

ulSrc

UINT32

Source Queue-Handle of AP-Task Process Queue

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

0x0000450E

CCLINK_SLAVE_GET_BUS_PARAM_REQ - Command

ulExt

UINT32

Reserved

ulRout

UINT32

Routing Information

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link Slave-Task

Table 89: CCLINK_SLAVE_PACKET_GET_BUS_PARAM_REQ_T Get Bus Parameter Request

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

The Application Interface 112

Packet Structure Reference


typedef struct CCLINK_SLAVE_GET_BUS_PARAM_CNF_DATA_Ttag
CCLINK_SLAVE_GET_BUS_PARAM_CNF_DATA_T;
struct CCLINK_SLAVE_GET_BUS_PARAM_CNF_DATA_Ttag
{
CCLINK_SLAVE_BUS_PARAM_T tBusParam;
CCLINK_SLAVE_ADD_PARAM_T tAddParam;
};
typedef struct CCLINK_SLAVE_PACKET_GET_BUS_PARAM_CNF_Ttag
CCLINK_SLAVE_PACKET_GET_BUS_PARAM_CNF_T;
struct CCLINK_SLAVE_PACKET_GET_BUS_PARAM_CNF_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_GET_BUS_PARAM_CNF_DATA_T tData;
};

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 113

CC-Link Slave Protocol API


Packet Description

Structure Information CCLINK_SLAVE_PACKET_GET_BUS_PARAM_CNF_T


Type: Confirmation
Area

Variable

tHead

Structure TLR_PACKET_HEADER_T

tData

Type

Value / Range

Description

ulDest

UINT32

Destination Queue-Handle, untouched

ulSrc

UINT32

Source Queue-Handle, untouched

ulDestId

UINT32

Destination End Point Identifier, untouched

ulSrcId

UINT32

Source End Point Identifier, untouched

ulLen

UINT32

44

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

ulExt

UINT32

Extension, reserved

ulRout

UINT32

Routing Information, do not change

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link SlaveTask

0x0000450F

CCLINK_SLAVE_GET_BUS_PARAM_CNF - Command

structure CCLINK_SLAVE_GET_BUS_PARAM_CNF_DATA_T
CCLINK_
SLAVE_CFG_
BUS_PARAM_T

See Table 79: CCLINK_SLAVE_CFG_BUS_PARAM_T - Bus Parameter

CCLINK_
SLAVE_CFG_
ADD_PARAM_T

See Table 80: CCLINK_SLAVE_CFG_ADD_PARAM_T - Additional Configuration

Table 90: CCLINK_SLAVE_PACKET_GET_BUS_PARAM_CNF_T Get Bus Parameter Confirmation

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

5.2.9

The Application Interface 114

CCLINK_SLAVE_STATE_CHANGE_IND/RES Change of State


Indication

This indication packet signifies a change of the state of the CC-Link Slave-Task or the CC-Link
network. The indication delivers two important blocks containing status information about the CC-Link
Slave, namely
The slave state
The extended slave state
These blocks delivering information about the change of state are described in detail below.
Note: This indication is used by the AP-Task in order to set status information in the DPM
and will not be routed to the user application.
In order to be able to receive this indication, the CCLINK_SLAVE_REGISTER_REQ/CNF Register
Application request described in section 5.2.2 of this document has to be executed by the AP-Task.
Packet Structure Reference
typedef struct CCLINK_SLAVE_STATE_CHANGE_IND_DATA_Ttag
CCLINK_SLAVE_STATE_CHANGE_IND_DATA_T;
__PACKED_PRE struct CCLINK_SLAVE_STATE_CHANGE_IND_DATA_Ttag
{
CCLINK_SLAVE_SLAVE_STATE_T
tSlaveState;
CCLINK_SLAVE_EXTENDED_STATE_T tExtendedState;
}__PACKED_POST;
typedef struct CCLINK_SLAVE_PACKET_STATE_CHANGE_IND_Ttag
CCLINK_SLAVE_PACKET_STATE_CHANGE_IND_T;
__PACKED_PRE struct CCLINK_SLAVE_PACKET_STATE_CHANGE_IND_Ttag
{
TLR_PACKET_HEADER_T
tHead;
CCLINK_SLAVE_STATE_CHANGE_IND_DATA_T tData;
}__PACKED_POST;

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 115

CC-Link Slave Protocol API


Packet Description

Structure Information CCLINK_SLAVE_PACKET_STATE_CHANGE_IND_T


Type: Indication
Area

Variable

tHead

Structure TLR_PACKET_HEADER_T

tData

Type

Value / Range

Description

ulDest

UINT32

Destination Queue-Handle of AP-Task Process Queue

ulSrc

UINT32

Source Queue-Handle of CC-Link Slave-Task Process


Queue

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

52

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

0x0000451E

CCLINK_SLAVE_STATE_CHANGE_IND - Command

ulExt

UINT32

Reserved

ulRout

UINT32

Routing Information

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link Slave-Task

Structure CCLINK_SLAVE_STATE_CHANGE_IND_DATA_T
tSlaveState

CCLINK_SLAVE_
SLAVE_STATE_T

Structure for slave state, see explanation below.

tExtended
State

CCLINK_SLAVE_
EXTENDED_STATE_T

Structure for extended slave state, see explanation


below.

Table 91: CCLINK_SLAVE_PACKET_STATE_CHANGE_IND_T Change of State Indication

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 116

CC-Link Slave Protocol API


CC-Link Slave State Structure Reference
typedef struct CCLINK_SLAVE_SLAVE_STATE_Ttag
CCLINK_SLAVE_SLAVE_STATE_T;
#define
#define
#define
#define
#define

CCLINK_SLAVE_STATE_FLAG_RDY
CCLINK_SLAVE_STATE_FLAG_RUN
CCLINK_SLAVE_STATE_FLAG_COM
CCLINK_SLAVE_STATE_FLAG_BUS_ON
CCLINK_SLAVE_STATE_FLAG_COMM_ERROR

0x00000001L
0x00000002L
0x00000004L
0x00000008L
0x00000010L

struct CCLINK_SLAVE_SLAVE_STATE_Ttag
{
TLR_UINT32 ulCcLinkState;
TLR_UINT32
TLR_UINT32

ulFlags;
ulErrorCount;

TLR_UINT32
TLR_UINT32
TLR_UINT32

ulCommError;
ulStaLedState;
ulErrLedState;

TLR_UINT32

ulIoByteCnt;

TLR_UINT32
};

aulReserved[3];

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

The Application Interface 117

typedef struct CCLINK_SLAVE_EXTENDED_STATE_Ttag


CCLINK_SLAVE_EXTENDED_STATE_T;
#define CCLINK_SLAVE_EXT_STATE_FLAG_WDG 0x00000001L
#define CCLINK_SLAVE_EXT_STATE_CTRL
0x00000002L
#define CCLINK_SLAVE_EXT_STATE_NRDY
0x00000004L
#define
#define
#define
#define
#define
#define
#define

CCLINK_SLAVE_CCL_MASTER_ST1_MAS_STAT_USER_APP_PRG_MSK
CCLINK_SLAVE_CCL_MASTER_ST1_MAS_STAT_USER_APP_PRG_ERR_CHK_MSK
CCLINK_SLAVE_CCL_MASTER_ST1_REFRESH_STARTUP_MSK
CCLINK_SLAVE_CCL_MASTER_ST1_TRANSIENT_DATA_STATUS_MSK
CCLINK_SLAVE_CCL_MASTER_ST1_TRANSIENT_DATA_RECEPTION_EN_MSK
CCLINK_SLAVE_CCL_MASTER_ST1_PROTOCOL_VERSION_MSK
CCLINK_SLAVE_CCL_MASTER_ST1_MASTER_STATION_TYPE_MSK

0x00000001L
0x00000002L
0x00000004L
0x00000008L
0x00000010L
0x00000060L
0x00000080L

#define CCLINK_SLAVE_CCL_MASTER_ST2_RY_INFO_TRANSMISSION_POINTS_MSK
#define CCLINK_SLAVE_CCL_MASTER_ST2_RWW_INFO_TRANSMISSION_POINTS_MSK

0x00000F00L
0x0000F000L

#define
#define
#define
#define
#define
#define
#define
#define

CCLINK_SLAVE_CCL_SLAVE_ST1_FUSE_STATUS_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_UNIT_ERROR_INVAL_NUM_OF_POINTS_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_NO_REFRESH_RECEIVE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_NO_PARAMETER_RECEIVE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_SWITCH_CHANGE_DETECTION_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_CYCLIC_COMMUNICATION_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_RES1_MSK
CCLINK_SLAVE_CCL_SLAVE_ST1_WDT_ERROR_MSK

0x00000001L
0x00000002L
0x00000004L
0x00000008L
0x00000010L
0x00000020L
0x00000040L
0x00000080L

#define
#define
#define
#define
#define
#define
#define

CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSIENT_DATA_STATUS_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSIENT_DATA_RECEPTION_EN_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSIENT_TYPE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_RES2_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_TRANSMISSION_ROUTE_STATUS_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_RES_FIXED_TO_ONE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_SETTING_MSK

0x00000100L
0x00000200L
0x00000400L
0x00000800L
0x00001000L
0x00002000L
0x0000C000L

#define
#define
#define
#define

CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_SINGLE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_DOUBLE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_QUADRUPLE_MSK
CCLINK_SLAVE_CCL_SLAVE_ST2_EXTENDED_CYCLE_OCTUPLE_MSK

0x00000000L
0x00004000L
0x00008000L
0x0000C000L

__PACKED_PRE struct CCLINK_SLAVE_EXTENDED_STATE_Ttag


{
TLR_UINT32 ulFlags;
TLR_UINT32 ulMasterState;
TLR_UINT32 ulSlaveState;
TLR_UINT32 ulRxByteCount;
TLR_UINT32 ulRWrByteCount;
TLR_UINT32 ulRyByteCount;
TLR_UINT32 ulRWwByteCount;
}__PACKED_POST;

The extended slave state is described in detail in section 3.3.2 Extended Status.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 118

CC-Link Slave Protocol API


Packet Structure Reference

typedef struct CCLINK_SLAVE_PACKET_STATE_CHANGE_RES_Ttag


CCLINK_SLAVE_PACKET_STATE_CHANGE_RES_T;
struct CCLINK_SLAVE_PACKET_STATE_CHANGE_RES_Ttag
{
TLR_PACKET_HEADER_T tHead;
};

Packet Description
Structure Information CCLINK_SLAVE_PACKET_STATE_CHANGE_RES_T
Type: Response
Area

Variable

Type

Value / Range

tHead

Structure TLR_PACKET_HEADER_T

Description

ulDest

UINT32

Destination Queue-Handle of CC-Link Slave-Task


Process Queue

ulSrc

UINT32

Source Queue-Handle of AP-Task Process Queue

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process.
Set to 0 for the Initialization Packet

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

ulExt

UINT32

Extension, reserved

ulRout

UINT32

Routing Information, do not change

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link Slave-Task

0x0000451F

CCLINK_SLAVE_STATE_CHANGE_RES - Command

Table 92: CCLINK_SLAVE_PACKET_STATE_CHANGE_RES_T Change of State Response

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 119

CC-Link Slave Protocol API

5.2.10 CCLINK_SLAVE_SET_WATCHDOG_FAIL_REQ/CNF Set Watchdog


Fail
This packet is used by the AP-Task in order to inform the CC-Link Slave-Task that a watchdog failure
has been detected. The CC-Link Slave-Task stops the communication with the CC-Link network. After
a watchdog error has been set, the slave has to be reinitialized before further communication is
possible.
Note: This packet is used by the AP-Task only and will not be routed from the user
application to the CC-Link slave-Task.

Packet Structure Reference


typedef struct CCLINK_SLAVE_PACKET_SET_WATCHDOG_FAIL_REQ_Ttag
CCLINK_SLAVE_PACKET_SET_WATCHDOG_FAIL_REQ_T;
struct CCLINK_SLAVE_PACKET_SET_WATCHDOG_FAIL_REQ_Ttag
{
TLR_PACKET_HEADER_T tHead;
};

Packet Description
Structure Information CCLINK_SLAVE_PACKET_SET_WATCHDOG_FAIL_REQ_T
Type: Request
Area

Variable

Type

Value / Range

tHead

Structure TLR_PACKET_HEADER_T

Description

ulDest

UINT32

Destination Queue-Handle of CC-Link Slave-Task


Process Queue

ulSrc

UINT32

Source Queue-Handle of AP-Task Process Queue

ulDestId

UINT32

Destination End Point Identifier, specifying the final


receiver of the packet within the Destination Process

ulSrcId

UINT32

Source End Point Identifier, specifying the origin of the


packet inside the Source Process

ulLen

UINT32

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

0x000045AA

CCLINK_SLAVE_SET_WATCHDOG_FAIL_REQ Command

ulExt

UINT32

Reserved

ulRout

UINT32

Routing Information

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link Slave-Task

Table 93: CCLINK_SLAVE_PACKET_SET_WATCHDOG_FAIL_REQ_T Set Watchdog Fail Request

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

The Application Interface 120

CC-Link Slave Protocol API


Packet Structure Reference

typedef struct CCLINK_SLAVE_PACKET_SET_WATCHDOG_FAIL_CNF_Ttag


CCLINK_SLAVE_PACKET_SET_WATCHDOG_FAIL_CNF_T;
struct CCLINK_SLAVE_PACKET_SET_WATCHDOG_FAIL_CNF_Ttag
{
TLR_PACKET_HEADER_T tHead;
};

Packet Description
Structure Information CCLINK_SLAVE_PACKET_SET_WATCHDOG_FAIL_CNF_T
Type: Confirmation
Area

Variable

Type

Value / Range

tHead

Structure TLR_PACKET_HEADER_T

Description

ulDest

UINT32

Destination Queue-Handle, untouched

ulSrc

UINT32

Source Queue-Handle, untouched

ulDestId

UINT32

Destination End Point Identifier, untouched

ulSrcId

UINT32

Source End Point Identifier, untouched

ulLen

UINT32

Packet Data Length in bytes


32

ulId

UINT32

ulSta

UINT32

ulCmd

UINT32

ulExt

UINT32

Extension, reserved

ulRout

UINT32

Routing Information, do not change

0 ... 2 -1

Packet Identification as unique number generated by


the Source Process of the Packet
See section 6.2 Status/Error codes CC-Link Slave-Task

0x000045AB

CCLINK_SLAVE_SET_WATCHDOG_FAIL_CNF
Command

Table 94: CCLINK_SLAVE_PACKET_SET_WATCHDOG_FAIL_CNF_T Set Watchdog Fail Confirmation

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Status/Error Codes Overview 121

CC-Link Slave Protocol API

6 Status/Error Codes Overview


6.1

Status/Error Codes CC-Link APS-Task

Definition / (Value)

Description

TLR_S_OK
(0x00000000)

Status ok

TLR_I_CCLINK_APS_OPEN_DBM_FILE
(0x406B0002)

Failed to open configuration database.

TLR_E_CCLINK_APS_DATASET
(0xC06B0003)

Failed to open configuration dataset.

TLR_E_CCLINK_APS_TABLE_GLOBAL
(0xC06B0004)

Failed to open GLOBAL configuration dataset.

TLR_E_CCLINK_APS_TABLE_CCLS_INI
(0xC06B0005L)

Failed to
dataset.

TLR_E_CCLINK_APS_WATCHDOG_PARAMETER
(0xC06B0006)

Invalid parameter for watchdog supervision.

TLR_E_CCLINK_APS_SIZE_TABLE_CCLS_INI
(0xC06B0007)

Invalid size of CCLS_INI configuration dataset.

TLR_E_CCLINK_APS_DATABASE_FOUND
(0xC06B000A)

Configuration database found.

TLR_E_CCLINK_APS_SLAVE_STATION_
ADDR_PARAMETER
(0xC06B000BL)

Invalid parameter for slave station address.

TLR_E_CCLINK_APS_BAUDRATE_PARAMETER
(0xC06B000CL)

Invalid parameter for baudrate.

TLR_E_CCLINK_APS_NO_STATION_PARAMETER
(0xC06B000D)

Invalid parameter for number of stations.

TLR_E_CCLINK_APS_MODE_PARAMETER
(0xC06B000E)

Invalid parameter for mode.

TLR_E_CCLINK_APS_VENDOR_CODE_
PARAMETER
(0xC06B000F)

Invalid parameter for vendor code.

TLR_E_CCLINK_APS_MODEL_CODE_PARAMETER
(0xC06B0010)

Invalid parameter for model code.

TLR_E_CCLINK_APS_SW_VERSION_PARAMETER
(0xC06B0011)

Invalid parameter for software version.

TLR_E_CCLINK_APS_MODEL_TYPE_PARAMETER
(0xC06B0012)

Invalid parameter for model type.

TLR_E_CCLINK_APS_IO_MODE_PARAMETER
(0xC06B0013)

Invalid parameter for IO mode.

open

CCLS_INI

configuration

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

Status/Error Codes Overview 122

Definition / (Value)

Description

TLR_E_CCLINK_APS_INVALD_STATE
(0xC06B0015)

Request not allowed in current state.

TLR_E_CCLINK_APS_PARAM_CYCLETIME
(0xC06B0016)

Invalid parameter for cycle time.

TLR_E_CCLINK_APS_PARAM_CHN_INSTANCE
(0xC06B0017)

Invalid parameter for DPM instance.

TLR_E_CCLINK_APS_SET_SWITCH_CHANGE_
NOT_ALLOWED
(0xC06B0018)

Change switch state not allowed.

TLR_E_CCLINK_APS_CCLINK_VERSION_
PARAMETER
(0xC06B0019)

Invalid parameter for CC-Link version.

TLR_E_CCLINK_APS_STATION_TYPE_
PARAMETER
(0xC06B001A)

Invalid parameter for station type.

TLR_E_CCLINK_APS_STATION_ADDR_WITH_
NO_STATIONS_PARAMETER
(0xC06B001B)

Invalid parameter for station address in


combination with number of occupied stations.

TLR_E_CCLINK_APS_EXTENSION_CYCLE_
PARAMETER
(0xC06B001C)

Invalid parameter extension cycle.

TLR_E_CCLINK_APS_STATION_TYPE_WITH_
CCLINK_VERSION_PARAMETER
(0xC06B001D)

Invalid parameter for station


combination with CC-Link version.

type

Table 95: Status/Error Codes CC-Link APS-Task

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

in

CC-Link Slave Protocol API

6.2

Status/Error Codes Overview 123

Status/Error codes CC-Link Slave-Task

Definition / (Value)

Description

TLR_S_OK
(0x00000000)

Status ok

TLR_I_CCLINK_SLAVE_ALREADY_IN_STATE
(0xC06A0003)

Slave is already in requested state.

TLR_E_CCLINK_SLAVE_DATA_COUNT
(0xC06A0005)

Invalid data count.

TLR_E_CCLINK_SLAVE_DATA_OFFSET
(0xC06A0006)

Invalid data offset.

TLR_E_CCLINK_SLAVE_INIT_BUFFER
(0xC06A0007)

Initialization of buffer failed.

TLR_E_CCLINK_SLAVE_INVALID_STATE
(0xC06A0008)

Command is not allowed in current state.

TLR_E_CCLINK_SLAVE_MODE
(0xC06A0009)

Invalid mode in command.

TLR_E_CCLINK_SLAVE_PARAM_BAUDRATE
(0xC06A000A)

Invalid Baudrate.

TLR_E_CCLINK_SLAVE_PARAM_STATION_ADDR
(0xC06A000B)

Invalid station address for CC-Link Slave.

TLR_E_CCLINK_SLAVE_PARAM_NO_STATIONS
(0xC06A000C)

Invalid parameter for number of stations.

TLR_E_CCLINK_SLAVE_PARAM_VENDOR_CODE
(0xC06A000D)

Invalid parameter for vendor code.

TLR_E_CCLINK_SLAVE_PARAM_MODEL_CODE
(0xC06A000E)

Invalid parameter for model code.

TLR_E_CCLINK_SLAVE_PARAM_SW_VERSION
(0xC06A000F)

Invalid parameter for software version.

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

CC-Link Slave Protocol API

Status/Error Codes Overview 124

TLR_E_CCLINK_SLAVE_PARAM_MODEL_TYPE
(0xC06A0010)

Invalid parameter for model type.

TLR_E_CCLINK_SLAVE_PARAM_STATION_TYPE
(0xC06A0011)

Invalid parameter for station type.

TLR_E_CCLINK_SLAVE_PARAM_CYCLETIME
(0xC06A0012)

Invalid parameter for cycle time.

TLR_E_CCLINK_SLAVE_PARAM_XC_INSTANCE
(0xC06A0013)

Invalid parameter for XC-Instance.

TLR_E_CCLINK_SLAVE_PARAM_STATION_
ADDR_WITH_NO_STATIONS
(0xC06A0014)

Invalid parameter for station address in


combination with number of occupied stations.

TLR_E_CCLINK_SLAVE_PARAM_CCLINK_
VERSION
(0xC06A0015)

Invalid parameter for CC-Link version.

TLR_E_CCLINK_SLAVE_PARAM_EXTENSION_
CYCLE
(0xC06A0016)

Invalid parameter for extension cycle.

TLR_E_CCLINK_SLAVE_PARAM_STATION_
TYPE_WITH_CCLINK_VERSION
(0xC06A0017)

Invalid parameter for station


combination with CC-Link version.

type

Table 96: Status/Error Codes CC-Link Slave-Task

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

in

Contact 125

CC-Link Slave Protocol API

7 Contact
Headquarters
Germany
Hilscher Gesellschaft fr
Systemautomation mbH
Rheinstrasse 15
65795 Hattersheim
Phone: +49 (0) 6190 9907-0
Fax: +49 (0) 6190 9907-50
E-Mail: info@hilscher.com

Support
Phone: +49 (0) 6190 9907-99
E-Mail: de.support@hilscher.com

Subsidiaries
China
Hilscher Ges.f.Systemaut. mbH
Shanghai Representative Office
200010 Shanghai
Phone: +86 (0) 21-6355-5161
E-Mail: info@hilscher.cn

Support
Phone: +86 (0) 21-6355-5161
E-Mail: cn.support@hilscher.com

France
Hilscher France S.a.r.l.
69500 Bron
Phone: +33 (0) 4 72 37 98 40
E-Mail: info@hilscher.fr

Support
Phone: +33 (0) 4 72 37 98 40
E-Mail: fr.support@hilscher.com

India
Hilscher India Pvt. Ltd.
New Delhi - 110 025
Phone: +91 9810269248
E-Mail: info@hilscher.in

Japan
Hilscher Japan KK
Tokyo, 160-0022
Phone: +81 (0) 3-5362-0521
E-Mail: info@hilscher.jp

Support
Phone: +81 (0) 3-5362-0521
E-Mail: jp.support@hilscher.com

Switzerland
Hilscher Swiss GmbH
4500 Solothurn
Phone: +41 (0) 32 623 6633
E-Mail: info@hilscher.ch

Support
Phone: +49 (0) 6190 9907-99
E-Mail: ch.support@hilscher.com

USA
Hilscher North America, Inc.
Lisle, IL 60532
Phone: +1 630-505-5301
E-Mail: info@hilscher.us

Support

Italy
Hilscher Italia srl
20090 Vimodrone (MI)
Phone: +39 02 25007068
E-Mail: info@hilscher.it

Phone: +1 630-505-5301
E-Mail: us.support@hilscher.com

Support
Phone: +39 / 02 25007068
E-Mail: it.support@hilscher.com

Hilscher Gesellschaft fr Systemautomation mbH Rheinstr. 15 D-65795 Hattersheim


Edition 4 API:CC-Link Slave Protocol API#EN 2009/01

Das könnte Ihnen auch gefallen