Citect For Windows Driver Specification Klöckner Moeller PS316/PS416 and PS4200 Drivers
Citect For Windows Driver Specification Klöckner Moeller PS316/PS416 and PS4200 Drivers
Driver Specification
Klöckner Moeller PS316/PS416 and PS4200 Drivers
Contents
1. INTRODUCTION 5
1.1 Scope. 5
1.2 Outline. 5
2. QA 6
2.1 Developers Guidelines 6
2.1.1 Accredited Drivers. 6
2.1.2 Independent Drivers. 6
4. PROTOCOL REQUIREMENTS 12
4.1 Introduction 12
4.2 Initialising the Board 12
4.3 Initialising the Port 12
4.4 Initialising the IO Device 12
4.5 IO Device Online Test 12
4.6 State Flow Description 12
4.7 Message Structure 12
4.8 Data Format 13
4.9 Check Sum 13
KLOCMOEL.DOC 18/07/2003 2
Driver Design Specification
5. USER INTERFACE 14
5.1 Introduction 14
5.2 Driver Name 14
5.3 Boards Form Error! Bookmark not defined.
5.3.1 Board Type Error! Bookmark not defined.
5.3.2 Address Error! Bookmark not defined.
5.3.3 IO Port Error! Bookmark not defined.
5.3.4 Interrupt Error! Bookmark not defined.
5.3.5 Special Opt Error! Bookmark not defined.
6. BASIC TESTING 17
6.1 Introduction 17
6.2 Procedure 17
7. PERFORMANCE TESTING 18
7.1 Introduction 18
7.2 Calculating the Blocking Constant 18
KLOCMOEL.DOC 18/07/2003 3
Driver Design Specification
KLOCMOEL.DOC 18/07/2003 4
Driver Design Specification
1. Introduction
1.1 Scope.
This document follows the development of the new driver. It serves as a functional specification, design
specification and test specification.
1.2 Outline.
Section 1 - Introduction.
This section defines the scope of a board driver specification and outlines the items addressed
by the specification.
KLOCMOEL.DOC 18/07/2003 5
Driver Design Specification
2. QA
These guidelines are meant as a rough indication of what options there are for developing Citect drivers
and the advantages of these options. It is not a technical discussion of options, rather a marketing
guideline.
KLOCMOEL.DOC 18/07/2003 6
Driver Design Specification
2 Specification reviewed and accepted by Ci Technologies Driver Development. Bruce Kinchin 17-3-98
7 Documentation is written.
8 Documentation reviewed.
10a Review for completeness by developer, tester, documenter and CIT Driver
Development
The hand over of a driver requires that all the above steps are completed and checked off.
KLOCMOEL.DOC 18/07/2003 7
Driver Design Specification
3.1 Introduction
This section defines the types of I/O Devices that are targeted by this driver.
PS416 Communications.
The PS416 is connected to the CITECT PC via the programming port on the PLC. This port is known as
the PRG interface. The PRG Interface can be set as an RS232 or RS485 interface according to the
application at hand.
PS316 Communications.
The programming port of the PLC is a RS485 port. The CITECT PC can be connected to the
programming port of the PLC by means of a RS232 to RS485 converter.
PS 4200 Communications.
The programming port of these PLCs is a RS232 port. The CITECT PC can be connected to the
programming port of the PLC.
Interface Parameters:
The interface parameters for the PLC are set up via the Klöckner Moeller programming software.
KLOCMOEL.DOC 18/07/2003 8
Driver Design Specification
Pin assignments
The table below shows the pin assignments for the programming port of each PLC.
TX 2 2 RxD
RX 3 3 TxD
RTS 4 4 SGn
CTS 5 D CONNECTOR
9 WAY - FEMALE
DSR 6
SG 7
DCD 8
D CONNECTOR
25 WAY - FEMALE
KLOCMOEL.DOC 18/07/2003 9
Driver Design Specification
TB 7 TB/RB
RA
RB
TB 4 TB/RB
RA
RB
TX 2 2 RxD
RX 3 6 TxD
RTS 4 3 SGnd
CTS 5 D CONNECTOR
9 WAY - FEMALE
DSR 6
SG 7
DCD 8
D CONNECTOR
25 WAY - FEMALE
KLOCMOEL.DOC 18/07/2003 10
Driver Design Specification
Address Switch
1 2 3 4 5 6 7 8
1 1 0 0 0 0 0 0 0
2 0 1 0 0 0 0 0 0
3 1 1 0 0 0 0 0 0
4 0 0 1 0 0 0 0 0
5 1 0 1 0 0 0 0 0
6 0 1 1 0 0 0 0 0
7 1 1 1 0 0 0 0 0
8 0 0 0 1 0 0 0 0
9 1 0 0 1 0 0 0 0
10 0 1 0 1 0 0 0 0
11 1 1 0 1 0 0 0 0
12 0 0 1 1 0 0 0 0
13 1 0 1 1 0 0 0 0
14 0 1 1 1 0 0 0 0
15 1 1 1 1 0 0 0 0
16 0 0 0 0 1 0 0 0
17 1 0 0 0 1 0 0 0
18 0 1 0 0 1 0 0 0
19 1 1 0 0 1 0 0 0
20 0 0 1 0 1 0 0 0
21 1 0 1 0 1 0 0 0
22 0 1 1 0 1 0 0 0
23 1 1 1 0 1 0 0 0
24 0 0 0 1 1 0 0 0
25 1 0 0 1 1 0 0 0
26 0 1 0 1 1 0 0 0
27 1 1 0 1 1 0 0 0
28 0 0 1 1 1 0 0 0
29 1 0 1 1 1 0 0 0
30 0 1 1 1 1 0 0 0
31 1 1 1 1 1 0 0 0
The Klockner Moeller protocol will not allow a SCADA to communicate directly with the inputs or
outputs. Thus CITECT can only communicate with the vaiable registers called Marker words. Because of
this the PLC must be programmed so that I/O addresses that need to be addressed by CITECT must be
mapped to Marker words (M words)
KLOCMOEL.DOC 18/07/2003 11
Driver Design Specification
4. Protocol Requirements
4.1 Introduction
On tick and if the communication’s state is idle the driver will send a Read or Write request. Once a
request is sent the DCB is removed from the input queue and placed on an output queue.
The state of the receive buffer on the communications port is checked and the port interrupt will pass the
control to the driver if new data is received. If a message is received it will be checked and compared
with the DCB from the output queue. If this message is the response to the request in the DCB, the
DCB’s buffer is filled with the received data and posted back to Citect.
STX User No. Control Byte Start Add. Start Add. End Add. End Add. LRC
MSB LSB MSB LSB
Where:
STX = 0Xc
User No =0
Control Byte = 0x82 – Read Request
= 0x83 – Write Request
Start Address = The start address of the Marker block to be read
End Address = The end address of the Marker block to be read
LRC = Longitudinal Redundancy Check
KLOCMOEL.DOC 18/07/2003 12
Driver Design Specification
STX User No. Control Byte No. of Data Byte Data Byte Data Byte LRC
Bytes 1 ………… n
Where:
STX = 0Xc
User No =0
Control Byte = 0x14 – Data Block
No. of Bytes = The number of data bytes in the message ( must be an even number)
Data Byte x = The actual data in the message
LRC = Longitudinal Redundancy Check
KLOCMOEL.DOC 18/07/2003 13
Driver Design Specification
5. User Interface
5.1 Introduction
This section defines how the user will see the driver. This relates directly to how the Citect forms need
to be filled out and any special INI options. For the kernel, the debugs trace messages and the
Stats.Special counters are documented.
5.3.2 Address
0
5.3.3 IO Port
BLANK
5.3.4 Interrupt
BLANK
5.4.4 Parity
No parity only
KLOCMOEL.DOC 18/07/2003 14
Driver Design Specification
5.5.1 Protocol
Klockl316 for the PS316 PLC
Klock416 for the PS416 PLC
Klock4200 for the PS4200 PLC
5.5.2 Address
The address of the IO unit . See section 3.5.2 for address settings on the PLC
Where:
Xxx Where xxx denotes an internal memory register called a Marker. In the PS416 and
PS316 xxx is a number from 0 to 2172 . In the PS4200, xxx must be a even number
between 0 and 4096.
Zz Is a number from 0 to 15 denoting the specific bit of the internal marker xxx.
5.8 PROTDIR.DBF
KLOCMOEL.DOC 18/07/2003 15
Driver Design Specification
KLOCMOEL.DOC 18/07/2003 16
Driver Design Specification
KLOCMOEL.DOC 18/07/2003 17
Driver Design Specification
6. Basic Testing
6.1 Introduction
The programmer will perform a minimum level of testing, which is outlined here.
A sample Project is available which can be used as a starting point for the programmer’s test Project.
When the programmer has completed basic testing and debugging this Project should by backed up
and supplied to the Citect Testing department.
6.2 Procedure
Basic testing should cover the following points:
• On startup the IO Device comes online without errors.
• The driver supports IO Devices of addresses as documented in the specification.
• The driver reports the IO Device offline when the IO Device is a) powered down, b) disconnected.
• The driver will re-establish communication with the IO Device after a) power cycle, b) disconnection/
reconnection.
• Confirm that retries (if supported) and error reporting operate correctly.
• The driver reads all the device data types documented as readable in this specification.
• The driver writes to all the device data types documented as write-able in this specification.
• The driver reads and writes all data formats supported by the protocol, ie. DIGITAL, INT, LONG,
REAL, BCD, LONG_BCD.
• Test the limit of the IO Devices request size, this should be done for at least DIGITAL and an INT
data formats.
• Let the driver run over night and check that no retries or other errors have occurred.
• If a multi-drop or network protocol and if the hardware is available then the protocol should be tested
with more than one IO Device connected.
\\SYD-FILE1\DATA1\CITECT\DRIVERS\SPEC\Klock Testing.doc
KLOCMOEL.DOC 18/07/2003 18
Driver Design Specification
7. Performance Testing
7.1 Introduction
This section outlines the tests, which give some indication of the driver’s performance. The programmer
needs to perform these tests since the results feed back into the Constants structure and the
PROTDIR.DBF.
{50% of maximum}
{75% of maximum}
{maximum}
From these results the overhead and rate are determined and the ideal blocking constant is calculated
Overhead [mS] =
Word Rate [words / mS] =
Blocking constant [words] =
Note that the calculated blocking constant must now be set by the programmer in the Constants
structure (the Block field) in bytes and in the PROTDIR.DBF (the BIT_BLOCK field) in bits.
KLOCMOEL.DOC 18/07/2003 19
Driver Design Specification
8.1 References
SUCOM-A Protocol Description © Klöckner Moeller
8.2 Contacts
Technical information:
Xycom South Africa
+27 11 462-6671
FAX +27 11 462-5159
EMAIL [email protected]
KLOCMOEL.DOC 18/07/2003 20