Professional Documents
Culture Documents
User Manual: Controller Board Driver Software For Siemens SIMATIC S7-300
User Manual: Controller Board Driver Software For Siemens SIMATIC S7-300
User Manual: Controller Board Driver Software For Siemens SIMATIC S7-300
Revision: B
Order No.: 27 45 30 5
5454B
Please Observe the Following Notes:
In order to guarantee the safe use of your device, we recommend that you
read this manual carefully. The following notes give you information on
how to use this manual.
The note symbol informs you of conditions that must strictly be observed
to achieve error-free operation. It also gives you tips and advice on hard-
ware and software optimization to save you extra work.
The text symbol refers you to detailed sources of information (manuals,
data sheets, literature, etc.) on the subject matter, product, etc. This text
also provides helpful information for the orientation in the manual.
5454B
IBS S7 300 BC SWD UM E
Internet
Up-to-date information on products from Phoenix Contact can be found on
the Internet at www.phoenixcontact.com.
5454B
Table of Contents
5454B i
IBS S7 300 BC SWD UM E
ii 5454B
Chapter 1
This section informs you about
– The advantages of using INTERBUS system functions
– The three types of INTERBUS driver blocks
– The option of controlling INTERBUS via these blocks
5454B 1-1
1-2 5454B
Driver Software Tasks
5454B 1-3
IBS S7 300 BC SWD UM E
1-4 5454B
Chapter 2
This section informs you about
– INTERBUS system functions, which can be used to start up and control
INTERBUS
– Parameter information, which is required to use function blocks
successfully within a specific call structure
5454B 2-1
2-2 5454B
Description of the Function Blocks
5454B 2-3
IBS S7 300 BC SWD UM E
2-4 5454B
Description of the Function Blocks
The IBSWD010 directory includes all driver blocks for the controller board
and a STEP 7 project file (IBSWD010.S7P).
Open the text files for the blocks (…TXT) and the README.TXT file by
double clicking on them.
5454B 2-5
IBS S7 300 BC SWD UM E
2-6 5454B
Description of the Function Blocks
Call structure
O B 1 0 0 F C 2 0
IB _ IN I IB D B
O B 1 F B 2 1
IB _ R E A D IB D B
IB D B
F B 2 4
IB _ D IA G
D ID B
A p p lic a tio n
p r o g r a m
F B 2 2
IB _ W R IT E IB D B
5 4 5 4 A 0 0 1
Key:
IBDB = INTERBUS data block
DIDB = Diagnostic data block
5454B 2-7
IBS S7 300 BC SWD UM E
2.3.1 FC 20 IB_INI
Task The initialization function IB_INI (FC 20) is called during control system
startup (OB 100) and synchronizes the control system with the controller
board. FC 20 waits until the controller board is ready to operate (READY &
RUN).
READY = Controller board is ready to operate
RUN = Data transmission is active
The CPU checks whether the number of connected input bytes
(IN_BYTES) and output bytes (OUT_BYTES) corresponds to the number
entered.
FC IB_INI transfers the data required by other function blocks to the IBDB
INTERBUS data block.
If an error occurs, the function is exited. The ERR parameter indicates an
error code <> 0. In the example program, the control system is set to the
STOP state.
If INTERBUS is started without any errors, ERR = 0.
Parameter descrip- IB_ADR Slot address of the controller board (in the example row 0,
tions slot 6, slot address 288)
Valid entries: see table "Slot addresses in the control
system (PLC)" on page 2-9, and entry in the hardware
configuration under STEP 7.
IBDB Global INTERBUS data block to be set by the user with a
length of 12 data words. (In the example DB 20)
Valid entries: can be freely selected depending on the
CPU
2-8 5454B
Description of the Function Blocks
TIME Number of the timer used by FC. (In the example T1)
Valid entries: can be freely selected depending on the
CPU
IN_BYTES Number of connected input bytes. (In the example 14)
Valid entries: 0 to 240
OUT_BYTES Number of connected output bytes. (In the example 14)
Valid entries: 0 to 240
ERR The output of the driver block returns the error code of the
function.
Enter the slot address of the board in the IB_ADR parameter and the num-
ber of IN_BYTES and OUT_BYTES in the corresponding parameters.
For the number of IN_BYTES and OUT_BYTES, please refer to the
IBS SWT G4 E software or the information register of the controller board.
For additional information, please refer to the Quick Start Guide
IBS S7 300 BC QS UM E.
Slot assignment The following table describes the valid addresses for the IB_ADR parame-
ter. The addresses depend on the controller board slot in a S7-300 control
system.
Slot Slot
Address
4 5 6 7 8 9 10 11
Row 3 640 656 672 688 704 720 736 752
Row 2 512 528 544 560 576 592 608 624
Row 1 384 400 416 432 448 464 480 496
Row 0 256 272 288 304 320 336 352 368
5454B 2-9
IBS S7 300 BC SWD UM E
ERR parameter The following table describes the error codes of the ERR parameter in the
(error code) MB 9 bit memory byte.
2-10 5454B
Description of the Function Blocks
2.3.2 FB 21 IB_READ
Task The IB_READ function block reads the controller board input data at the
beginning of a program cycle (OB 1). The destination area of the data can
be specified by the user with the DEST parameter.
The SFC 59 "RD_REC" system block is called in this block and the ERROR
parameter displays its error code. A Phoenix Contact error code in the low
byte of this parameter (MB 13) is indicated by "FF" in the high byte (MB 12).
The error code is described in the table "Error Codes in Bit Memory Word
12 (MW 12)" on page 2-13 .
Parameter descrip- IBDB Global INTERBUS data block to be set with a length of 12
tions data words.
COPY_OK With the value "1", the read data is declared as valid.
(This parameter is written by FB.)
ERROR The output of the driver returns the error code.
(See table "Error Codes in Bit Memory Word 12 (MW 12)"
on page 2-13.)
DEST Pointer to the memory area to be written.
(I 10.0 corresponds to the start address, BYTE 10
corresponds to the data length.)
The data length entry for the DEST parameter must be four when
"IN_BYTES < 4". When "IN_BYTES = 4" or higher, the entry should be in-
creased accordingly.
Examples: IN_BYTES = 2 => BYTE 4
IN_BYTES = 5 => BYTE 5
IN_BYTES = 14 => BYTE 14
5454B 2-11
IBS S7 300 BC SWD UM E
In addition to the process image you can also specify bit memories and
data blocks as memory areas.
Example: 10 bytes from address 10.0 are to be transferred to different ad-
dress areas.
The following table describes the syntax of entries for the DEST parameter.
The following table describes the valid destination areas for the input data
in the control system (PLC).
The size of the address areas and the maximum data length depends on
the CPU used.
2-12 5454B
Description of the Function Blocks
ERROR parameter The following table describes the error codes of the ERROR parameter,
(error codes) which are indicated in the MW 12 bit memory word.
2 .4
1 .4
1 0 0 2 4 0 IN _ B y te s
5 4 5 4 B 0 0 4
Figure 2-2 FB 21 IB_READ time response
5454B 2-13
IBS S7 300 BC SWD UM E
2.3.3 FB 22 IB_WRITE
Task At the end of a program cycle (OB 1), the IB_WRITE function block trans-
fers the output data to the controller board. The source of the data can be
specified by the user with the SOURCE parameter.
The SFC 58 "WR_REC" system block is called in this block and the
ERROR parameter displays its error code. A Phoenix Contact error code
in the low byte of this parameter (MB 15) is indicated by "FF" in the high
byte (MB 14). The error code is described in the table "Error Codes in Bit
Memory Word 14 (MW 14)" on page 2-16 .
Parameter descrip- IBDB Global INTERBUS data block to be set with a length of 12
tions data words.
CONS With the value "1", the output and input data is consistently
written or read in an INTERBUS cycle. This also applies to
FB IB_READ.
With the value "0", output and input data is transferred with
byte consistency. In the current cycle, a byte from the
previous cycle can still be transmitted.
Consistency should only be set if your application requires
it because it increases the response time of the
application.
COPY_OK With the value "1" the data is transmitted. (This parameter
is written by FB.)
ERROR The output of the driver returns the error code. (See table
"Error Codes in Bit Memory Word 14 (MW 14)" on
page 2-16.)
2-14 5454B
Description of the Function Blocks
The data length entry for the SOURCE parameter must be four when
"OUT_BYTES < 4". When "OUT_BYTES = 4" or higher, the entry should
be increased accordingly.
Example: OUT_BYTES = 2 => BYTE 4
OUT_BYTES = 5 => BYTE 5
OUT_BYTES = 14 => BYTE 14
In addition to the process image you can also specify bit memories and
data blocks as memory areas.
Example: 10 bytes from address 10.0 are to be transferred to different ad-
dress areas.
The following table describes the syntax of entries for the SOURCE param-
eter.
The following table describes the valid source areas for the output data in
the control system (PLC).
The size of the address areas and the maximum data length depends on
the CPU used.
5454B 2-15
IBS S7 300 BC SWD UM E
ERROR parameter The following table describes the error codes of the ERROR parameter,
(error codes) which are indicated in the MW 14 bit memory word.
2 .4
1 .4
1 0 0 2 4 0 O U T _ B y te s
5 4 5 4 A 0 1 0
Figure 2-3 FB 22 IB_WRITE time response
2-16 5454B
Description of the Function Blocks
2.3.4 FB 24 IB_DIAG
5454B 2-17
IBS S7 300 BC SWD UM E
Parameter descrip- IBDB Global INTERBUS data block to be set by the user with a
tions length of 12 data words.
DIDB Number of a diagnostic data block, to be set by the user.
Activate This parameter is controlled by a button, which must be
connected externally and acknowledges an existing error.
In the event of a bus error, the INTERBUS system is
restarted. In the event of a peripheral fault or user error,
the diagnostic display is updated.
AutoStart = 1: In the event of an error, the function of bit 0 or 2 of the
standard function start register is automatically activated.
If the error cannot be removed, bits 0 or 2 are re-activated
at preset intervals (DW 2, see "Description of the "DIDB"
Data Block:" on page 2-20).
= 0: Only the "Activate" parameter can be used to activate
the function of bits 0 or 2.
RUN = 1: INTERBUS is in the "RUN" state.
= 0: INTERBUS is in the "STOP" state.
PF = 1: INTERBUS is indicating a peripheral fault. The error
location (device number) is stored in the diagnostic
parameter register.
= 0: INTERBUS is not indicating a peripheral fault.
2-18 5454B
Description of the Function Blocks
5454B 2-19
IBS S7 300 BC SWD UM E
2-20 5454B
Chapter 3
This section informs you about
– The technical data for the driver blocks
5454B 3-1
3-2 5454B
Technical Data for the Driver Functions
5454B 3-3
IBS S7 300 BC SWD UM E
3-4 5454B
Appendix A
A 1 Table of Figures
5454B A-1
Table of Figures
A-2 5454B
Appendix A
A 2 List of Tables
5454B A-3
List of Tables
A-4 5454B
Appendix A
A 3 Index
B Description......................................... 2-3
FB 21 IB_READ............................... 2-11
Base address
FB 22 IB_WRITE ............................. 2-14
Slot assignment ................................. 2-9
FB 24 IB_DIAG................................ 2-17
D FC 20 IB_INI...................................... 2-8
DIDB
I
Data word assignment ..................... 2-20
Driver software Input data
5454B A-5
Index
A-6 5454B
We Are Interested in Your Opinion!
We would like to hear your comments and suggestions concerning this
document.
Please fill out the form on the following page and fax it to us or send your
comments, suggestions for improvement, etc. to the following address:
5050df17
FAX Reply
Phoenix Contact GmbH & Co. KG Date:
Marketing Services
Dokumentation INTERBUS Fax No: +49 - (0) 52 35 - 3-4 20 66
From:
Company: Name:
Department:
Address: Job function:
City, ZIP Phone:
code:
Country: Fax:
Document:
Designation: Revision: Order No.:
Other Comments:
5050df17