Home
Display - Siemens
Contents
1. IC NNI 1 aC Parameter block number and 0 f memory submodule Identifier for Interpretive ASCII with message texts mode plugged in Without memory submodule End of text character 1 ASCII character No end of text character End of text character 2 ASCII character No end of text character E Character delay time 0001 to OBB8 0001 100 ms Message length in bytes 0000 to 0100 4 HO 645 H H H d oD Carriage return GWA 4NEB 812 6030 02b A 11 Summary CP 521 A 5 Slot Addressing A 6 Status Messages and Error Messages o o pem LLL ee T TI T RN ENCORE EONLTTTICTTTCIE NNNM o emro X Coordination information only after job Coordinate data transfer Data transfer CP 521 CPU X Signal state for the other half byte not relevant A 12 GWA 4NEB 812 6030 02b CP 521 Summary A 7 Typical Printouts of the KFa b Data Format 33 3 256 32767 32767 25 6 3276 7 3276 7 0 1 2 6 2 6 327 7 327 7 0 0 0 3 0 3 32 8 32 8 0 0 0 0 0 0 3 3 3 3 0 0 0 0 0 0 0 0 0 3 0 3 0 07 0 07 2 56 2 56 327 67 327 67 0 01 0 01 0 26 0 26 32 77 32 77 0 00 0 00 0 03 0 03 3 28 3 28 0 00 0 00 0 00 0 00 0 33 0 33 0 007 0 007 0 256 0 256 32 767 32 767 0 001 0 001 0 026 0 026 3 277 3 277 0 000 0 000 0 003 0 003 0 328 0 328 0 0007 0 0007 0 0256 0 0256 3 2767 0 2767 0 0001 0 0001 0 0026 0 0026 0 3277 0 3277 0 00007 0 00007 0 00256 0 00256 0 32767 0 32767 Every fixed po
2. 0 0c cece eee eee eee 7 7 4 2 Receiving Messages 0000 c eee eee eee eee FL 7 5 CPU Job Requests and CP Error Messages in ASCIIMode l ec y rrr eee 1 7 5 1 Permissible Job Requests in ASCII Mode 7 7 5 2 Illegal Jobs with Error Messages sess 7 7 5 3 Further Error Messages 00 cece ene eee 7 GWA 4NEB 812 6030 02b Job Transfer and Error Evaluation 04 7 6 Schematic for Entering Parameter Blocks in DB 1 7 14 Sequence Schematic for Sending Data 7 22 Sequence Schematic when Receiving Data 7 41 7 1 7 2 7 3 7 4 7 5 7 6 Parameter Blocks in ASCII Mode PIQ for the Transfer the Parameter setting data for parameter block 0 Job PIQ for the Transfer the parameter setting data for parameter block 2 Job PIQ for the Transfer the parameter setting data for parameter block 7 Job Print Mode PIQ for the Transfer the parameter setting data for parameter block 7 Job Transparent ASCII Mode PIQ for the Transfer the parameter setting data for parameter block 7 Job Interpretive ASCII Mode Assignments for Parameter Block O Assignments for Parameter Block 2 Assignments for Parameter Block 7 Transparent ASCII Mode Assignments for Parameter Block 7 Interpretive
3. A 12 Typical Printouts of the KFa b Data Format A 13 GWA 4NEB 812 6030 02b A 1 PIQ for Job Transfer Parameter Setting Data for Parameter Block O 0 PIQ for Job Transfer Parameter Setting Data for Parameter Block 2 illus PIQ for Job Transfer Parameter Setting Data for Parameter Block 7 Print Mode PIQ for Job Transfer Parameter Setting Data for Parameter Block 7 Transparent ASCII Mode PIQ for Job Transfer Parameter Setting Data for Parameter Block 7 Interpretive ASCII Mode bu xeu ers A 9 EET A 10 aeons A 10 bus es A 11 b Er A 11 GWA 4NEB 812 6030 02b Lv eig moq 68 00 puooeg A 9 qeueA 68 00 eig ufiH einuiN 9 eig 01 wd 26 18 2 00 ure zL 10 c 9 qeueA JnoH S 66 00 eg uDiH 189A v eig wo ci L0 yuon 9 qeueA L 10 feq eig ufiH yew10 dog e H44 10 sum s H43 10 Jequinu 470 40 ON aBessop abeg Aepyaon L OZ 09 09 0c 00 0 Joynq poe oDesseui eui peoj Jequinu jue 9ja eig S X9 P 1ulad eieleg obed 1x9 1ndino oDed jas 3920J2 19S jou ejeg indino Old sqor ndO VY Jejoejeuo 1xei Jo pu43 Jojoejeuo 1x9 jo pu43 uO H0 yeys L laaqas 0 804 yewo sayoeseyuo HooLo 1Xe1o pu3 o H000 JejoeJeuo 1xe1 j0 pu3 uiBue ssa P0010 Heggo 01 pi H0000 H0000 440X uiBue ssey euin ej q NOX qof e4d481u Jedsu
4. 2 5 2 5 1 Slot Addresses leeeeeeeee ee 5 8 GWA 4NEB 812 6030 02b CP 521 Principle of Operation and Addressing 5 Principle of Operation and Addressing This section describes how the CPU monitors the data traffic of the CP 521 and how the printer output module is addressed 5 1 Monitoring of the CP 521 by the CPU Every data interchange between the CP 521 and the CPU must be started by the CPU sending a job to the CP 521 The CPU controls the operations of the CP 521 as follows Print mode In print mode the CP 521 outputs messages to a printer autonomously when instructed to do so by the CPU The program continues to run independently of message text output The CPU receives data from the CP 521 on the status of the CP 521 and the printer In addition the CP 521 tells the CPU if it can handle the jobs requested by the CPU ASCII mode In this mode the CP 521 enables the exchange of data between the CPU and a peripheral device The CPU reads data from the CP 521 into the PII and instructs the CP 521 to pass on data to a terminal device terminal keyboard etc or to another CP 521 GWA 4NEB 812 6030 02b 5 1 Principle of Operation and Addressing CP 521 Memory sub module ORE ae PIQ Terminal device or CP 521 Figure 5 1 General Functional Description The control program controls the CP 521 via the I O bus and evaluates its data The I O bus transfers 64 data b
5. RS 232 C V 24 interface 7 data bits Handshake OFF D OcOo oc0o00 lI parameter block 7 Parameters for waiting times parameter block 1 Not significant since XON XOFF protocol should be used XON XOFF protocol parameter block 2 XONcharacter DC 1 114 XOFF character DC 3 134 e Configuration data for entering message texts No change with respect to default values e Configuration data for message text printout Time of day and date unchanged with respect to default values parameter block 4 Page format 64 lines page parameter block 5 10 characters left margin Page number bottom Header Test operation Footer laboratory parameter block 6 Setting the operating mode parameter block 7 Not significant 6 16 GWA 4NEB 812 6030 02b CP 521 Print Mode DB 1 is called up on the programmer Enter the values Add comments to make the entries more readily understood KS Parameters for the serial interface 0600100 XON XOFF protocol M 1113 Message text printout EO 400A U Headers and footers 6K1 Test operation F1 Laboratory GWA 4NEB 812 6030 02b Block separator Parameter block 0 2400 Baud Even parity No BUSY RS 232 C V 24 interface 7 data bits Handshake OFF Block separator Parameter block 2 XON character DC1 XOFF character DC3 Block separator P
6. 6 4 5 Place Holders for Variables If you have configured up to three dummy characters for variables in a message text you must specify the variables in bytes 2 to 7 in the Print message text job e Bytes2and3 Value ofthe 1st variable data format as configured e Bytes4and5 Value of the 2nd variable data format as configured e Bytes6and7 Value of the 3rd variable data format as configured The place holder is replaced by the variable at printout e f the message text contains more than three place holders for variables they are not interpreted as place holders but printed out as text f a place holder is wrongly configured it is also treated as text and printed out e When place holders are replaced by the appropriate values the total length may be greater than 80 characters e The first place holder for variables configured in the message text is replaced by variable 1 the second is replaced by variable 2 and the third by variable 3 You must specify the data format in which the variable has been transferred from the CPU for the place holder 6 28 GWA 4NEB 812 6030 02b CP 521 Print Mode Table 6 9 Data Formats for Variables Constant Bit pattern 16 bits Constant Hexadecimal 0000 to FFFFy pattern KC KS Constant Alphanumeric 20 to 7F 20 to characters 7Fuy KT Constant Timebase 1 0 to 999 3 KZ Constant Count 0 to 999 KY Constant Byte byte 0 to 255 0 to 255 KF Constant Fixed point
7. After warm restart the CP uses the data of the memory submodule that is plugged in See 7 3 1 for a more detailed description GWA 4NEB 812 6030 02b 6 57 Print Mode CP 521 Table 6 21 PIQ in the Case of the Setting the Serial Interface Parameters Job Number of the parameter block Baud rate Yes Interface TTY RS 232 C V 24 Data format 7 data bits 8 data bits 7 HW handshake OFF ON 3 Parity mark parity bit always 1 space parity bit always 0 None 4 BUSY signal No 6 58 GWA 4NEB 812 6030 02b CP 521 Print Mode Table 6 22 PIQ in the Case of Setting the XON XOFF Listing Parameters Job PPS ae ce ae Number of the parameter block 20 XON XOFF protocol XON character 00 to TE No listing FF FFFF XON XOFF protocol No XON XOFF XOFF character 00 to 7F protocol No listing FE Without meaning 00 to FF Table 6 23 PIQ in the Case of the Setting Print Mode Job Number of the parameter block 7 0 if memory and operating mode code 0 for submodule Print mode with message texts plugged in without memory submodule Without meaning 00 to FF 0001 100 ms GWA 4NEB 812 6030 02b 6 59 Print Mode CP 521 Table 6 24 PIQ in the Case of Transparent ASCII Mode Job 1 Number of the parameter block 7 H 0 If memory and operating mode code 1 for submodule Transparent ASCII mode with message texts plugged in
8. Data block No 1 The data is entered in bytes 2 to 7 and transferred to the CP Block end If data block No 1 has not yet been acknowledged by the CP jump to label 002 If data block No 1 has been acknowledged by the CP the second data block is transferred to the CP by the CPU Block end 7 33 ASCII Mode CP 521 If data has been transferred from the CPU to the CP free of errors and if the send length entered in the coordination job has been reached flag 80 0 is reset 7 34 GWA 4NEB 812 6030 02b CP 521 ASCII Mode Sending variable length messages Data transfer with variable length messages is similar to transfer with fixed length messages They differ in that when sending with variable length in conjunction with job A001 cf 1 sending messages one or two end of text characters must be transferred in bytes 4 and 5 Table 7 23 Coordination Job Coordinate data transfer Send message send bit Message length here variable length Message length here variable length End of text character only if message length 0 7Fy End of text character only if message length 0 Bytes 2a 39 You can define the length of a message here 00004 to 01004 If you want to send variable length messages program 00004 variable length here You must then define another one or two end of text characters in bytes 4 and 5 Bytes 4 a 5 You define your end of text characters here If you want to
9. KH 5001 M001 IW 122 FW 22 M001 FW 24 OW 120 FW 30 DW 0 QW 122 FW DW 0 124 FW DW 0 126 122 GWA 4NEB 812 6030 02b Has the CP acknowledged the transferred data block Check of the number of the acknowledged data block Transfer of the next data block with the relevant number Read out the data byte to be transferred from the source DB and transfer to the CP If the data byte to be transferred contained the end code ODOD wait for acknowledgement 5X00 from the CP Increment by 1 the block number in the data transfer job BONR FW 24 the block number in the block acknowledgement 5X01 FW 22 and the pointer in the source DB 7 37 ASCII Mode CP 521 Acknowledgement from CP after transfer of the last data block If the acknowledgement from the CP is positive transfer of the next data package is prepared Reset block acknowledgement Transfer of the first data block Set pointer in source DB to its initial value The FB only runs with the CPU 103 the operation Process flag word DO FW is not included in the operation sets of the CPU 100 and the CPU 102 7 38 GWA 4NEB 812 6030 02b CP 521 ASCII Mode 7 4 2 Receiving Messages If you want to receive data from a peripheral device using the CP 521 you must program both devices with the same message length or end of message character The periheral device sends messages to the CP 521 where
10. 0 00 cee eee 6 6 4 2 Entering Place Holders llllsllllslsnn 6 6 4 3 Place Holders for Date and Time of Day 6 6 4 4 Place Holders for Message Text 200 00000 6 6 4 5 Place Holders for Variables 000000 ee aee 6 6 4 6 Control Parameters 0 0 ees 6 6 5 Data Transfer from the CPU to the CP 521 6 6 5 1 Data from the CP 521 to the CPU Status of the CP 521 the printer and current clock data 6 6 5 2 Data from the CPU to the CP 521 CPU Jobs 6 6 6 Overview of Possible Jobs in Print Mode 6 6 6 1 Printing the Message Text Job 30 und 40 6 6 6 2 Setting the Time of Day and the Date Job10 6 6 6 3 Setting the Page Numbers Job 20 eee eee 6 GWA 4NEB 812 6030 02b 6 6 5 6 6 6 6 6 7 Outputting Page Feed Job 50 Outputting Line Feed Job 60 Deleting the Message Buffer Job 70 sssssee 6 55 Printout of All Configured Message Texts RIOD BO ane t he diei trace fo les he dns 6 56 Transferring Parameter Setting Data GWA 4NEB 812 6030 02b 6 1 Schematic for Entering Parameter Blocks In DBA dct edie Bo a tree aed athena Lees 6 7 6 2 Schematic for Entering Headers and Footers 6 14 6 3 Structure of a Message Text 000 cee eee 6 19 6 4 Structure of a Place Holder 000 2a euee 6 22 6 5 Job Tr
11. 03y and 044 CPU job requests 02H 054 and 06H are also stored in the message buffer but they cannot cause a buffer overflow although this can be caused after the CP has received 255 CPU Print message texts jobs The CP message can only be scanned 3 program scan cycles after allocation of the job as with all other responses Character delay time exceeded X94 The time between two received characters is greater than the value set in parameter block 7 The data received up to the error is transferred to the CPU as a message Parity error XAq The parity of received characters does not agree with the parity configured in parameter block 0 The message is not transferrred to the CPU and is not stored in the receive mailbox Receive after XOFF or receive after DTR 0 XBy In the case of XON XOFF protocol The CP 521 sends XOFF to the peripheral device if less than 20 bytes are free in the receive mailbox e the CP has received more than 100 messages The CP 521 sends XON again only when more than 256 bytes are free in the receive mailbox GWA 4NEB 812 6030 02b 7 59 ASCII Mode CP 521 When using MODEM control signals The CP 521 sends DTR 0 to the peripheral device if less than 20 bytes are free in the receive mailbox e the CP has received more than 100 messages The CP 521 sends DTR 1 again only when more than 256 bytes are free in the reveive mailbox Error message XBy is output if the peripheral d
12. 5 3 6 46 AAAA ep c EIE C T CO ER EE e EN o PIP HP e M A 0 A o mo m N eo o N N N CO A xk N c GWA 4NEB 812 6040 02b CP 521 Index Point to point connection Print mode interrupt jobs PIQ operating mode parameter setting data status PII Printout of all messages Process input image PII Process output image PIQ Protocol XON XOFF R Real time hardware clock integrated Receive after DTR after XOFF Receive buffers deleted Receive jobs Receive mailbox overflow Receive message Restart procedure S Send buffers deleted GWA 4NEB 812 6030 02b 741 B 1 gt SER alg m P Go on E N n oo 6 1116 59 Send jobs Send mailbox Send permission Sending messages Separator Serial interface setting Setting CP 521 CP 521 parameters for entering message texts mode parameters serial interface Settings clock Signals Slot Slot addressing Space Start bit Startup CP 521 Status message Stop bit Subminiature D connector pin assignment T Terminal diagram TTY interface V 24 interface Text entering 7 19 2 2 7 19 7 20 7 21 6 20 1 1 2 2 2 5 ala ge i ego n no gu PUP m a E 5 3 Index CP 521 Time error inserting Time of day inserting reading setting Transmission mode TTY curren
13. and carriage return 0D Motor works Message text KH OAOD ASCII code for line feed OA and carriage return OD KC 9999 Wackeldorf Message text end of message character 6 32 GWA 4NEB 812 6030 02b CP 521 Print Mode Entry with the character not with PG 615 If the module encounters the character when evaluating the message texts it automatically subtracts 40y from the next character Example Set double width type on the PT 88 printer This is done with the ESC 8 command The ESC control character has ASCII code 1By In the ASCII code table find the ASCII character with the code 1By 40y 5Buy This is the character Entry in message text 8 Explanation The module recognizes the character 40g is subtracted from the ASCII code of the next character 5By 5By 404 1By 1By is the ASCII code for the ESC control character The module assigns the printer with the job of executing ESC 8 i e switching to double width type Example Configuring a message text with control parameters entry You want to store the following message text in DB 5 Message text 50 lt Double width type on Monthly overview Double width type off 8 Monthly overview Message text no 50 Separator switch on character string for double width type message text switch off character string for double width type See the printer manual for an overview of control paramete
14. max 100 s meam 6 mean y wem GWA 4NEB 812 6030 02b 7 31 ASCII Mode CP 521 Example Sending a fixed length message Let s assume you have the CP 521 in slot 7 initial address 120 and you want to send a fixed length message 12 bytes to the peripheral device You have stored the data for the message in data block DB 20 SENDEN H6 DB 20 M001 KH A001 OW 120 7 32 Send fixed length 12 bytes Open source DB Flag 100 1 e g edge flag initiates data transfer If flag 80 0 is set coordination job transferred to CP jump to label 001 The coordination job is transferred to the CP in byte 0 and permission to send or receive is transferred in byte 1 When sending with a specified length the length of the data message is entered in bytes 2 and 3 The coordination job has been initiated The block has been completed Read in of bytes 0 and 1 If the coordination data transferred from the CPU to the CP are invalid byte 1 00y jump to label 002 GWA 4NEB 812 6030 02b CP 521 ASCII Mode IW 122 KH 0000 KH B001 OW 120 GWA 4NEB 812 6030 02b Read in of bytes 2 and 3 If the coordination data is invalid after coordination job or if a data block is acknowledged jump to label 003 If the coordination data were invalid the 1st data block is transferred Entry in byte 0 BOH Data transfer from the CPU to the CP 521 Entry in byte 1 014
15. ment from the CP 521 GWA 4NEB 812 6030 02b 7 21 ASCII Mode CP 521 Data transfer from the CPU to the CP 521 CPU CP 521 Byte 0 1 2 3 4 5 6 7 Coord Send length End of text Irrelevant character CPU CP 521 Coord Coord Data Irrel Number Irrelevant d info byte valid of messages CPU CP 521 Figure 7 3 Sequence Schematic for Sending Data 7 22 GWA 4NEB 812 6030 02b CP 521 ASCII Mode CPU CP 521 Data Block Data transf number CPU CP 521 Coord Coord Data Block Irrelevant info byte valid number CPU CP 521 Figure 7 3 Sequence Schematic for Sending Data Continued Steps to are explained more fully in the following GWA 4NEB 812 6030 02b 7 28 ASCII Mode CP 521 CPU job request Coordinate data transfer To coordinate data transfer job AQ is written into byte 0 of the PIQ This defines the meaning of bytes 1 to 7 Table 7 14 Coordination Job o A Job Coordinate data transfer Send message send bit Send length here 256 bytes 3 oo Send length here 256 bytes 3 s esoe S sw wem E 6 mean 7 Irrelevant Byte 1 You allocate send permission for a message by setting bit O 1 This initiates data transfer The CP 521 resets this bit after passing the message on to the peripheral device Bytes 2u 3 Bytes 2 and 3 indicate the message length The length can lie within the range 00014 to 01004 You must have set this le
16. 2 Behavior in Operation 000 cece eee eee eee 4 4 2 1 Print Mode i peice he ae tes ied ey eee ia oak 4 ASCII Mode reiner ec en ain er ds Gated SCR GWA 4NEB 812 6030 02b Po po ok OW Mode EIOS 22 522 re ca ew eed d eee bi mde 1 Memory Submodule Errors es 4 2 Clock Test Messages 0 0c eee eee eed 4 3 Faults in Operation Print Mode lulu 4 4 Interruptions in Operation ASCII Mode 5 GWA 4NEB 812 6030 02b CP 521 Notes on Operation 4 Notes on Operation 4 1 Restart Characteristics The CP 521 performs a restart operation when the power supply is restored POWER ON The restart procedure consists of Deleting the message buffer e Checking the module 4 1 1 e Memory submodule evaluation 4 1 2 e Clock test 4 1 3 If errors occur during the restart procedure the module sends an error message to the CPU in byte O of the PII Module status print mode 6 6 ASCII mode 7 5 3 4 1 14 Checking the Module In this part of the restart procedure the proper functioning of the hardware is checked Errors are provided with the appropriate number in byte O of the PII Module status and can be evaluated in the control program or with the programmer Table 4 1 Module Errors Clock fault Replace module Hardware fault Replace module No backup battery Insert new battery X may have different values GWA 4NEB 812 6030 02b 4
17. 4 BUSY signal No 00 00 Yes 01 H Interface TTY 00 00 RS 232 C V 24 01 H Data format 7 data bits 00 00 8 data bits 01 H 7 HW handshake OFF 00 00 ON 01 a 3 Parity even 00 odd 01 mark Parity bit always 1 02 space Parity bit always 0 03 GWA 4NEB 812 6030 02b A 9 Summary CP 521 Table A 2 PIQ for Job Transfer Parameter Setting Data for Parameter Block 2 ICONES HS NNNE XON XOFF protocol XON character no protocol XON XOFF protocol XOFF character no protocol 00 to 7Fy FF p to 7Fy FFFF No XON XOFF protocol Table A 3 PIQ for Job Transfer Parameter Setting Data for Parameter Block 7 Print Mode Ri ial MEME ANNE Parameter block number and Identifier for Print mode If memory submodule with message texts plugged in Without memory submodule No significance A 10 00 to FF GWA 4NEB 812 6030 02b CP 521 Summary Table A 4 PIQ for Job Transfer Parameter Setting Data for Parameter Block 7 Transparent ASCII Mode 1 INN CONNNIDN Parameter block number and If memory submodule Identifier for Transparent ASCII with message texts mode plugged in Without memory submodule Character delay time 0001 H to OBB8 0001 ui 100 ms Message length in bytes 0000 to 0100 os remem mem S Table A 5 PIQ for Job Transfer Parameter Setting Data for Parameter Block 7 Interpretive ASCII Mode
18. 4NEB 812 6030 02b CP 521 Print Mode 5 Startup of the CP 521 in print mode If the CP 521 has a memory submodule it is automatically in print mode after POWER ON If the CP 521 has no memory submodule it is automatically in ASCII mode Changing operating modes during operation You can change betwenn Print mode Transparent ASCII mode and Interpretive ASCII mode during operation Note that if you e change the operating mode or call up the programmed operating mode again the send and receive buffers and all print jobs will be deleted To change the operating mode transfer job 90XX Transfer configuration data to the CP 521 Remember that the parameters must agree with the settings on your peripheral device GWA 4NEB 812 6030 02b 6 3 Print Mode CP 521 6 3 Setting the CP 521 Parameters in Print Mode The CP 521 can only be operated in print mode if an initialized memory submodule has been plugged in Store the following in the memory submodule Parameter setting data of the CP 521 in data block DB 1 Message texts optionally in DBs 2 to 63 6 4 The CP 521 requires the following parameter setting data Parameters for the printer interface baud rate type of interface BUSY signal e Configuration data for entering message texts function character end of text character Configuration data for the message text printout output form for date and time of day headers and f
19. 521 Parameters with Job 90XX You can use the Transfer parameter setting data job to transfer data for a parameter block to the CP 521 You can only initialize parameter blocks 0 2 and 7 with the Transfer parameter setting data job Parameter blocks 1 3 4 5 and 6 are only significant in print mode They cannot be initialized from the user program When evaluating data from the CP 521 PII you must take into account that you will not receive the correct response to a CPU job request PIQ until two cycles after initiation of the job CPU passes job to CP 521 job from CPU evaluate error message Transfer of job Error message transferred PC program cycle DC data cycle Figure 7 1 Job Transfer and Error Evaluation This has the following significance for parameter setting with the user program e At least seven program cycles are required for setting parameters in the three parameter blocks e df errors occur error message 08 correspondingly more program cycles are required 7 6 GWA 4NEB 812 6030 02b CP 521 ASCII Mode The following pages contain e The PIQ assignment plan for the Transfer the parameter setting data for parameter block X jobs Example program for transferring parameter setting data Parameter setting data for parameter block 0 Table 7 2 PIQ for the Transfer the parameter setting data for parameter block 0 Job Number of the parameter block Baud rate mark parit
20. 812 6030 02b 3 1 Hardware Installation CP521 Installing module e Hook in the module at the top of the bus unit Swing it down onto the bus unit Press it firmly down e Tighten the screw at the front 3 2 Dimension Drawing 5 PRINTER INTERFACE Bess 521 8MAT GWA 0074 En Internal thread Standard sectional rail 4 60 UNC EN 50022 35x15 Figure 3 2 Dimension Drawing of the CP 521 3 3 Connecting Peripheral Devices The module has a serial interface Parameters can be assigned gt 6 to set the interface as a TTY interface and RS232 C V 24 interface Both interfaces are connected to a 25 pin subminiature D connector 3 2 GWA 4NEB 812 6030 02b CP 521 Hardware Installation Pin assignment of the 25 pin subminiature D connector Ground DTR V 24 RXD RXD DSR RXD Ground CTS TXD Ground V 24 TXD Shield TXD Shield RTS Figure 3 3 Pin Assignment of the 25 pin Subminiature D Connector Permissible cross section of the lines used in subminiature D connections up to 0 5 mm 20 AWG GWA 4NEB 812 6030 02b 3 3 Hardware Installation CP 521 3 4 Protective Measures Against Faults on the Line Please note the cable length to ensure trouble free data transfer TTY interface Note voltage drops along the cable and the send and receive elements of the module 2 2 RS 232 C V 24 interface Cable lengths up to 15 m are not critical Note the loading capacity in
21. ASCII Mode Setting the CP 521 Parameters in Interpretive ASCII Mode 0 00 cee eee eee Permissible CPU Job Requests when Sending Messages CERE 5 TT 7 7 digs Sha wha Gey 7 8 mo AD Ls v9 IEEE 7 9 sta Ge shale St bate 7 10 iu sehen ea 7 15 ict eo aves 7 16 ened 2 ThE 7 16 TOR 7 17 PT 7 18 Dum Eu edax e 7 21 GWA 4NEB 812 6030 02b Permissible CPU Job Requests when GWA 4NEB 812 6030 02b Coordination Job ee 7 Coordination Information ee 7 Data Transfer Sending the 1st Data Block 7 Acknowledging the 1st Data Block 00 7 Data Transfer Sending the 2nd Data Block 7 Acknowledging the 2nd Data Block 4 7 Data Transfer Sending the 43rd Data Block 7 Acknowledging the Last 43rd Data Block 7 Final Coordination Information 000 e eee 7 Coordination JOB 25212 cutem iar E NIE RUM 7 Receiving Data PIQ 0000 cece 7 Coordination Job a an eee 7 Data Transfer Receive the 1st Data Block 7 Acknowledging the 1st Data Block 00 7 Data Transfer Receive the 25th Last Data Block 7 Acknowledgement for the 25th Data Block 7 Final Coordination Information 1 1 2 eee eee 7 Permissible Jobs in ASCII Mode 2 2 7 Message Invalid Job PII 000000
22. Installation contain all the information you require to install the module and connect it to a printer or other peripheral device connector pin assignments and terminal diagrams Notes on Operation describes restart characteristics and actual operation This chapter also contains the error messages that can occur during startup Principle of operation and addressing This is a general description of how data transfer between the CPU the CP 521 and the I O modules is coordinated This chapter also describes how the module is addressed e Functional description We have devoted a separate chapter to the Printer mode and the ASCII mode Each of these chapters contains the information necessary for programming the module for the relevant mode This saves you time consuming searches in the manual GWA 4NEB 812 6030 02b vii Introduction CP 521 Appendix A Summary All the information you require to operate the CP 521 has been gathered together here in list form This is for those users who have read the manual and wish to find some brief item of information quickly Appendix B Application example This recaps all user inputs from installation through cabling to programming illustrated by the way of example of a point to point connection The application example illustrates the ASCII mode and contains an exe cutable program Since the module can only be used in conjunction with the S5 100 U it is assumed that you have
23. PC t appears in the digital output modules output byte 3 and 4 as an LED pattern Explanation The send data is Written into DW 0 of DB 2 in the send PC Transferred to the receive PC as a data message via the CP 521 point to point connection Written into DW of DB 3 as receive data Transferred to the digital output modules of the receive PC GWA 4NEB 812 6030 02b B 11 GWA 4NEB 812 6030 02b Index CP 521 Index A Clock test 4 2 Addressing Configuration ASCII characters header message text footer ASCII mode interpretive interrupt parameter setting data transparent B Backup battery missing Battery backup failure Baud rate Block number Block separator BUSY signal C Cable length Character delay time exceeding Clock setting GWA 4NEB 812 6030 02b 7 59 tesi 6 50 Configuration data message text printout Configuring message texts on the memory submodule Configuring message texts printing out Connection to the peripheral device plugging in unplugging Control character command parameters Coordination data transfer Coordination information final Coordination jobs CP 521 parameter setting setting startup CP 521 parameters setting CP response E 5 an A n E A P A ER e o 3 1 6 20 Index CP521 CPU E acknowledgement Entering job message texts
24. Send variable length message frames Receive fixed length message frames Receive variable length message frames You can define the transmission mode in the user program The time from the module s own real time clock can also be used in ASCII mode for tasks in the user program requiring the date and time of day GWA 4024 2 Figure 1 2 Complete Configuration Point To Point Connection GWA 4NEB 812 6030 02b 1 3 Principle of operation of the CP 521 Accessories List and Ordering Data GWA 4NEB 812 6030 02b 2 2 Technical Specifications sless 2 3 Serial Interface CP 521 Peripheral Device 2 3 1 Print Mode enu beat veal dd Puer uda 2 3 2 ASCII Mode 5 Cr Relieve Sneed 2 4 Memory submodule eseeeeess 2 2 5 Hardware Clock seeseeeeeeeeeees 2 2 6 Backup Battery 0 000 e cece eee eee 2 ONO 11 12 12 2 4 2 1 2 2 Schematic Representation of the CP 521 2 1 11 Bit Character Frame with 7 Data Bits 2 5 11 Bit Character Frame with 8 Data Bits 2 6 Timing Diagram for Data Transfer Between the CP and the Peripheral Device i 2 10 Methods of Transmission in Print Mode Valid Control Signals of the RS 232 C V 24 Interface in Handshake ON Mode 0 cece eee 2 Overview of Permissible User Submodules GWA 4NEB
25. a copy of the S5 100U manual The basic information on the STEP 5 programming language contained in the S5 100U manual is sufficient for operating the CP 521 Conventions In order to improve the readability of the manual a menu style breakdown has been used i e viii The individual chapters can be quickly located by means of a thumb register There is an overview containing the headings of the individual chapters at the beginning of the manual Each chapter is preceded by a breakdown of its subject matter The individual chapters are subdivided into sections and subsections Boldface type is used for further subdivisions Pages figures and tables are numbered separately in each chapter The page following the chapter breakdown contains a list of the figures and tables appearing in that particular chapter GWA 4NEB 812 6030 02b CP 521 Introduction Certain conventions were observed when writing the manual These are explained below Anumber of abbreviations have been used Example Programmer PG e Footnotes are identified by superscripts consisting of a small digit e g 1 or The actual footnote is generally at the bottom left of the page or below the relevant table or figure e Cross references are shown as follows 7 3 2 refers to subsection 7 3 2 No references are made to individual pages e All dimensions in drawings etc are given in millimetres inches mm in e Information of particular importanc
26. at present The job must be repeated Default time set The clock has been set with the values Sunday 1 1 89 12 00 00 Time of day date At least one manipulated variable is error outside the permissible range The clock has not accepted the new clock data and is continuing with the current data Hardware error X Signal status is irrelevant for the other half byte GWA 4NEB 812 6030 02b 6 35 Print Mode CP 521 Example Scanning the status of the module byte 0 in the PII The module is installed in slot 7 initial address 120 If the battery of the printer output module is defective message text No 8 is printed out 6 36 FEHLERI sL IB KH Read byte 0 status byte into ACCUM 1 Set bits 4 to 7 to 0 by ANDing them with OOOFH The signal states of bits 0 to 3 stay the same Compare ACCUM 1 contents with 0007H If the status byte does not contain the value 7H the battery is functional Processing of the block is terminated The battery is defective The CPU assigns the CP 521 with the job of printing message number 8 GWA 4NEB 812 6030 02b CP 521 Status of the printer and day of the week byte 1 in the PII Print Mode Byte 1 is divided into two half bytes The status of the printer is specified in the left half byte bits 4 to 7 and the current day of the week is in the right half byte bits 0 to 3 Both are independent of each other They can be combined as needed
27. blocks of a message have been transferred A message can have a maximum length of 256 bytes The CP 521 gathers the data blocks together into a message and transfers the message automatically to a peripheral device Only one message can be stored in the send mailbox of the CP 521 The CPU can only send the next message to the CP when this message has been transferred to the peripheral device 7 20 GWA 4NEB 812 6030 02b CP 521 ASCII Mode Sending fixed length messages The following is a description of which jobs the CPU uses when prompting the CP 521 to send messages and how the CP 521 acknowledges these jobs Table 7 13 contains all the CPU jobs permissible in ASCII mode After setting the interface parameters 904 7 3 jobs AOp and BOw are relevant for sending data Table 7 13 Permissible CPU Job Requests when Sending Messages PIQ 00 Data not relevant 10 Set date and time of day variable in bytes 1 to 7 90 Set interface parameters A0 Coordinate data transfer BO Process data transfer CPU CP Data is transferred via the CP 521 in two steps First data transfer between the CPU and the CP 521 is coordinated e Only then is data transferred The schematic on the following two pages shows the overall data transfer procedure for sending data Data blocks of eight bytes are represented as used for sending messsages The CPU job varies from block to block and also the corresponding acknowledge
28. cee eee eee 7 Message No Receive Message Present PIl 7 Message Error in Receive Message PII 7 Status Byte in ASCII Mode PII 2 7 CP 521 ASCII Mode 7 ASCII Mode In ASCII mode with a CPU job request the CP 521 allows transfer of a message of up to 256 bytes between the CPU and a peripheral device connected to the CP 521 e Communication with a terminal device terminal keyboard Point to point connection with a further CP 521 a CP 523 or a CPU 944 7 1 General You can choose between Transparent ASCII mode The CP 521 does not interpret any characters in transparent ASCII mode No XON XOFF protocol is possible Messages can only be sent or received with a fixed programmed length e interpretive ASCII mode The CP 521 evaluates the following characters in interpretive ASCII mode RUB OUT 7F BACKSPACE 08 XON OFF character if initialized Character end code if initialized The CP 521 handles data transfer with the peripheral device autonomously The CPU initiates data exchange between the CPU and the CP by sending a job See 7 4 for a precise description of the data exchange procedure The time of day can be read from the integrated clock by the CPU also in ASCII mode and used in the user program for date dependent and time dependent tasks If the time is not used in the control the battery is not needed No memory submodule is required in ASCII
29. data 2 13 Message texts on the memory evaluation 4 2 submodule parameters setting configuring 6 46 plugging in 3 1 Message receiving unplugging fixed length Message 7 20 variable length 7 50 7 30 7 35 Message sending error variable length 7 32 printing 6 44 7 36 status Methods of transmisson 2 7 2 8 Message buffer Mode 1 1 6 44 deleting 6 44 6 55 changing 7 4 Message frame setting 6 5 receive Mode parameters send setting transmission Module status PII 6 34 GWA 4NEB 812 6030 02b CP 521 Index O Parity error Operating mode Peripheral device 2 2 changing 6 15 compatible 5 1 print mode 6 15 Permanent wire break 7 60 setting on the peripheral device Operating mode ASCII mode line interpretive 6 15 Permission to receive transparent 6 15 PII Output message P Page feed 6 53 executing 6 43 Pin assignment Page format 6 13 Subminiature D 3 3 Page number connector setting TTY interface 3 6 Parameter block entering entering in DB 1 input Parameter block number Parameter setting CP 521 DB 1 with memory submodule Parameter setting data ASCII mode A 9 print mode A 6 transferring 6 57 Parity Parity bit mark space V 24 interface PIQ in interpretive ASCII mode in transparent ASCII mode in print mode Place holder date entering message text time variable
30. delay time 50 x 100 ms 5s 006 Message length 6 bytes GWA 4NEB 812 6030 02b B 3 Application Example CP 521 B 5 Programming the Programmable Controller Before entering the statement list we would like to explain the basic settings of the example program The program is designed so that both programmable controllers are permanently ready to receive Transmission on a 200 ms timebase 5 Hz The CPU expects to receive messages constantly and switches to Send every 200 ms for a send message You can enter and change the send data via simulator modules Both programmable controllers store Send data in DW 0 to DW 2 of DB 2 and e Receive data in DW 0 to DW 2 of DB 3 Proceed as follows when programming e Enter the blocks in the programmer in the order specified e Transfer them to both programmable controllers Order for entering the blocks e DB2 Send data DW 0 to DW 2 e DB3 Receive data DW 0 to DW 2 e FB1 Send program e FB2 Receive program e FB3 Send takt program 5Hz e OB1 Test program B 4 GWA 4NEB 812 6030 02b CP 521 B 6 Programming Blocks DBs FBs OBs DW 0 test send IB 1 and 2 Application Example Os KH 0000 ir KH 0000 259 KH 0000 DW 0 test receive IB 1 and 2 GWA 4NEB 812 6030 02b Send 6 byte message Send active Coordinate send Slot 0 Message length 6 bytes Send active Remove error responses Check CP acknowledge Job valid B 5 Applica
31. has become very large This manual only gives facts and examples which are relevant to the CP 521 Demands for a higher quality of technical documentation have also been met which means Standardization of terminology More detailed breakdown of subjects e illustration of individual problems User friendly arrangement of the contents The aim is that both users with little previous experience and SIMATIC S5 experts should find all the information that they require to work with the CP 521 However the applications are so numerous that not all the problems that might occur can be dealt with in one manual For other problems please ask your Siemens representative for advice GWA 4NEB 812 6030 02b CP 521 Introduction Introduction It is important to study the introduction carefully before reading the rest of the manual This will help you to use the manual and will save you time Description of contents This manual is a comprehensive description of the CP 521 The manual can be divided into blocks according to topics e Description The System Overview contains information on the tasks the module can perform and on how the module is used in the S5 100U The Technical Description contains general information on the principle of operation of the module technical specifications details of the serial interface and input output I O modules and a list of accessories e installation and operation The Hardware
32. interface and configuration of message texts is supported by the DB editor of the programmers The parameters of the printer interface are either stored in DB 1 on a memory submodule or transferred direct in the user program GWA 4NEB 812 6030 02b 1 1 System Overview CP 521 In print mode the CP 521 assumes a printer with a RS 232 C V 24 or active TIY interface The printout of message texts does not increase the response time of the programmable controller You can have the following printed out Texts configured by the user on a memory submodule data blocks 2 tg 63 e Time of day and date from the module s own realtime clock Values for variables to be transferred via the O bus to the CP 521 88 E 488 Figure 1 1 Complete Configuration A Programmable Controller with a CP 521 and Printer 12 GWA 4NEB 812 6030 02b CP521 System Overview In In ASCII mode the CP 521 assumes a peripheral device terminal modem CP 523 etc with an RS 232 C V 24 interface or active TIY interface ASCII mode enables you to transmit message frames between the CPU and an peripheral device connected to the CP 521 Maximum data throughput is six bytes of useful data per two program scans This means that a maximum of 60 bytes s can be transmitted given a program scan time OB 1 of for example 50 ms The CP 521 can be used to The CP 521 can be used to Send fixed length message frames
33. mode GWA 4NEB 812 6030 02b 7 1 ASCII Mode CP 521 7 2 Prerequisites for Operation in ASCII Mode The following conditions must be met for operating the CP 521 1 Settings on the peripheral device The settings on the peripheral device must agree with the parameter setting data on the CP 521 If for example your peripheral device is transmitting data at 2400 baud you must also set this baud rate in the CP 521 e See 3 5 2 for configuration examples with terminal diagrams e See 2 3 2 for details of the serial interface Setting the CP 521 parameters in ASCII mode is explained in 7 3 2 Setting the CP 521 parameters There are various ways of setting the CP 521 parameters Transfer the parameter setting data in the user program No memory submodule is required e Transfer the parameter setting data using the FORCE VAR programmer function No memory submodule is required Store the parameter setting data in a memory submodule in DB 1 Initialize the memory submodule using a programmer in offline mode You must specify the following parameter setting data Parameters for the interface to the peripheral device baud rate type of interface handshake mode The parameters must agree with the specifications and settings on the peripheral device 7 2 GWA 4NEB 812 6030 02b CP 521 ASCII Mode 3 Establishing connections The CPU must be at POWER OFF to carry out the following measures e Establish con
34. per two program scans This means that a maximum of 60 bytes s can be transferred given a program scan time OB 1 of e g 50 ms Coordination jobs for sending and receiving messages must be sent in separate jobs They must not be mixed in the same job Send and receive jobs must also be programmed in such a way that each new job is only transferred when the previous one has been completely processed GWA 4NEB 812 6030 02b 7 19 ASCII Mode CP 521 7 4 4 Sending Messages The CPU transfers messages in eight byte blocks The messages have a maximum length of 256 bytes Each block consists of a header code of two bytes coordination bytes and six bytes of data 1 The CPU initiates data transfer with the job A001 This job also defines the message length If it is indicated with 0 one or two end of text characters must be initialized The CP 521 acknowledges receipt of this job to the CPU The CPU evaluates the CP response and begins transferring the current data only if no errors have been detected Transfer is started with job BOY and entry of a block number Six bytes of data follow The last data block transferred may contain less than six bytes The CP 521 writes the block into a send mailbox where it first stores the whole message The CPU receives an acknowledgement from the CP 521 after every eight bytes The CPU then sends the next data block to the CP and so on This data transfer continues until all data
35. place holders 6 22 job requests 7 19 7 54 EPROM EEPROM 2 3 Error 4 1 4 2 D date 7 61 Data time interchange Error evaluation 7 57 traffic Error message 4 11 6 46 Data block 7 54 7 51 A 12 receiving ASCII mode sending transfer 6 40 7 6 Data format Data message Data throughput Data transfer coordinate Date entering error inserting setting DB changing DB 1 parameter setting 6 18 Default time setting 7 61 Default values 6 4 Error number F Footer configured Function character Functional description general H Handshake Hardware clock integrated Header configured l Initial address Interface EI O Is P EH m N N a a p Y 99 CO A nN GWA 4NEB 812 6040 02b CP 521 Index J Message length 7 20 7 24 Job greater than 256 bytes not accepted Message text 1 1 t 2 2 CPU 6 40 6 19 La ASCII characters 6 20 illegal 7 61 configured in the memory 6 45 transfer 6 40 7 6 submodule Jobs PIQ configuring in print mode 6 41 entering le 11 inserting L maximum length Length of message number fixed variable 7 35 output 6 1 6 42 Line feed print 6 45 outputting 6 43 setting Le sl with control parameters L6 34 6 3 M with place holders 6 25 6 27 Mark 6 9 without place holders Mechanical assembly 3 1 Message text printout Memory submodule 2 2 2 11 configurarion
36. receive eo o o o Block No Coordination data valid Coordination data invalid Data after byte 0 5x after byte 0 6x A 4 GWA 4NEB 812 6030 02b CP 521 Summary CP Responses PII Continued Data 00 995c Number of messages in receive buffer 00 644 Data 00 2349 24h 01 12 amp cp 12ha m 81 T 92scp 12h p m Second after byte 0 5x after byte 0 6x GWA 4NEB 812 6030 02b A 5 Summary CP 521 A 3 110 Bd 200 Bd 300 Bd 600 Bd 1200 Bd 2400 Bd 4800 Bd 9600 Bd Baud rate Parity even odd mark space None Parity bit always 1 Parity bit always 0 BUSY signal TTY RS 232 C V 24 Interface 7 Data bits 8 Data bits Data format HW handshake Waiting time after XON character XOFF character A 6 OANoOoahWN A ono 00 4 to FFy 25ms 00 to FF 25ms 00 4 to FFy 25ms ASCII character 114 204 to 7Fy ASCII character 134 20 to 7Fy Parameter Setting Data for Print Mode User Submodule eo FFy No XON XOFF listing GWA 4NEB 812 6030 02b CP 521 Summary Function character ASCII character 3 204 to 7Fy End of text character ASCII character 204 to 7Fy Date and time of day Order for date JMT JTM MTJ MJT TJM J Y Year TMJ YMD YDM MDY M Month MYD DYM DMY TD Day Separator for date ASCII character 20g to 7Fy Order f
37. set and flag 6 1 is not set the program jumps to label 002 job 2 transferred to the module 6 48 GWA 4NEB 812 6030 02b CP 521 GWA 4NEB 812 6030 02b Print Mode Set flags 6 0 and 7 0 and transfer the Output message text 1 with CR LF job to the module Block end Set flags 6 1 and 7 0 and transfer the Output message text 2 with CR LF job to the module Block end If flag 7 0 is set it is reset and flag 8 0 is set This only happens in the control program after a job is initiated Block end if F 7 0 is 1 If flag 7 0 is reset and flag 8 0 is set the program checks to see if the job has been transferred This happens two program cycles after initiation of the job If the job has not been transferred flag 8 0 remains set and in the following program cycles the overflow scan is repeated until the CPU job is accepted Only then is flag 8 0 reset and those jobs that have arrived in the meantime are processed 6 49 Print Mode CP 521 6 6 2 Setting the Time of Day and the Date Job 104 You can set the clock in two ways e With the user program This is suitable for example if the clock is to be set for a SINEC L1 time syn chronization n RUN mode with the FORCE VAR programmer function Operator inputs required e Specify job number 10H in byte 0 e Specify the new settings in bytes 1 to 7 If you set the clock with the FORCE VAR programmer function you must first transfer th
38. setting data for parameter block 7 Job Interpretive ASCII Mode IE Job number Parameter block number and T 0 if memory sub code for Interpretive ASCII module with mode message texts plugged in without memory submodule Character delay time 0001 to OBB8 0001 100 ms 445 Message length in bytes 0000 to 0100 40 64 character 00 No end of text character 6 End of text character 1 ASCII 01 to ries character 00 No end of text character 7 End of text character 2 ASCII 01 to 7F 0D carriage return 7 10 GWA 4NEB 812 6030 02b CP 521 ASCII Mode Example Setting parameter data in the user program for operation in ASCII mode using the PG 685 The CP 521 is plugged into in slot 7 initial address 120 The module is to be operated in interpretive ASCI mode and is initialized as follows Parameters for the serial interfac 2400 baud Even parity No BUSY RS 232 C V 24 interface 7 Datenbits Handshake OFF D oo OCOOD rT t parameter block 0 e Parameters for XON XOFF parameter block 2 XON character DC 1 11 XOFF character DC 3 134 e Parameters for ASCII mode parameter block 7 Character delay time 3 s 001E Variable message length with two characters for end code ODOD GWA 4NEB 812 6030 02b 7 11 ASCII Mode CP 521 Example Transferring parameter setting data for parameter blocks 0 2 and 7 The CP
39. the case of longer cables As a general rule longer cables can be used by reducing the baud rate 3 4 GWA 4NEB 812 6030 02b CP 521 Hardware Installation 3 5 Typical Configurations This section contains a few typical configurations for operating the CP 521 in print and ASCII mode 3 5 1 Print mode In print mode the CP 521 assumes a printer at the I O interface with an RS 232 C V 24 interface or an active TTY interface for printing message texts Terminal Diagram of the TTY Interface without BUSY Line CP 521 PT 88 TTY OUT 10 10 TTY IN 20 mA nw TTY OUT 12 9 TTY IN Shield 24 1 Shield Shield 25 Figure 3 4 Pin Assignment of the TTY Interface without BUSY Signal Print Mode GWA 4NEB 812 6030 02b 3 5 Hardware Installation CP 521 Terminal Diagram of the TTY Interface with BUSY Line CP 521 PT 88 TTY OUT 10 10 TTY In wre TTY OUT 12 9 TTY IN Shield 24 Shield 25 1 Shield TTY IN 6 21 TTY OUT M D TTY IN 8 18 TTY OUT Printer setting Printer not ready to receive no current Figure 3 5 Pin Assignment of the TTY Interface with BUSY Signal Print Mode Terminal Diagram of the RS 232 C V 24 Interface CP 521 PT 88 V 24 TXD 2 3 RXD V 24 RXD 5 2 2 TXD Shield 24 25 2 1 Shield CTS 9 RTS 13 DTR 15 GND X 2 2172 gt 7 GND 7 gt 25 BUSY Printer settin
40. the parameter setting data Parameters for the interface to the peripheral device baud rate type of interface handshake mode e Specifications of the XON XOFF protocol Parameter setting data for data transfer in ASCII mode message length end of text character If you want to set other CP 521 data there are the following other ways of transferring parameter setting data to the CP Transfer the parameter setting data to the CP 521 in the user program 7 3 1 No memory submodule is required for operating the CP 521 Store the parameter setting data on a memory submodule in data block DB 1 and plug the initialized memory submodule into the CP 521 7 3 2 Transfer the parameter setting data with the FORCE VAR programmer function No memory submodule is requirerd to operate the CP 521 In order to transfer the parameter setting data as simply as possible the parameter setting data are divided into parameter blocks This subdivision is the same as in print mode Parameter blocks 1 3 4 5 and 6 are not significant in ASCII mode and are not included in the table Table 7 1 Parameter Blocks in ASCII Mode E ou Serial interface parameters XON XOFF protocol only relevant if XON XOFF protocol operated The XON XOFF protocol has priority over the BUSY signal Desired mode Parameter setting data for data transfer in ASCII mode GWA 4NEB 812 6030 02b 7 5 ASCII Mode CP 521 7 3 1 Setting the CP
41. use two end of text characters fill both bytes If you only use one end of text character fill byte 5 only Only one end of text character is used in the example If the message is longer than 256 data bytes lt 0100yH the CP 521 responds with 5000 and then with message 4X Job error The CP 521 responds with the same error message if it detects no end of text character s after receiving 256 data bytes The data received is then aborted GWA 4NEB 812 6030 02b 7 35 ASCII Mode CP 521 Example Sending a variable length message only for CPU 103 You have plugged into the CP 521 in slot 7 initial address 120 and you want to transfer a message of undefined length to a peripheral device The data for the message is taken from DB 20 When the CP has accepted the send job flag 0 0 is to be set Both end of text characters must be in one data word SENDEN He 3A iR 7 36 DB 20 Send with variable length Source data block Flag 100 1 e g edge flag initiates data transfer All data has been transferred to the CP Wait for CP acknowledgement Transfer Send coordination information to the CP Message length End of text character Auxiliary register preset Reset block acknowledgement Transfer of the first data block Set pointer in source DB to its initial value GWA 4NEB 812 6030 02b CP 521 ASCII Mode AW fh fh 2 gt lt F JC IW 120 KH FOOF
42. with the relevant default value Table 6 5 Configuration Data for Message Text Printout Parameter Blocks 4 to 6 Order for data JMT JTM MTJ MJT JY Year TJM TMJ YMD YDM M Month MDY MYD DYM DMY TD Day Lowercase also permissible Separator for date ASCII character 20 to 7Fp Order for time of day HMS HSM MSH MHS H Hours SHM SMH M Minutes Lowercase also permissible S Seconds Separator for time of day ASCII character 20 to7Fy 24h clock Ger d D 12h clock Engl e E Lines per page 20 toFF 48 725 Left margin 00 to3C 00 Page number top T o bottom B u B bottom no other characters Header and footer Header 1 K1 Text 80 Characters No header Header 2 K2 Text 80 Characters or footer Footer 1 F1 Text 80 Characters Footer 2 F2 Text 80 Characters 6 12 GWA 4NEB 812 6030 02b CP 521 Print Mode Page format The page format is defined by configuring of parameter blocks 5 and 6 Table 6 6 Page Format Blank line if page number header or footer have been configured Blank line if page number header or footer have been configured Page No top if configured Blank line if page number configured at top Header1 Header2 Blank line Blank line if one or two headers have been configured Lines for message texts A maximum of 255 message texts can be configured Each individual message text must not be configured with more than 8
43. without me mory sub module Character delay time 0001 to OBB8 0001 100 ms 4 5 Message length in bytes 0001 to 0100 40 64 6 7 Without meaning 00 to FF 6 60 GWA 4NEB 812 6030 02b CP 521 Print Mode Table 6 25 PIQ in the Case of the Interpretive ASCII Mode Job Number of the parameter block 7 H 0 If memory sub and operating mode code 2 for module with Interpretive ASCII mode message texts plugged in without memory submodule Character delay time 0001 to OBB8 0001 100 ms 4 5 Message length in bytes 0000 to 0100 40 64 End of text ASCII character 01 to TF character 1 00 No end of text character End of text ASCII character 01 to ae character 2 00 No end of text character The Transfer parameter setting data job does not change the contents of the memory submodule plugged into the CP 521 After POWER UP the CP 521 uses the data of the connected memory submodule that is plugged in GWA 4NEB 812 6030 02b 6 61 Print Mode CP 521 The following two examples must be executed in the following order 1 Disconnect the TTY connecting cable between the CP and the printer 2 Setprinter to new data e RS 232 C V 24 interface example 1a XON XOFF protocol example 1b 3 Transfer new data with programmer function to the CP 4 Reconnect CP and printer with RS 232 C V 24 connecting cable See 3 5 1 for terminal diagram for RS 232 C V 24 in
44. 0 characters Configuration is described in 6 3 Blank line if two footers have been configured Blank line if one footer has been configured Footer Footer2 Blank line if the page number is configured at bottom Page No bottom if configured Blank line if one or two headers have been configured Blank line Left margin configurable up to lt 60 characters Number of lines per page 32 to 255 configurable in the range 20g to FF GWA 4NEB 812 6030 02b 6 13 Print Mode CP 521 Configuring headers and footers You can configure up to two headers and two footers The headers and footers may contain place holders for date and time of day as well as control characters LF FF and CR are not evaluated Place holders for variables and message texts are also not evaluated They appear in the printout as configured Headers and footers are configured according to the following schematic If entering more than one header or footer Block Parameter Header or End of separator block footer text 8A number number character e 364 K1 K2 F1 F2 Figure 6 2 Schematic for Entering Headers and Footers Enter the header or footer like the ASCII characters of a message text 6 4 g printed text may be longer than one line if place holders are used 6 14 GWA 4NEB 812 6030 02b CP 521 Print Mode 6 3 4 Setting the Mode Parameters Parameter Block 7 You can set the mode and the para
45. 00 0 256 0 256 0 026 0 026 0 003 0 003 0 0256 0 0256 0 0026 0 0026 0 00256 0 00256 33 3 32767 3276 7 327 7 32 8 3 3 0 3 327 67 32 77 3 28 0 33 32 767 3 277 0 328 3 2767 0 3277 0 32767 Print Mode 3 3 0 3 327 67 32 77 3 28 0 33 32 767 3 277 0 328 0 2767 0 3277 0 32767 Each fixed point number is represented by at least a 1 digits Leading zeros are replaced by spaces and are not suppressed GWA 4NEB 812 6030 02b 6 31 Print Mode CP 521 6 4 6 Control Parameters You can configure printer control parameters in two different ways in the message text Direct with the KH format Entry with the character CTRL key Direct entry with the KH format When configuring a message text the control parameters are entered direct as hexadecimal values data format KH Use the table to find the ASCII codes of the control parameters If you are using the programmer you must switch from the KS or C format to the KH format and specify the control parameters in ASCII code You then switch back to the KS or C data format Example Direct entry Configuring a message text with control parameters You want to store the following message text in DB 4 Message text 40 Motor works Line feed Carriage return Brummhausen Line feed Carriage return 9999 Wackeldorf 40 Brummhausen Message text no 40 separator message text ASCII code for line feed 0A
46. 1 Notes on Operation CP 521 4 1 2 Memory Submodule Evaluation The parameters of the serial interface and message texts specified on the module are checked here Errors with the appropriate number in byte O of the PII Module status can be evaluated in the control program Table 4 2 Memory Submodule Errors Memory submodule fault or no 1 PC POWER OFF memory submodule plugged in 2 Plug in new memory submodule 3 PC POWER ON No message texts configured Configure messages Wrong or defective memory submodule plugged in X The other half of the byte may have different values not significant here 4 1 3 Clock Test This part tests the module s real time clock The clock is set when the battery backup fails during POWER OFF of the PC The clock has the default setting 12 00 00 01 01 89 Errors and the default setting are provided with the appropriate number in byte 0 of the PII Status of the module and can be evaluated in the control program 4 2 GWA 4NEB 812 6030 02b CP 521 Notes on Operation Table 4 3 Clock Test Messages Clock fault Replace module Clock set Set the correct time with the Default setting programmer FORCE VAR or FORCE function X May have different values 4 2 Behavior in Operation You must note the following if you want to modify the configuration during operation e The CP 521 can only be plugged in or unplugged when the CPU is in STOP mode e The memory submodule ca
47. 11 Bit Character Frame with 7 Data Bits GWA 4NEB 812 6030 02b 2 5 Technical Description CP 521 8 data bits 1 start bit 8 data bits 1 parity bit 1 stop bit Signal state 1 Signal state 0 1 ued Ees 1 1 Stop Start Parity bit bit 8 Data bits bit X can assume signal state 0 or 1 Figure 2 3 11 Bit Character Frame with 8 Data Bits 2 6 GWA 4NEB 812 6030 02b CP 521 Technical Description 2 3 4 Print Mode You have a choice of three methods of transmission in print mode Table 2 1 Methods of Transmission in Print Mode XON XON characters Priority over BUSY XOFF XOFF characters signal and print protocol without protocol BUSY RXD DSR 0 Priority over print signal without protocol without Not Wait after Line break not protocol significant CR carriage return detectable LF line feed FF form feed All methods of transmission are possible both with the RS 232 C V 24 interface and the TTY interface GWA 4NEB 812 6030 02b 2 7 Technical Description CP 521 2 3 2 ASCII Mode The possible methods of transmission depend on the following e Type of interface TTY or RS 232 C V 24 e Whether handshaking has been configured when the RS 232 C V 24 interface is used handshake OFF or ON Type of ASCII mode transparent or interpretative TTY interface or RS 232 C V 24 interface with handshake OFF The CPU only uses the RXD line If the CP receives
48. 2b Setting the Coding Element 00 0005 3 1 Dimension Drawing of the CP 521 1 eee 3 2 Pin Assignment of the 25 pin Subminiature D Connector use 3 3 Pin Assignement of the TTY Interface without BUSY Signal Print Mode 3 5 Pin Assignment of the TTY Interface with BUSY Signal Print Mode 05 3 6 Pin Assignment of the RS 232 C V 24 Interface Print Mode eonim eee ee eee eee ee od 3 6 Pin Assignment CP 521 TTY Passive CP 523 TTY Active Point to Point Connection 3 7 Pin Assignment CP 521 CP 521 with Handshaking 3 8 GWA 4NEB 812 6030 02b CP521 Hardware Installation 3 Hardware Installation 3 1 Mechanical Assembly The module may only be plugged in or unplugged when the PC is in the SIOP mode The module may only be plugged into slots O to 7 on a bus unit slot 7 is not permitted with the CPU 102 6ES5 102 8MAO1 and the CPU 103 6bS103 8MA01 Before assembling the module the coding element of the bus unit must be set to 6 GWA 3962 3 Figure 3 1 Setting the Coding Element e The memory submodule may only be plugged in and unplugged when the power is OFF e The connection to the peripheral device Sub D Cannon male connector may only be plugged in and unplugged when the CPU is in STOP mode and data transfer between the CP and the peripheral device has been terminated GWA 4NEB
49. 521 is plugged into in slot 7 initial address 120 The module is to be operated in interpretive ASCI mode and is initialized as follows AN F 100 0 NAME BLOCKO JC FB 60 BLOCKO AN F 100 0 S F 100 0 BEC AN F 100 1 JC FB 61 BLOCK2 AN F 100 1 BLOCK2 Load ASCII codes for S F 100 1 L KH XON XOFF characters BEC T QW into ACCUM 1 and transfer to the CP in bytes 2 and 3 Load the job number and the parameter block number into ACCUM 1 and transfer to the CP in bytes 0 and 1 7 12 GWA 4NEB 812 6030 02b CP 521 ASCII Mode AN F 100 2 suC EB 62 BLOCK7 AN F 100 2 iSc o 10072 BE GWA 4NEB 812 6030 02b NAME BLOCK7 L KH ODOD QW 126 Load end codes into ACCUM 1 and transfer to the CP in bytes 6 and 7 Load message lengths into ACCUM 1 and transfer to the CP in bytes 4 and 5 Load character delay time into ACCUM 1 and transfer to the CP in bytes 2 and 3 Load job number 904 parameter block number 74 and mode code 214 into ACCUM 1 and transfer to the CP 7 13 ASCII Mode CP 521 7 3 2 Setting the CP 521 Parameters with the Memory Submodule You can store the parameter setting data on a memory submodule in DB 1 The procedure for setting the memory submodule parameters in ASCII mode is almost identical to the procedure in print mode The only difference is in setting the parameters for parameter block 7 in which additional data must be spe
50. 812 6030 02b CP 521 Technical Description 2 Technical Description 2 1 Principle of operation of the CP 521 The CP 521 handles data transfer with a peripheral device autonomously Data transfer between the CPU and the CP 521 must always be started by the CPU by sending a job request to the CP 521 EPROM EEPROM memory submodule DB1 Parameter setting data for the serial RAM interface and con Send mailbox figuration data for the format of message text Receive mailbox printouts DB 2 to 63 up Message buffer to 255 message texts V 24 eee transfer serial interface or TTY inter S face 25 pin subminia processor ture D Cannon connector of peripheral device printer CP 523 CPU 944 etc Operating system memory Integrated real time hardware clock I O bus Internal bus Figure 2 1 Schematic Representation of the CP 521 Typical jobs in print mode would be for example Print message text No 20 or in ASCII mode Receive a message from a peripheral device GWA 4NEB 812 6030 02b 2 1 Technical Description CP 521 Print mode The Print message text XY job causes the message text stored in the memory submodule under the number XY to be transferred to the printer via the serial interface Current values of variables time of day and date can be entered in the message text during this process You can configure up to 255 different message texts and store them in the memory submod
51. I DI Figure B 1 Configuration Schematic Point to Point Connection of Two S5 100Us PG GWA 4NEB 812 6030 02b B 1 Application Example CP 521 B 3 Terminal Assignments for the RS 232 C V 24 Interface CP 521 RS 232 C V 24 RS 232 C V 24 DSR DTR CTS RTS GND Shield CP 521 5 11 RS 232 C V 24 11 9 5 RS 232 C V 24 7 15 DTR 15 gt 7 DSR 9 C 9 CTS 13 al aa 13 RTS 2 21 23 2 21 23 GND 24 25 24 25 Shield Figure B 2 CP 521 CP 521 Terminal Assignments with Handshake B 2 GWA 4NEB 812 6030 02b CP 521 Application Example B 4 Setting the Parameters on the Serial Interface of the CP 521 To establish a point to point connection you must set the ASCII mode parameters for the serial interface of the CP 521 Store all parameter setting data in DB 1 ona user submodule EPROM EEPROM Enter all parameter setting data in DB 1 using the programmer e Transfer DB 1 to two user submodules one after the other Plug the user submodules into both CP 521s Enter the following data for the example program in DB 1 of the user submodule Table B 1 Setting the CP 521 Parameters in Interpretive ASCII Mode Parameter block 0 9600 baud Even Parity No BUSY signal RS 232 C V 24 interface 8 Data bits Handshake ON KS 710050006 7 Parameter block 7 1 Transparent ASCII mode 0050 Character
52. ON XOFF protocol in print mode and if you are not evaluating the BUSY signal You can set waiting times for Carriage Return CR Line Feed LF and Form Feed FF in a time frame of 0 25 s 6 10 GWA 4NEB 812 6030 02b CP 521 Print Mode Parameters for XON XOFF character If you have an XON OFF protocol you have free choice of XON XOFF characters Code 114 DC1 is reserved in ASCII code for the XON character and code 134 DC3 for the XOFF character You must not use the same values when initializing the XON XOFF characters If the XON XOFF characters are valid the printout is implemented with XON XOFF protocol The Print with BUSY signal setting and parameter block 1 waiting times are then insignificant 6 3 2 Configuration Data for Entering Message Texts Parameter Block 3 Message texts must always contain an end of text character 6 4 If you configure place holders in the message text they must be delimited by a function character You can configure any ASCII character you want as a function character and end of text character Table 6 4 Configuration Data for Entering Message Texts Parameter Block 3 Function ASCII character 20 to 7Fy 274 character 3 End of text ASCII character 20 to 7Fy 244 character GWA 4NEB 812 6030 02b 6 11 Print Mode CP 521 6 3 83 Configuration Data for Message Text Printout Parameter Blocks 4 to 6 If you enter an illegal value the CP will replace it
53. P The block is completed Read in of bytes 0 and 1 If no data has been sent to the CPU from the CP byte 0 50x jump to label 003 Read in of bytes 2 to 7 Read in the six data bytes transferred to the CPU by the CP in block two byte 1 024 and transfer the acknowledgement for block No 2 to the CP The next job can be initiated The block is completed If the CP acknowledges a coordination job or the complete transfer of a data message without errors flag 90 0 is reset The next job can be initiated 7 49 ASCII Mode CP 521 Receiving variable length messages Variable length messages are received in the same way as fixed length messages If you want to receive variable length data messages from a peripheral device using the CP 521 you must define the message end code for both devices with the job 90724 in word 6 Example Receiving variable length messages only for CPU 103 Let s assume you have plugged into the module in slot 7 initial address 120 and you want to receive data messages from a peripheral device using the CP 521 Write the data you receive into data block DB 40 EMPFANG Receiving with variable length C DB 40 Open target DB Transfer Data not relevant to the CP 521 Initiate from the CP 521 to the CPU data transfer Request data from CP 521 coordination information Coordination information sent Auxiliary register preset data transfer from CP 521 to CPU with block
54. Permissible User Submodules EPROM 6ES5 375 0LA15 8KByte EEPROM 6ES5 375 0LC31 8KByte 6ES5 375 0LC11 2KByte Maximum useful memory submodule size is 8 KBytes The memory submodule of the CP 521 may only be plugged in or unplugged in the POWER OFF state GWA 4NEB 812 6030 02b 2 11 Technical Description CP 521 2 5 Hardware Clock The CP 521 incorporates a hardware clock which may be provided with battery backup Sthe date date month year and the time of day second minute hour can be output with a message text on the printer In this way for example the time of failure of a machine can be recorded The output format for the date and time of day is defined on the memory submodule in DB 1 parameter block 4 6 3 3 The clock is read from the control program and can be set with the FORCE VAR programmer function 6 7 2 Otherwise the clock has the default values 1 1 89 12 00 00 on power up The clock must be reset if no battery was plugged in to back up the CP 521 during POWER OFF A battery can only be changed in the POWER ON state otherwise the clock data is lost and the clock must be reset 2 6 Backup Battery The battery backs up only the clock data In the case of a mains power failure or if the PC is switched off the clock data is only retained when a backup battery is inserted in the CP 521 the battery should only be inserted and changed when the PC is switched on Otherwise new cloc
55. R INTI amp ES5 521 XB GWA 3963 6 Back up battery Lithium 4AA 3 7 V 850 mAh Battery backup time atleast 1 year Degree of protection IP 20 Permissible ambient tem perature vertical O to 60 C horizontal o to 40 C Relative hum idity 15 to 9596 Cument consumption from 9 v CPU typ 140mA Power losses of the module typ 1 2 W Weight approx 500 g 1 1 Ib Block diagram 2 4 GWA 4NEB 812 6030 02b CP 521 Technical Description 2 3 Serial Interface CP 521 Peripheral Device The CP 521 is equipped with a RS 232 C V 24 interface and a passive TTY interface You can set the serial interface parameters in two ways In the user program only significant in ASCII mode with job 90H Set interface parameters parameter blocks 0 to 2 6 3 1 The CP 521 copies the parameter setting data from the user submodule into the RAM area of the CP during startup If the CPU transfers new parameter setting data to the CP with the 90H job during operation the CP continues with the new data e On the user submodule in data block 1 parameter blocks 0 to 2 6 3 1 Data is transferred between the CP and the peripheral device in an 11 bit character frame There are two data formats available 7 data bits 1 start bit 7 data bits 1 parity bit 2 stop bits Signal state 1 Signal state 0 1 c C 1 2 Stop Start Parity bits bit 7 Data bits pit X can assume signal state 0 or 1 Figure 2 2
56. Reading the current clock data and transferring it IEB 121 to the digital output modules OB 8 IW 122 OW 9 EW 124 AW 11 EW 126 AW 13 You can also evaluate the following messages using the integrated clock e Clock defective 1Xg This error evaluation is only relevant after a restart Default time set 2Xg This evaluation is only only meaningful if you are operating the CP 521 without a backup battery Time of day or date error 3X This error evaluation is only meaningful after you have set the clock GWA 4NEB 812 6030 02b 6 39 Print Mode CP 521 6 5 2 Data from the CPU to the CP 521 CPU Jobs The CPU can transfer eight bytes to the CP 521 The CP 521 processes the jobs bytes 0 and 1 in response to a pulse edge i e it responds only to signal changes in byte 0 or byte 1 The CPU assigns a job to the CP 521 in byte O and in bytes 1 to 7 it can then transfer other information required for executing the job The CP 521 has a message buffer Jobs for the peripheral device are written into the message buffer The job is deleted in the message buffer when the CP 521 has processed it The message buffer can hold up to 255 jobs If the CPU sends a large number of jobs within a short period the number of jobs still to be processed increases If there are 255 jobs waiting to be processed and the CPU sends another one the CP 521 is no longer able to process this last print job In this case the CP 521 report
57. SIMATIC S5 CP 521 Printer ASCII Communications Module Manual Order No 6ES5998 0UD21 GWA4NEB812 6030 02b Siemens has developed this document for its licensees and customers The information contained herein is the property of Siemens and may not be copied used or disclosed to others without prior written approval from Siemens Users are cautioned that the material contained herein is subject to change by Siemens at any time and without prior notice Siemens shall not be responsible for any damages including consequential damages caused by reliance on material presented including but not limited to typographical electronic arithmetic or listing errors Z WARNING Hazardous voltage Can cause death severe personal injury or substantial property damage Restrict use to qualified personnel See safety instructions Only qualified personnel should install or maintain this equipment after becoming thoroughly familiar with all warnings safety notices and maintenance procedures contained in this manual The successful and safe operation of this equipment is dependent upon proper handling installa tion operation and maintenance The following are definitions of the terms qualified person danger warning and caution as applicable for this document Qualified Person One who is familiar with the installation con ux Indicates loss of life severe personal injury or struction
58. Table 6 14 Status ofthe Printer and Day of the Week 1 Sunday 2 Monday 3 Tuesday 4 Wednesday 5 Thursday 6 Friday 7 iol Printer not ready X Signal status irrelevant for the other half byte Example Evaluating the printer status The module is installed in slot 7 initial address 120 If the printer is not ready for operation output 4 1 is set FEHLER1 tL KH 0010 L IEW 120 AW JZ M001 S A M001 BE GWA 4NEB 812 6030 02b Evaluting Printer status Compare status byte with 10g Combine word wise If zero jump to label 001 If not zero set output 4 1 Block end 6 37 Print Mode CP 521 Date and time of day bytes 1 to 7 in the PII Date and time of day bytes 1 to 7 in the PII The printer status is specified in byte 1 bit 4 This information is independent of the current day of the week which is specified in byte 1 bit O to 3 Table 6 15 Date and Time of Day 1 Sunday 2 Monday 3 Tuesday 4 Wednesday 5 Thursday 6 Friday 7 Saturday Printer ready Printer not ready Day m Month Hour 24h clock 12h clock a m 12h clock p m Note on byte 5 Hour Bit number 7 6 5 4 3 2 1 0 oes Te pT a m 0 p m 1 X Oor1 6 38 GWA 4NEB 812 6030 02b CP 521 Print Mode Example Reading the current time of day The module is installed in slot 7 initial address 120 The clock data is to be output on digital output modules from address 8 NAME UHRDATEN
59. XXXX m I I I I DTR ON I I I OFF i I I I I on L RTS i OFF I I I I I I I I I I I I I I i v 4g I RXD XXXXXXXX XXXXXXXX 0 I ON DSR l l OFF l l I I I I I our I ON CTS XXXX OFF EUN CP switched on I I I I 1max I I I I I p l 20 s CP reports data max I cannot be received I I 20s Peripheral device switched on Figure 2 4 Timing Diagram for Data Transfer Between the CP and the Peripheral Device 2 10 GWA 4NEB 812 6030 02b CP 521 Technical Description Example Peripheral device wants to send data Peripheral device only checks the DTR line If ON data may be sent CP ready to receive If OFF Sending of data must be interrupted CP not ready to receive 2 4 Memory submodule In print mode you require a user submodule which you must configure with the following data in off line mode using a programmer e Message texts in DB 2 to 63 This DB is independent of the DBs stored in the CPU The DBs in the user submodule and the DBs in the CPU may have the same numbers Printer interface parameters and configuration data for the message texts in DB 1 You can use two types of user submodule EPROM user submodule A UV erasing facility is required for erasing the submodule contents e EEPROM user submodule Submodule contents can be overwritten using a programmer Table 2 3 Overview of
60. ace holders for inserting message text KPa You want to store the following message texts in DB 7 Message text 70 The following overview indicates Insert message text 73 gt Insert message text 74 gt and Insert message text 75 gt Message text 73 the problems that have arisen during the monitoring period Message text 74 the measures taken Message text 75 the length of the resulting downtimes GWA 4NEB 812 6030 02b 6 25 Print Mode CP 521 70 The following overview Message text number separator message text indicates KP73 with place holder for Insert message text 73 KP74 and KP75 Message text end of text character 73 The problems which have Message text number separator message text arisen during Message text the monitoring period Message text end of text character 74 the measures Message text number separator message text taken Message text end of text character 75 the length of the Message text number separator message text resulting Message text downtimes Message text end of text character Printout of message text 70 including text expansions The following overview indicates the problems which have arisen during the monitoring period the measures taken and the length of the resulting down times 6 26 GWA 4NEB 812 6030 02b CP 521 Print Mode Maximum length of message texts Messages may not exceed 80 characters
61. ain unchanged e Job 90004 parameter block 0 Parameters of the serial interface for example changing the baud rate Job 9020g parameter block 2 Parameters for XON and XOFF protocol e Job 9070g 90714 and 9072 parameter block 7 Setting the mode Setting the printer mode with job 9070 Setting transparent ASCII mode with job 9071 Setting interpretive ASCII mode with job 90724 The data transferred to the CP with the Transfer parameter setting data job has priority over the data stored in data block 1 of the memory submodule After POWER ON the parameter setting data on the memory submodule is valid as long as it is not overwritten by the user program 6 44 GWA 4NEB 812 6030 02b CP 521 Print Mode 6 6 1 Printing the Message Text Job 304 and 40g After the Print out message text XY job the CP 521 transfers message text XY to the printer You specify whether the printer is to execute line feed LF or carriage return CR after printing message text XY Prerequisites e You must have configured the message text to be printed on the memory submodule Assign a number to each message text when configuring it e You must have plugged the configured memory submodule into the CP 521 Operator inputs required Specify the message text number in hexadecimal form in byte 1 e Specify the job in byte 0 Job 30g Print message text with CR LF Job 40g Print message text without CR LF Additional input
62. and operation of this equipment and f the hazards involved In addition the person substantial property damage will result if proper precautions are not taken should have the following qualifications i WARNING Be trained and authorized to use and tag circuits and equipment in accordance Indicates loss of life severe personal injury or with established safety practices substantial property damage can result if proper precautions are not taken Betrained in the proper care and use of protective equipment in accordance with CAUTION established safety practices Indicates minor personal injury or property damage can result if proper precautions are not Betrained in rendering first aid taken STEP 5 and SIMATIC are registered trademarks of Siemens AG Copyright Siemens AG 1989 Third Edition September 1989 Printed in the Federal Republic of Germany GWA 4NEB 812 6030 02b Preface Introduction System Overview Technical Description Hardware Installation Notes on Operation Principle of Operation and Adressing Print Mode ASCII Mode ASCII Code Table Appendices GWA 4NEB 812 6030 02b CP521 Preface Preface The CP 521 is a powerful printer ASCII communications module for the S5 100U programmable controller To be able to make the best use of the module you require detailed information The performance of the 5 1 OOU is constantly being increased For this reason the manual of the 5 100U
63. ansfer and Error Message Evaluation 6 40 6 1 Contents of the Parameter Blocks 5 6 5 6 2 Parameter Setting Data for the Serial Interface Parameter Block 0 0 000 cee eee ee 6 8 6 3 Parameter Setting Data for the Serial Interface Parameter Blocks 1 and2 000 eae eeeee 6 10 6 4 Configuration Data for Entering Message Texts Parameter Block 3 0 000 cece eee 6 11 6 5 Configuration Data for Message Text Printout Parameter Blocks 4 to 6 0 00 cece eee eee 6 12 6 6 Page Format noch ashen eied rahe des As EID datewiad 6 13 6 7 Operating Modes and Parameters for ASCII Mode Parameter Block 7 00 000 cece eee eee 6 15 6 8 Overview of Place Holders Configurable in Message Texts 00 c cee eee eee 6 22 6 9 Data Formats for Variables 000 eee eaee 6 29 6 10 Typical KT Data Format Printouts 6 30 6 11 Typical KFa b Data Format Printouts 6 31 6 12 Data from the Module tothe CPU 000 6 34 6 13 Status of the Module in Print Mode Byte O inthe PI 0 0 0 eee eee 6 35 6 14 Status of the Printer and Day of the Week 6 37 6 15 Date and Time of Day 0002 e eee 6 38 6 16 Permissible Jobs in Print Mode Byte 0 in the PIQ 6 41 6 17 Transfer of Additional Input in the Case of the Print Message Text Job iiisulsliislsls
64. ansfer write job AOy into byte O of the PIQ This defines the meaning of bytes 1 to 7 Table 7 25 Coordination Job Coordinate data transfer Receive message receive bit s mum ENL CNN sm Te ewer fo 7 Irrelevant Byte 1 You give permission to receive for a message by setting bit 7 1 This initiates data transfer The CP 521 resets this receive bit after a complete receive message has been sent to the CPU 7 42 GWA 4NEB 812 6030 02b CP 521 ASCII Mode CP response to job A0804 If the CP 521 receives job AOH Coordinate data transfer with receive bit 80g Receive message set and if there are no errors the CP 521 acknowledges the CPU job request with 6Xy in byte 0 Table 7 26 Data transfer Receive the 1st Data Block Data transfer from the CP 521 to the CPU H Number of the 1st data block Byte 1 Indicates the number of the data block which the CP 521 is transferring to the CPU The CP 521 increments the block number by 1 continuously starting with block Olp for as long as it is transferring a data block to the CPU Byte 2to 7 Data which is transferred from the CP 521 to the PII GWA 4NEB 812 6030 02b 7 43 ASCII Mode CP 521 CPU acknowledgement CO The CPU acknowledges input of the data block with CO in byte 0 Table 7 27 Acknowledging the 1st Data Block Acknowledges entry of the 1st data block Number of the data block Irrelevant Irrelevant Byte 1 Number of t
65. arameter block 5 64 lines page 10 characters left margin Page number bottom Block separator Parameter block 6 Header 1 Test operation End of text character Footer 1 End of text character 6 17 Print Mode CP 521 6 3 6 Parameter Setting with the PG 615 Programmer Parameters must be entered in DB 1 on the memory submodule All parameters must be entered in ASCII code KH hexadecimal constant It is advisable to use a list showing alphanumeric characters next to their ASCII codes Chapter 8 contains an ASCII code table showing the hexadecimal value of ASCII characters After entering the data transfer DB 1 to the memory submodule Example Setting DB 1 parameters Storing the same parameters in DB 1 as in the previous example but without comments Block separator parameter block 0 2400 baud 6 even parity 0 No BUSY signal 0 RS 232 C V 24 interface 1 7 data bits 0 Handshake OFF 0 Block separator parameter block 2 XON character DC1 114 XOFF character DC3 134 Block separator parameter block 5 64 lines page 4041 10 characters left margin 0Au ASCII code for U filter byte Block separator margin parameter block 6 Header H1 ASCII code for TE ASCII code for ST ASCII code for BE ASCII code for TR ASCII code for IE ASCII code for B space End of text character footer F 1 ASCII code for L ASCII code for AB ASCII code for OR End of text
66. ariables and further message texts can be inserted in a message text by configuring place holders e Control characters You can enter control characters for printer functions double width characters subscript 6 20 GWA 4NEB 812 6030 02b CP 521 Print Mode Example Configuring message texts without place holders You want to store the following message texts in DB 2 Message text 4 Excess temperature Message text 5 Coolant loss 4 Excess temperature Message text number 4 Separator message text End of text character Coolant loss Message text number 5 Separator message text End of text character GWA 4NEB 812 6030 02b 6 21 Print Mode CP 521 6 4 2 Entering Place Holders Place holders are used for inserting the date time of day variables and further message texts Some place holders can also be used in headers and footers The headers and footers are configured on the memory submodule in data block 1 parameter block 6 6 3 3 A place holder is enclosed between two function characters You can configure the function characters in data block 1 parameter block 3 The default value for the function character is 27g Wrongly entered place holders are treated as text Function character Place holder Function character Figure 6 4 Structure of a Place Holder Table 6 8 Overview of Place Holders Configurable in Message Texts tor T InsertTime of 1 Yes Day KPa Insert Unlimi
67. ble is outside the permissible range The clock has not accepted the new clock data and continues to operate with the old data Illegal job 4X A job which is illegal in ASCII mode has been written into word O of the transfer memory You will find an overview of permissible jobs in ASCII in 7 5 GWA 4NEB 812 6030 02b 7 61 GWA 4NEB 812 6030 02b CP 521 ASCII Code Table 8 ASCII Code Table Hex ASCII Hex ASCII Hex ASCII Hex ASCII 00 02 STX 03 ETX 04 EOT 05 ENQ 06 ACK 07 BEL C2 N N Oo oa A BS GWA 4NEB 812 6030 02b 8 1 ASCII Code Table CP 521 ASCII Code Table Continued Hex ASCII Hex ASCII i Hex ASCII Hex ASCII A ine ii ol PO Q D o w OJO a ao RIO do o o RIO ajo m ol o c n a o lt aiii Alco IQ a a a oo C1 wl r gt o oj n N lt x s o l Q c UO z r c a m O Tech 2ialigigigieg o co 2 ALT MODE DEL RUB OUT O a T I 8 2 GWA 4NEB 812 6030 02b A 1 A 2 A 3 A 4 A 5 A 6 A 7 CPU Jobs PIQ 0 0c eee ee ee eee eens A 1 CP Responses PII LLLl u l s A 3 Parameter Setting Data for Print Mode User Submodule Ll luul us A 6 Parameter Setting Data for ASCII Mode User Program ou lel De EV A 9 Slot Adressing leeseeeeeeeeeeee A 12 Status Message and Error Messages
68. character filler byte without meaning 6 18 GWA 4NEB 812 6030 02b CP 521 Print Mode 6 4 Configuring Message Texts You can store up to 255 message texts in data blocks 2 to 63 on the memory submodule Every message text may be up to 80 characters long including variables Memory submodule capacity must be taken into account The message texts can be distributed over several data blocks in any sequence You can store the message text in any data blocks e g message text 13 in DB 20 message texts 5 and 18 in DB 7 e You can enter the DBs on the programmer in any order DB 17 DB 3 The message texts within a DB should follow immediately on one another Your message texts will be clearer if you exchange KS and C in each new input line and if the message texts are separated from each other by pressing the Enter key Figure 6 3 e The DBs in the memory submodule are independent of the DBs in the CPU For example you can store message texts in DB 54 on the memory submodule while simultaneously using a DB 54 in the user program 6 4 4 Structure of a Message Text When configuring message texts you must keep to the following structure otherwise a correct printout cannot be guaranteed I I I Message Separator ASCII characters End of text text ay of the message character number text Default 1 to 255 Place holder for date time variables and message texts as wel
69. cified in ASCII mode Entering the parameter blocks Using the programmer PG you must first enter in DB 1 all those parameter blocks which deviate from the default values Then transfer DB 1 to the memory submodule Further tips for input When entering text change the data format from KS to C in alternate lines e You can enter comments in addition to the parameter blocks Schematic for entering parameter blocks Parameter blocks can be entered in DB 1 according to the following schematic Block separator Parameter block Configuration 8A number data H Figure 7 2 Schematic for Entering Parameter Blocks in DB 1 7 14 GWA 4NEB 812 6030 02b CP 521 ASCII Mode The following pages contain the assignment of the parameter blocks and an input example Parameter block assignment for setting parameters with the memory submodule corresponds to PIQ assignment when setting parameters with the Table 7 7 Assignments for Parameter Block 0 Baud rate 110 Bd 200 Bd 300 Bd 600 Bd 1200 Bd 2400 Bd 4800 Bd 9600 Bd Parity Even Odd mark parity bit always 1 space parity bit always 0 None BUSY signal Interface TTY RS 232 C V 24 Data format 7 data bits 8 data bits HW handshake A pm do GWA 4NEB 812 6030 02b 7 15 ASCII Mode CP 521 Table 7 8 Assignments for Parameter Block 2 XON XOFF protocol XON character 00 to 7F FF no protocol FFFF XON XOFF protoc
70. data from the peripheral device the latter must maintain logic 1 on the RXD line otherwise the CP 521 will send the Permanent line break error message XD to the CPU e Transparent ASCII mode No XON XOFF protocol is possible in transparent ASCII mode Messages must be of fixed length It is not possible to transmit messages with endidentifiers Interpretative ASCII mode If you have programmed an XON XOFF protocol in ASCII mode the CP sends 20 bytes to the peripheral device before the 1 Kbyte receive buffer overflows XOFF The CP then only sends XON to the peripheral device again when the receive buffer contains more than 256 free bytes If the peripheral device sends more than 20 bytes after an XOFF from the CP the message data already received is rejected The CP sends the Receive buffer overflow error message XBy to the CPU Immediately after startup the CP 521 assumes that the communications parnter is ready to receive even if no XON is sent For the TTY interface logic 1 means Current For the RS 232 C V 24 interface logic 1 means U 3 V 2 8 GWA 4NEB 812 6030 02b CP 521 Technical Description RS 232 C V 24 interface with handshake ON The RS 232 C V 24 interface of the CP 521 can handle the following signals in handshake ON mode Table 2 2 Valid Control Signals of the RS 232 C V 24 Interface in Handshake ON Mode Outputs TXD Send data CP holds send line at logic 1 when not transm
71. de CP 521 Byte 1 Send coordination bit set If the coordination data is invalid the CP 521 resets the Send bit to 00y Byte 2 indicates whether the coordination data is valid 004 or invalid FF Byte 4 indicates how many messages max 100pec are stored in the receive mailbox of the CP As soon as data transfer has been coordinated 1 and 2 data transfer begins with job BOp 3 to 8 The CP 521 usually transfers the date and time of day to the CPU in bytes 1 to 7 6 6 If byte O has the value 5Xy or 6Xy you must not interpret these values as the time of day 7 26 GWA 4NEB 812 6030 02b CP 521 ASCII Mode CPU job request Send data BO After you have output job AO and received the corresponding acknowledge ment from the CP 521 output job B001 amp with the 1st data block of the message PIQ Table 7 16 Data Transfer Sending the 1st Data Block Number of the 1st data block Byte 0 Job Send data After this job BOy the CP 521 interprets bytes 2 to 7 as data Byte 1 Indicates the number of the data block being transferred here 1 You must increment this block number in your user program beginning at 014 each time you send a data block to the CP 521 This continues until the whole data message has been transferred to the CP 521 GWA 4NEB 812 6030 02b 7 27 ASCII Mode CP 521 CP response to job B0014 The CP 521 acknowledges the Send 1st data block of the message
72. e is framed in rectangles All data in connection with the programmer refers to the English version of the PG 615 and PG 685 The relevant user manual contains a detailed description of programming procedures with this programmer Alle Angaben zu den Programmierger ten beziehen sich auf die deutschen Versionen des PG 615 und PG 685 Eine ausf hrliche Beschreibung der Pro grammierung mit diesen Ger ten finden Sie in den zugeh rigen Bedienungs anleitungen Manuals can only describe the current version of the programmer Should modifications or supplements become necessary in the course of time a supplement will be prepared and included in the manual the next time it is revised The relevant version or edition of the manual appears on the cover The present manual is edition 2 In the event of a revision the edition number will be incremented by 1 At the end of the manual you will find correction forms Please enter in these forms any suggestions you may have in the way of improvements or corrections and send them to us Your comments will help us to improve the next edition GWA 4NEB 812 6030 02b ix Introduction CP 521 Courses Siemens provide SIMATIC 55 users with extensive opportunities for training For more information please contact your Siemens representatives Reference literature This manual is a comprehensive description of the CP 521 Topics not specific to the CP 521 however are only briefly dea
73. e not continued after restoration of the connection Activated print jobs are completed after restoration of the connection Activated print jobs are not continued after restoration of the connection GWA 4NEB 812 6030 02b CP 521 Notes on Operation 4 2 2 ASCII Mode Operation may be interrupted for various reasons in ASCII mode The following table lists the effects of the faults Interruptions in Operation ASCII Mode Table 4 5 Data traffic continues between CP and peripheral device This can lead to overflow of the Receive mailbox CPU stops POWER OFF Send and receive message data are lost CPU Battery backup available Clock data is retained not available Clock data is lost Fault in CP Data is corrupted during transmission peripheral or in both directions POWER OFF CP error message peripheral Character delay time error after device character time out Peripheral device not ready after 20s If you operate the RS 232 C V 24 interface without handshaking Handshake OFF the CP 521 cannot detect a break in the connection between the CP and the peripheral device GWA 4NEB 812 6030 02b 4 5 5 1 Monitoring of the CP 521 by the CPU 5 1 5 2 Addressing 220i oti Shee 9 be DRE 5 5 2 1 Slot Addressing 0 0 0 c cece eee 5 Wow GWA 4NEB 812 6030 02b 5 1 General Functional Description
74. e settings in bytes 1 to 7 and then the Set clock job 10H in byte O to the CP 521 Settings You must note the following with regard to settings The settings must be transferred in BCD code to the CP 521 e f you enter the value FFH in one of the settings the current time remains e 01 Sunday 02 Monday 03 Tuesday 04 Wednesday 05 Thursday 06 Friday 07 Saturday e AM PM flag only with 12h clock When specifying Hours settings in byte 5 you must take account of the AM PM flag bit 7 in the case of the 12h clock bit 7 2 1 p m and bit 7 0 a m B 6 50 GWA 4NEB 812 6030 02b CP 521 Print Mode Table 6 20 PIQ in the Case of the Set Clock Job 24h clock DU 3 to 23 co 12h clock a m 01 to 12 BCD BCD 12h clock p m 81 op 10 92 05 Minutes 00 65 to SS acp Seconds Example Setting the time of day with the FORCE VAR programmer function The clock must be set with the following data Mo 03 13 00 00 24h clock The current data for month and year is to be retained The module is installed in slot 7 initial address 120 QW 126 KH 0000 Minute and second QW 124 KH FF13 Year retained and hour Set clock and day of the week GWA 4NEB 812 6030 02b 6 51 Print Mode CP 521 6 6 3 Setting the Page Numbers Job 20g When configuring the memory submodule you can specify if and where a page number is to be printed The default begins with page number 1 pr
75. eJji eAieoeJ pues OSV OSV Haz 10 Haz 10 ON ON Hog 410 ZZ LL oz x9o q eyeq x9o q eyeq Z 901g Z 901g z 4901 0 001g 09 0g 0v 06 06 06 jueuieDpe SJ9jouJ 19 0W 19 0W 19 0W MOUy9e JojsueJ JoJsueJ ejep e1ed esed esed esed Ndd ejep aynodexy eojeuip1002 oo2epejui eoejojul o2epuejui eoejiojul les les les les panunuod Old sqor ndo CP 521 Summary A 2 CP Responses PIl Nem 0 0j o ojojo o o No error Clock defective Memory submodule not plugged in or empty Default time set 0 1 No message text configured or memory submodule empty Job error illegal job Not used Coordination information 1 1 X X X X X X Not used Data transfer 1 1 0 1 1 0 Message text No not CP CPU configured Not used CP backup battery missing Hardware error CPU job not accepted CP clock data invalid LUCERE PES i PE ii per i hhh a aa Receive after XOFF or after DTR 0 Message length gt 265 bytes 11 111 1 1 1 0 Receive mailbox overflow GWA 4NEB 812 6030 02b Permanent breaks on peripheral line A 3 Summary CP 521 CP Responses PII Continued Peripheral device ready Peripheral device not ready Sunday Monday Tuesday Wednesday Thursday Friday x X X KX X X KX o ojo x X X X X X KX o oja oO oO O O O O O X x o Saturday Permission to send eo O 7 0 0 X X X X X X X T o o Permission to
76. eee ah S m I ee 7 79 87 95 103 111 119 127 Initial address of a slot The eight bytes reserved per slot 0 to 7 have a fixed meaning The byte numbers given in this manual always refer to the initial address of the slot in each case Consequently in your control program you must add the initial address of the slot containing the module to the byte numbers specified Example Module in slot 3 byte 2 has address 90 Module in slot4 byte 2 has address 98 Byte 0 of the PIQ Job defines the meaning of bytes 1 to 7 in the PIQ See Chapters 6 and 7 for more detailed information on the meaning of the bytes in print mode and in ASCII mode GWA 4NEB 812 6030 02b 5 3 6 1 G eral E ne en e ma Qa ex ea tre 6 6 2 Prerequisites for Operating in Print Mode 6 6 3 Setting the CP 521 Parameters in Print Mode 6 6 3 1 Setting the Serial Interface Parameters Parameter Blocks 0 1 and 2 002000 ee aee 6 6 3 2 Configuration Data for Entering Message Texts Parameter Block 3 0 0 0 cece eee 6 6 3 3 Configuration Data for Message Text Printout Parameter Blocks 4 to 6 0 000 e eee eee 6 6 3 4 Setting the Mode Parameters Parameter Block 7 6 6 3 5 Parameter Setting Example for the CP 521 in Print Mode sese 6 6 3 6 Parameter Setting with the PG 615 Programmer 6 6 4 Configuring Message Texts 6 6 4 1 Structure of a Message Text
77. en into the message buffer if required Job 80 Printout of all messages is executed immediately The message text numbers are also printed out with CPU job 80H GWA 4NEB 812 6030 02b 6 41 Print Mode CP 521 Printing the message text with and without CR LF at the end job 304 and 4304 You must specify the message number in hexadecimal form in byte 1 The Print message text without CR LF job allows you to print several message texts in one line If your configured message texts contain for example only variables you can generate tables with this job Permissible inputs with the job Print message text job 304 and 404 The following can also be transferred to the CP 521 in bytes 2 4 and 6 when using the Print message text job job 304 and 40g Values of variables When the message text is printed out the values transferred to the CP 521 are inserted in place of the place holders configured in the message text Table 6 17 Transfer of Additional Input in the Case of the Print Message Text Job 2 Value of variable 1 0000 to FFFF 243 4 Value of variable 2 0000 to FFFF 445 6 Value of variable 3 0000 to FFFF 6 7 6 42 GWA 4NEB 812 6030 02b CP 521 Print Mode Setting the clock job 10 Specify settings in BCD code in bytes 2 to 7 Enter weekdays as digits between 1 and 7 1 Sunday 2 Monday 7 Saturday If any clock data is to remain unchanged enter the value FFH in the
78. evice has sent more characters than the CP can accomodate in the receive mailbox The message is not transferred to the CPU and not stored in the receive mailbox Message lengths greater than 256 bytes XC The peripheral device has sent a message which is longer than 256 bytes The CP outputs error message XCy if it has not detected an end of text character after receiving 256 characters The message is not tansferred to the CPU and not stored in the receive mailbox Permanent wire break on the peripheral device line XD The peripheral device must hold the RXD amp line constantly at logic 1 hold the CTS amp line constantly at ON U 3V when using MODEM control signals while sending Otherwise an error message is output Receive mailbox overflow XEp The following can be stored in the receive mailbox e Up to 1024 bytes of data e Up to 100 messages If these values are exceeded when receiving a message from the peripheral device the CP outputs an error message The message is not transferred to the CPU and not stored in the receive mailbox Coordination information 5X The CP outputs this message in response to the Coordinate data transfer job Bytes 1 to 7 contain moere detailed information on data transfer 7 4 1 7 60 GWA 4NEB 812 6030 02b CP 521 ASCII Mode Default time set 2X5 The clock is set with the values Sunday 01 01 89 112 00 00 Time date error 3Xg At least one manipulated varia
79. g Printer not ready to receive negative potential Figure 3 6 Pin Assignment of the RS 232 C V 24 Interface Print Mode 3 6 GWA 4NEB 812 6030 02b CP 521 Hardware Installation 3 5 2 ASCII Mode The CP 521 assumes a peripheral device with an RS 232 C V 24 or active TTY interface Terminal diagram of the CP 521 TTY passive CP 523 TTY active CP 521 CP 523 TTY IN 6 TTY OUT TTY OUT 10 TTY OUT 12 Figure 3 7 Pin Assignment CP 521 TTY Passive CP 523 TTY Active Point to Point Connection GWA 4NEB 812 6030 02b 3 7 Hardware Installation CP 521 Terminal Diagram of the CP 521 CP 521 RS 232 C V 24 CP 521 CP 521 RS 232 C V 24 RXD 5 G 11 RS 232 C V 24 TXD RS 232 C V 24 TXD 11 lt 5 RS 232 C V 24 RXD DSR 7 L 15 DTR DTR 15 L 6c 7 DSR CTS 9 L e 9 CTS RTS 13 L oj 13 RTS GND 2 21 23 iG 2 21 23 GND Shield 24 25 24 25 Shield Figure 3 8 Pin Assignment CP 521 CP 521 with Handshaking If you use the RS 232 C V 24 interface the CP 521 cannot detect a Permanent wire break You are therefore recommended to set handshake ON 3 8 GWA 4NEB 812 6030 02b Restart Characteristics eee e eee eneae 4 1 1 Checking the Module 0 0 0 c eee eee eee 4 4 1 2 Memory Submodule Evaluation 200 04 A 4 1 3 Glock Test solem Shaina a Geel quw reta 4
80. ges with which the CP 521 acknowledges CPU job requests 7 5 1 Permissible CPU Job Requests in ASCII Mode Table 7 31 Permissible Jobs in ASCII Mode Set clock Transfer parameters Parameter block Transfer parameters Setting Print mode Setting Transparent ASCII mode Setting Interpretive ASCII mode Coordinate data transfer Coordinate Send data transfer Coordinate Receive data transfer Execute data transfer Block No Coordinate CPU CP data transfer BlockNo CPU acknowledgement Received data transferred 7 54 GWA 4NEB 812 6030 02b CP 521 ASCII Mode 7 5 2 Illegal Jobs with Error Messages If data has not yet been transferred and you write a job in word 0 of the PIQ byte O and byte 1 other than the job executed above the CP 521 stores an error message in the status byte PII The following are illegal jobs in ASCII mode which are acknowledged with the error messsge 4Xy All jobs concerned exclusively with print mode 204 304 404 50H 604 70y 804 e All job numbers outside the permissible value range for CPU job requests DOW to FFy e Job number 90XXy if the parameter blocks are initialized with data from outside the permissible value range Job number BOXXy if data transfer has not previously been initiated CPU job requests transferred to the CP during a data transfer must belong to the data traffic All jobs other than 004 and BOW block number cause data t
81. he data block which the CPU has received here 01 The acknowledged block number must agree with the number of the block sent otherwise data transfer will be aborted The CP 521 continues to send a data block to the CPU until it receives acknoledgement For this reason the CPU receives the data of the acknowledged block from the CP 521 once more within the same data cycle in which it was acknowledged The CPU program must take account of this or the CP 521 will receive an acknowledgement with the wrong block number and data transfer will be aborted 7 44 GWA 4NEB 812 6030 02b CP 521 ASCII Mode Data transfer continues in the manner described till the CPU has acknowledged the last data block of a message The CP 521 terminates data transfer with a final reponse CP response to the CPU acknowledgement COy Table 7 28 Data Transfer Receive the 25th Last Data Block o ox Data transfer from the CP 521 to the CPU Number of the last data block here 25D GWA 4NEB 812 6030 02b 7 45 ASCII Mode CP 521 CPU acknowledgement for the 25th data block Tabelle 7 29 Acknowledgement for the 25th Data Block 0 co Acknowledges entry of the last data block Number of the 25th data block Pe wwe OO O a a pree Ps wean Pe wean 7 wean 7 46 GWA 4NEB 812 6030 02b CP 521 ASCII Mode Final response from the CP 521 Table 7 30 Final Coordination Information ola Coordination info
82. in length If you use place holders the printout may be longer than 80 characters The maximum length of the printout is 250 characters Example Configuring a message text with place holders for inserting message text You want to store the following text in DB 9 Message text 90 The following table gives an overview of Insert message text 91 Insert message text 92 and Insert message text 93 gt Message text 91 faults occurring in the press controller with downtimes Message text 92 the resulting waiting times of the next press controller Message text 93 average press controller downtimes during the current year 90 the following Message text 90 with a length of table gives an overview 68 characters of KPO1 KP92 and KP93 91 the faults occurring in Message text 91 with a length of the press controller with 57 characters down times 92 the resulting waiting Message text 92 with a length of times of the next press 55 characters controller S 93 average press control Message text 93 with a length of ler downtimes during th 57 characters This text will not be printed GWA 4NEB 812 6030 02b 6 27 Print Mode CP 521 Final printout The following table gives an overview of the faults occurring in the press controller with downtimes the resulting waiting times of the next press controller and average press downtimers 190 characters
83. inputs required Specify byte 0 in job 80g Example Printing out all configured message texts with the FORCE VAR programmer function The module is installed in slot 7 initial address 120 aid ibd TOM 6 56 GWA 4NEB 812 6030 02b CP 521 Print Mode 6 6 8 Transferring Parameter Setting Data Job 90XXy The parameter setting data of the serial interface is stored on the memory submodule in parameter blocks 0 2 and 7 of data block DB 1 Configure the user submodule before operation During operation you can do the following with job number 90g Set new parameters for the serial interface parameter block 0 Job 90004 Set the XON XOFF parameters parameter block 2 Job 90204 Set the operating mode and parameters parameter block 7 Job 90704 Print mode 90714 Transparent ASCII mode 90724 Interpretive ASCII mode Operator inputs required e Specify the parameters of the parameter block to be changed in bytes 2 to 7 e Specify the number of the parameter block to be changed and the job in byte 0 The Transfer parameter setting data job is more or less insignificant in print mode since the configuration data for print mode is stored on the memory submodule in DB 1 A typical practical application would be if you want to replace a defective printer at short notice by another printer whose interface must be differently initialized The job does not change the contents of the memory submodule on the CP 521
84. int Mode CP 521 6 6 5 Outputting Line Feed Job 60g When instructed by the CPU the CP 521 orders the printer to output line feed Operator inputs required Specify job 60g in byte 0 Example Outputting line feed The module is installed in slot 7 initial address 120 Line feed is to be output on the printer Transfer Output line feed job in byte 0 When job 50g Output page feed is assigned job 60y the message buffer is deleted and is no longer executed 6 54 GWA 4NEB 812 6030 02b CP 521 Print Mode 6 6 6 Deleting the Message Buffer Job 70g When instructed by the CPU the CP 521 deletes all CPU jobs stored in the message buffer You can delete the message buffer in two ways e Inthe user program n RUN mode with the FORCE VAR programmer function Operator inputs required Specify job 70H in byte 0 Example Deleting the message buffer with the FORCE VAR programmer function The module is installed in slot 7 initial address 120 GWA 4NEB 812 6030 02b 6 55 Print Mode CP 521 6 6 7 Printout of All Configured Message Texts Job 804 When instructed by the CPU the CP 521 prints out all configured message texts on the user submodule The message texts are printed as configured with message text number in ascending order Place holders are not evaluated You can assign the job in two ways e Inthe user program n RUN mode with the FORCE VAR programmer function Operator
85. int number is represented by at least a 1 characters Initial zeros are not repressed but replaced by spaces GWA 4NEB 812 6030 02b A 13 Device Configuration 0 0c eee eee eee B 3 Terminal Assignments for the RS 232 C V 24 Interface lt i cai oat cle Pees 54 neti os Gis Ge B 2 B 4 Setting the Parameters on the Serial Interface otthe CP 521 seus olo lie eI B 3 B 5 Programming the Programmable Controller B 4 B 6 Programming Blocks DBs FBs OBs B 5 Testing an Example Program sse GWA 4NEB 812 6030 02b B 1 B 2 Configuration Schematic Point to Point Connection of Two S5 100US i o ee B 1 CP 521 CP 521 Terminal Assignments with Handshake 0 00 c cece eee ete B 2 Setting the CP 521 Parameters in Interpretive ASCII Mode 0 0 cee eee B 3 GWA 4NEB 812 6030 02b CP 521 Application Example B Application Example B 1 Task Two S5 100U programmable controllers are to exchange six bytes of data For this purpose a point to point connection is established between both PCs ASCII mode Both PCs contain a program for sending and receiving data messages B 2 Device Configuration The device configuration is shown in Figure B 1 Both CP 521s are installed in slot 0 and linked via an RS 232 C V 24 cable incl handshake CPU 100U CP 521 Simul Simul DI DI CPU 100U CP 52 V Simul Simul D
86. inted at bottom centre of the page You can change this default in the following ways You can change this default in the following ways e Inthe user program e In RUN mode with the FORCE VAR programmer function Operator inputs required e Specify the page number in byte 1 01g to FFg e Specify job 20g in byte 0 Example Setting page numbers with the FORCE VAR programmer function The module is installed in slot 7 initial address 120 The following pages are to be printed beginning with page number 20 QW 120 KH 2014 Transfer Set page numbers job and page number 14y 20p to word 0 6 52 GWA 4NEB 812 6030 02b CP 521 Print Mode 6 6 4 Outputting Page Feed Job 50g When instructed by the CPU the CP 521 orders the printer to output page feed Page feed is implemented by executing the number of line feeds configured parameter block 5 Page format lines per page Operator inputs required Specify job 50g in byte 0 Example Outputting page feed The module is installed in slot 7 initial address 120 Page feed is to be output on the printer Transfer Output page feed job in byte 0 The CP stores print jobs in a message buffer if they cannot be executed immediately because the CP is still busy with a previously assigned print job When the Output page feed job is assigned job 60y Output line feed in the message buffer is deleted and is no longer executed GWA 4NEB 812 6030 02b 6 53 Pr
87. is plugged into the CP 6 4 3 Message text 9 is to be printed if flag 20 0 is set The following program prints message text 9 only once If you want to print message text 9 again you must write another value into word 0 e g KF 0 and then set 9 again so that it will be detected as a change in word 0 Edge triggered job processing 6 5 2 TEXT1 AN F If flag 20 0 is not set the program is terminated BEC L KH 3009 Load ACCUM 1 with job number 30g and T QWs 120 message text number 9 and transfer to the CP in word 0 Block end GWA 4NEB 812 6030 02b 6 47 Print Mode CP 521 Example Initiating output of a message text with job monitoring CP responses are evaluated The CP 521 is installed in slot 7 initial address 120 Message text 1 I 5 0 or 2 1 5 1 is to be output if input 5 0 or 5 1 changes its signal state from 0 to 1 If 15 0 is 1 flag 5 0 is set If 15 1 is 1 flag 5 1 is set If 15 0 and flag 6 0 are 1 flags 5 0 and 6 0 are reset If 15 1 and flag 6 1 are 1 flags 5 1 and 6 1 are reset If flag 7 0 or 8 0 is 1 the program jumps to label 003 Flag 7 0 or 8 0 is then set if a print job has been activated and the job has not yet been transferred In this case a further job is flagged F 5 0 or F 5 1 but not yet transferred to the module If flag 5 0 is set and flag 6 0 is not set the program jumps to label 001 job 1 transferred to the module If flag 5 1 is
88. is used if the value entered exceeds this value Example Example Input Lines per page 10 is replaced by 20 Input left margin 80 is replaced by 3Cy Entering the parameter blocks You must first enter all the parameter blocks you want to change in DB 1 using the programmer Then transfer DB1 to the memory submodule 1 Transfer total contents of the memory submodule from the memory submodule to the programmer diskette hard disk Delete memory submodule Change DB Transfer total memory contents back to the memory submodule 6 6 GWA 4NEB 812 6030 02b CP 521 Print Mode Further tips for input e When entering text change the data format from KS to S and vice versa in each line You can enter comments in addition to the parameter blocks Schematic for entering of parameter blocks The parameter blocks can be entered in DB 1 according to the following schematic Block separator Parameter block Configuration 3A number data Figure 6 1 Schematic for Entering Parameter Blocks in DB 1 Parameter blocks 0 2 and 7 can also be initialized in the user program Parameters set in the user program have priority over those set in the memory submodule 7 3 1 The parameter setting data in the memory submodule is valid after POWER ON as long as it is not overwritten by the user program GWA 4NEB 812 6030 02b 6 7 Print Mode CP 521 6 3 1 Setting the Serial Interface Parameters Parameter B
89. its 8 bytes from the CPU to the CP 521 and 64 data bits 8 bytes from the CP 521 to the CPU The CP 521 has three interfaces An interface to the I O bus Passive TTY and RS 232 C V 24 interface to the peripheral device A receptacle for a memory submodule The serial interface transfers data between the module and the peripheral device Compatible peripheral devices Keyboard Printer with active TTY interface Terminal Printer with RS 232 C V 24 interface A further CP 521 CPU 944 ASCII interface CP 523 The memory submodule is only required in print mode and contains the parameters for the printer interface and the message texts For permissible memory submodules see list of accessories 2 7 5 2 GWA 4NEB 812 6030 02b CP 521 Principle of Operation and Addressing 5 2 Addressing The CP 521 is addressed like a 4 channel analog module Please note the following The module may only be plugged into slots O to 7 slot 7 is not permitted with CPU 102 6ES5 usw and CPU 103 6ES5 usw The address space extends from 64 to 127 Eight bytes are reserved per slot in the process input image PII and in the process output image PIQ 5 2 1 Slot Addressing Data from the module to the CPU is written into the specified address space of the PII Data from the CPU to the module is stored in the same addresses in the PIQ Table 5 1 Slot Addresses ESTIS ea 2o 4s e Ete ER
90. itting U 3V DTR Data Terminal Ready ON CP 521 switched on ready to receive OFF CP 521 not switched on not ready to receive RTS Request to send CP 521 in send mode OFF CP 521 not sending Inputs RXD Receive data Receive line must be held at logic 1 by the peripheral device U 3 V ON DSR Data set ready ON Peripheral device switched on ready to receive OFF ON Peripheral device not switched on not ready to receive CTS Clear to send Peripheral device can receive characters from the CP 521 The CP expects this as reply to RTS ON OFF Peripheral device cannot receive characters from the CP 521 An XON XOFF protocol is not possible if you evaluate the control signals handshake ON GWA 4NEB 812 6030 02b 2 9 Technical Description CP 521 Data transfer between the CP and peripheral devices takes place as follows The CP 521 sets the DTR output after startup This indicates that it is ready to operate and receive Example The CP wants to send data 1 CP waits till DSR ON If the peripheral device still has not set DSR to ON after 20 s the CP reports the error to the CPU peripheral device not ready 2 CP sets RTS 3 CP waits till CTS ON If the peripheral device still has not set CTS to ON after 20 ms the CP reports the error to the CPU peripheral device not ready CP sends data CP resets RTS after sending data Peripheral device sets CTS to OFF 4 TXD XXXXXXXX XXXX
91. job as follows PII Table 7 17 Acknowledging the 1st Data Block Acknowledgment of job Send data Send coordination bit set if data valid B O 9 NUN 3 Number of 1st data block Number of messages in receive buffer max 100 mem fo 6 mean 7 Irrelevant All the bytes in the data block except byte 3 have the same meaning as in Table 2 Byte 3 Indicates the number of the data block which the CP 521 has just received here 1 Please note that the CP 521 only responds to a signal change in byte O or 1 of the PIQ Since job BO in byte O does not change as long as the data of a message is being sent it is imperative that you incrementthe block numbers in byte 1 until all data blocks of the message have been transferred If you send the wrong block number data transfer is stopped with the response 5000H and the CP 521 then signals Job error 4X4 in status byte 0 of the module The data is lost 7 28 GWA 4NEB 812 6030 02b CP 521 ASCII Mode If you send the next job BOH with incremented byte 1 5 the CP 521 acknowldges with incremented byte 3 6 CPU job request B0024 Number of the 2nd data block C CERE pa eta S O SD a 2 RENNES Le a a ae a E CP response to job B0024 Table fs 19 Acknowledging the 2nd Data Block ae ae Acknowledgement for job Send data Send coordination bit set if data valid Number of the 2nd data block 4 00 64 Number of messages in the receive b
92. jobs After you have set the interface parameters 90g 7 3 jobs AO and CO are relevant for receiving data Table 7 24 Table 7 24 Permissible CPU Job Requests when Receiving Data PIQ NE HN Data not relevant AO Coordinate data transfer Acknowledge CPU via data received Data is exchanged via the CP 521 in two steps First data transfer between the CPU and the CP 521 is coordinated Only then can the CP 521 transfer data to the CPU which it has received from peripheral devices and buffered in the receive mailbox Figure 7 4 illustrates the whole data transfer sequence when receiving data messages Data blocks of eight bytes each are represented as they are used when receiving messages The CPU job request and the relevant CP 521 acknowledgement change from block to block 7 40 GWA 4NEB 812 6030 02b CP 521 ASCII Mode Data transfers from the CP 521 to the CPU CPU nd 521 Byte 5 6 7 Coord Coord Irrelevant job byte REC Data Block Data trans number CPU CP 521 Ackn Block RM number CPU CP 521 FUE CP 521 6X nr nny nny nny nny nny nny Data Block trans number CPU CP 521 Irrelevant CPU CP 521 Coord Coord Data Irrel Number Irrelevant info byte valid of messages Figure 7 4 Sequence Schematic when Receiving Data GWA 4NEB 812 6030 02b 7 41 ASCII Mode CP 521 CPU job request Coordinate data transfer AOp To coordinate data tr
93. k data must be entered on power up A new lithium battery has a life of at least one year Battery failure is indicated by the yellow LED and signalled to the CPU in byte 0 Module status Lithium batteries cannot be charged Danger of explosion Used batteries must be properly disposed of 2 12 GWA 4NEB 812 6030 02b CP 521 Technical Description 2 7 Accessories List and Ordering Data Memory submodules EPROM memory submodule 8 Kbytes 6ES5 375 0LA15 EEPROM memory submodule 2 Kbytes 6ES5 375 0LC11 EEPROM memory submodule 8 Kbytes 6ES5 375 0LC31 Printer connecting cable You can use the same printer connecting cable that you use for connecting the programmer PG to the PT printer PT 88 RS 232 C V 24 6ES5 735 2BD20 PT 88 TTY 6ES5 736 0BD20 Printers See S5 11U Programmable Controller Catalog ST 52 1 Programmers See Programmer Catalog ST 59 Backup battery Backup battery lithium AA 3 6 V 850 mAh 6ES5 980 0MA11 GWA 4NEB 812 6030 02b 2 13 Mechanical Assembly 20000 e eee ee eens 3 2 Dimension Drawing ee eee eee 32 2 3 3 Connecting Peripheral Devices e 3 2 3 4 Protective Measures Against Faults on the Line llslsllesseessess 3 4 3 5 Typical Configurations lleeseseeee 3 5 3 5 1 Print mode sexes sx ER ACE S VD RS E a 3 5 ASCII Mode 00 00 cece ses 7 GWA 4NEB 812 6030 0
94. l as control parameters for the printer CR LF bold double width type etc E Enter key Figure 6 3 Structure of a Message Text GWA 4NEB 812 6030 02b 6 19 Print Mode CP 521 Message text number The message text is stored in the DB under a message text number 1 to 255 If you want to print a message text transfer the message text number and the Print message text job to the CP 521 in the user program 6 6 1 Separators After the message text number you must enter the separator ASCII characters in the message text You can enter up to 80 ASCII characters of message text If you enter more than 80 ASCII characters these are not evaluated The printout of the configured message text on the printer may be longer than 80 characters Example You are configuring a message text which is longer than 80 characters The message text includes place holders for the time of day This only requires three ASCII characters for input e g t On output the place holder is replaced by the actual time of day e g 15 00 00 8 characters The message text printed out is thus 85 characters long the printout of a message text is longer than 80 characters this might interfere with the print format depending on printer line feed page The following can be entered as ASCII characters Text The text can contain all printing characters see the manual of the printer connected Place holders The date time of day v
95. locks 0 1 and 2 Store the data for the serial interface in parameter blocks 0 1 and 2 Table 6 2 Parameter Setting Data for the Serial Interface Parameter Block 0 Baud rate Parity even odd Parity bit always 1 mark Parity bit always 0 space none BUSY signal Interface TTY RS 232 C V 24 Data format 7 data bits 8 data bits Hardware handshaking A EHE fo 6 8 GWA 4NEB 812 6030 02b CP 521 Print Mode Baud rates You have a choice of eight baud rates The default is 600 baud If you use the RS 232 C V 24 interface you must take the load capacity of cables longer than 15 m into account Longer cables can be used in general if the baud rate is reduced Parity You have a choice of five types of parity Even parity is the default e Even parity The parity bit is set so that the sum of the data bits that are 1 incl parity bit is even Odd parity The parity bit is set so that the sum of the data bits that are 1 incl parity bit is odd Mark The parity bit is always has signal state 1 Space The parity bit is always has signal state 0 No parity The signal state of the parity bit is not significant Parity is not checked BUSY Signal The printer generates the BUSY signal and reports when it is ready to receive The RS 232 C V 24 and TTY interfaces allow you to run a BUSY line and to evaluate the BUSY signal The BUSY signal is only relevant when operating
96. lt with You will find more detailed information in the following literature Speicherprogrammierbare Steuerungen SPS only available in German Volume 1 Logic and sequential controls from the control problem to the control program G nter Wellenreuther Dieter Zastrow Braunschweig 1987 Contents How a programmable controller works The theory of logic control using the STEP 5 programming language for SIMATIC 55 programmable controllers Order No ISBN 3 528 04464 0 Automating with the S5 115U SIMATIC 55 Programmable Controllers Hans Berger Second revised edition Siemens AG Berlin and Munich 1987 Contents STEP 5 programming language Program processing Integral program blocks Interfaces to the peripherals Order No ISBN 3 8009 1526 X GWA 4NEB 812 6030 02b CP 521 Introduction e Programming Primer for the SIMATIC R S5 100U Practical Exercises with the PG 615 Programmer Siemens AG Berlin and Munich 1988 Contents Assembly and installation of the S5 100U Introduction to programming with the PG 615 Order No ISBN 3 8009 1500 6 GWA 4NEB 812 6030 02b xi CP 521 Introduction Remarks Form The Remarks Form is provided for your comments and suggestions If you are in the United States please use the postage paid form Conventions The following conventions are used in this book and are listed for your reference Convention GWA 4NEB 812 6030 02b Definition Exa
97. meters for ASCII mode in parameter block 7 If you want to work in print mode this parameter block is insignificant for you since the CP 521 automatically sets print mode if a memory submodule is plugged in There must be at least one configured message text in the memory submodule If you want to change from print mode to transparent ASCII or interpretive ASCII mode during operation you can change parameter block 7 in the user program or with the programmer See 7 3 for more detailed information Table 6 7 Operating Modes and Parameters for ASCII Mode Parameter Block 7 Operating mode p Print mode Transparent ASCII mode Interpretive ASCII mode Character delay time 0001 to 3000 100ms 0001 100ms 4 digits decimal Message length 3 000 bis 256 bytes digits decimal If length 0 at least one end of text character must be entered End of message 1 End of text character character 01 to FF 2 End of text characters 01 toFF A Only significant in ASCII mode Only significant in interpretive ASCII mode GWA 4NEB 812 6030 02b 0 with memory submodule 1 without memory submodule 064 bytes OD carriage return 6 15 Print Mode CP 521 6 3 5 Parameter Setting Example for the CP 521 in Print Mode The CP 521 is plugged into slot 7 intitial address 120 You can set its parameters as follows Parameters for the serial interfac 2400 Baud Even parity No BUSY
98. mple A box that indicates a type of hazard describes its implications and tells you how to avoid the hazard is safety notation Some safety notation includes a graphic symbol representing an electrical or radio frequency hazard All safety notation has one of the following levels of caution Indicates that loss of life Severe personal injury or substantial property damage will result if proper pre cautions are not taken Indicates that loss of life Severe personal injury or substantial property damage can result if proper pre cautions are not taken Indicates that minor personal injury or property damage can result if proper precautions are not taken xiii REMARKS FORM Your comments and recommendations will help us to improve the quality and usefulness of our publications Please take the first available opportunity to fill out this questionnaire and return it to Siemens Only if you are in the United States of America should you use the postage paid form Returning this form assures you of receiving all changes and updates to this document Please check the industry that applies to you 1 Automotive O Pharmaceutical L Chemical L Plastic LI Electrical Machinery L Pulp and Paper LI Food L Textile O Instrument and Control O Transportation L Nonelectrical Machinery Other L Petrochemical 1 Is this document well organized Yes 2 Is the information easy to find Yes 3 Is the text easy to
99. n only be plugged in or unplugged when the power is OFF To guarantee trouble free printing make sure the 25 pin subminiature D female connector is only unplugged when the CPU is in STOP mode and data transfer between the CP and the printer has been completed When the power is switched off the battery provides backup for the clock data GWA 4NEB 812 6030 02b 4 3 Notes on Operation CP 521 4 2 1 Print Mode Operation in print mode may be interrupted for various reasons The following table lists the effects of faults Table 4 4 Faults in Operation Print Mode nee POWER OFF CPU Battery backup available not available 25 pin submin D connector unplugged Or or cable XON XOFF proto fault col BUSY line avail able and BUSY signal configured otherwise POWER OFF printer BUSY line available and BUSY signal configured otherwise XON XOFF protocol configured not configured 4 4 Activated print jobs are completed Activated print jobs are not continued Clock data is retained Clock data is lost Activated print jobs are completed after restoration of the connection Perfect print quality is not guaranteed e g smudged characters Activated print jobs are not continued after restoration of the connection Activated print jobs are completed after restoration of the connection Perfect print quality is not guaranteed e g smudged characters Activated print jobs ar
100. nection between the CP 521 and the peripheral device e f you have stored the parameter setting data in a memory submodule plug the memory submodule into the CP 521 You can then switch the CPU to POWER ON 4 Startup of the CP 521 in ASCII mode After POWER ON the CP 521 is automatically in transparent ASCII mode if the following applies e No memory submodule is plugged in Amemory submodule initialized with transparent ASCII mode is plugged in e Transparent ASCII mode has been transferred to the CP 521 from the user program You can set interpretive ASCII mode in the following ways Transfer interpretive ASCII mode to the CP 521 in the user program Plug a memory submodule initialized with interpretive ASCII mode into the CP 521 GWA 4NEB 812 6030 02b 7 3 ASCII Mode CP 521 Changing the mode during operation You can alternate between Print mode Transparent ASCII mode and Interpretive ASCII mode during operation ote that as soon as you either e Change from one mode to another or e Call up the programmed mode again via the user program the entire send and receive buffer is deleted To change the mode transfer job 90XXH Transfer configuration data to the CP 521 Remember that the parameters must agree with the settings on your peripheral device 7 4 GWA 4NEB 812 6030 02b CP 521 ASCII Mode 7 3 Setting the CP 521 Parameters in ASCII Mode The CP 521 is supplied with default values for
101. ngth on the receive device because the send length is not transferred in contrast to the end of text character In the case of a message length of 0 the CP evaluates the end of text character If both send length and end of text character are 0 there is a job error 7 24 GWA 4NEB 812 6030 02b CP 521 ASCII Mode If data is to be sent from the CPU to a peripheral device the parameters Send length and End of text character must be transferred with the send job When sending data with end of text characters these end of text characters are transferred also in both directions but the send length is not transferred For this reason the CP 521 setting must agree with the setting on the peripheral device CP response to job A001 When the CP 521 receives the Coordinate data transfer job AOy with send bit 01H Send message set and if there is no error the CP 521 acknowledges the CPU as follows PII Table 7 15 Coordination Information 24 Acknowledgement Coordination information Send coordination bit set Coordination data valid invalid 4 00 to 64 Number of messages in receive mailbox of the CP messages from the peripheral devices to be read by the CPU max 100 messages S elevam ES Q irrelevant Byte 0 Acknowledge job Coordinate Send data transfer Status messages and error messages can be stored in the lower half byte 7 5 GWA 4NEB 812 6030 02b 7 25 ASCII Mo
102. number Acknowledgement to CP 521 data block transferred Preset pointer in target DB with initial value 7 50 GWA 4NEB 812 6030 02b CP 521 ASCII Mode Block end L IW 120 Has data been transferred from the L KH FOOF CP 521 to the CPU 22 NO Store data received in the target DB The end codes read in with the data here ODODy are not transferred to the target DB An even number of data bytes must be received so that the end of text characters are in the same data word Transfer data block acknowledgement to the CP 521 The FB only runs with the CPU 103 The operation Process flag word DO FW is not included in the operation set of the CPU 100 and the CPU 102 GWA 4NEB 812 6030 02b 7 51 ASCII Mode CP 521 Increment the block number and the pointer in the target DB by 1 at 6XNR FW 22 and CONR FW 24 Data is being received Block end CP acknowledgement after transfer of the complete message error free NO 7 52 GWA 4NEB 812 6030 02b CP 521 ASCII Mode Prepare next message after positive acknowledgement Reset status flag Preset acknowledgements and target DB pointer with their initial values GWA 4NEB 812 6030 02b 7 53 ASCII Mode CP 521 7 5 CPU Job Requests and CP Error Messages in ASCII Mode All the CPU job requests permissible in ASCII mode are listed in this section There is also a complete list of error messa
103. number 32768 to 432767 Constant 32768 to 32767 Con 5 digit fixed point number figurable a Places before point 5 b Places after point 5 a b 5 The time is printed out in seconds GWA 4NEB 812 6030 02b 6 29 Print Mode CP 521 KT data format You can use data format KT to insert internal times D in the message text Load the time in BCD with L TX into the accumulator and then transfer it to the CP The four places are given in seconds s on the printer Table 6 10 KT Data Format Printouts avo e s ow 5 es os space KF data format If you configure the KF data format six characters are always printed out Example Printout of the KF data format u space KF 12345 12345 KF 357 357 KF 12345 12345 KF 357 397 6 30 GWA 4NEB 812 6030 02b CP 521 KFa b format You can set the following possible parameters e Specify the number of places before the point with a Specify the number of places after the point with b The sum of places before the point and places after the point must not exceed five Example Printout of the KFa b variables Table 6 11 Typical KFa b Data Format Printouts 0 07 0 01 0 00 0 00 0 007 0 001 0 000 0 0007 0 0001 0 00007 0 1 0 0 0 0 0 0 0 07 0 01 0 00 0 00 0 007 0 001 0 000 0 0007 0 0001 0 00007 2 6 2 6 0 3 0 3 0 0 0 0 0 0 0 0 2 56 2 56 0 26 0 26 0 03 0 03 0 00 0
104. ock 2 XON character DC1 11 XOFF character DC3 134 e Parameters for ASCII mode parameter block 7 Character delay time 3 s 0030 Variable message length with two characters for end code ODOD GWA 4NEB 812 6030 02b 7 17 ASCII Mode CP 521 We recommend the following procedure 1 Enter the parameter setting data on the programmer in DB 1 and include sufficient comments 2 Store in DB 1 on diskette or hard disk 3 Transfer DB 1 to the memory submodule Table 7 11 Setting the CP 521 Parameters in Interpretive ASCII Mode Parameters for the serial interface 0600100 Parameter block 0 2400 baud Even parity No BUSY RS 232 C V 24 interface 7 data bits Handshake OFF C Parameters for XON XOFF KS 2 i Parameter block 2 KH 1113 DC1 XON character C Parameters for ASCII DC3 XOFF character KS mode C 720030000 Parameter block 7 KH ODOD Interpretive ASCII mode 0030 Character delay time 30 x 100 ms 000 Message length 0 ODOD End of text character carriage return twice 7 18 GWA 4NEB 812 6030 02b CP 521 ASCII Mode 7 4 CPU Job Requests with CP Responses in ASCII Mode The CPU sends and receives messages in eight byte blocks The messages have a maximum length of 256 bytes Each block consists of a header code of two bytes coordination bytes and six bytes of data Maximum data throughput is 6 bytes of useful data
105. ol no XON XOFF XOFF character 00 to 7F protocol no protocol F H only possible in interpretive ASCII mode Table 7 9 Assignments for Parameter Block 7 Transparent ASCII Mode Parameter block number and code 0 if memory sub for Transparent ASCII mode module with message texts plugged in without memory submodule Character delay time 0001 to 3000 0001 100 ms four decimal digits Message length 001 to 256 064 three decimal digits 7 16 GWA 4NEB 812 6030 02b CP 521 ASCII Mode Table 7 10 Assignments for Parameter Block 7 Interpretive ASCII Mode Parameter block number and code for Interpretive ASCII mode Character delay time four decimal digits Message length three decimal digits End of text ASCII character character 1 No end of text character 0001 to 3000 000 to 256 oe to 7F 0 End of text ASCII character character No end of text character OD carriage return Example for operating in ASCII mode 01 to 7F 00 Using the PG 685 to set data parameters on the memory submodule The CP 521 is plugged into in slot 7 initial address 120 The module is to be operated in interpretive ASCII mode and is initialized as follows Parameters for the serial interface parameter block 0 2400 baud 6 Even parity 0 No BUSY 0 RS 232 C V 24 interface 1 7 data bits 0 Handshake OFF 0 Parameters for XON XOFF parameter bl
106. ombined with each other in any way e g 28 default time set CP busy This makes detailed error evaluation possible Table 7 35 Status Byte in ASCII Mode PII 9 e em ee s Gweeshenerrei amp Reve eror orero 0 Permanen wre break on perprene devos X Signal status for the other half byte irrelevant These error messages do not appear until after the coordination job Receive data for this message GWA 4NEB 812 6030 02b 7 57 ASCII Mode CP 521 Table 7 35 Status Byte in ASCII Mode PII Continued Clock defective Default time set Time date error Illegal job X Coordination information only after job Coordinate data transfer Data transfer from the CP 521 to the CPU 7 58 Hardware error X Signal status for other byte half irrelevant GWA 4NEB 812 6030 02b CP 521 ASCII Mode Backup battery missing X7 No battery has been inserted in the CP 521 or the battery is defective Job not accepted X8 This message is sent to the CPU on two occasions e A CPU job request cannot be accepted because the previous job has not yet been processed by the CP operating system This response can be scanned two program scans after allocation of the CPU job request Inthe case of message buffer overflow The CP operating system writes the CPU job requests identified on page 6 41 into the message buffer for further evaluation This buffer can only be filled by the CPU job requests
107. ooters The CP 521 has default values for all parameters If you want to use other values you must store your parameter setting data in a memory submodule in DB 1 This parameter setting data is subdivided into seven parameter blocks to simplify input of parameter data as much as possible DB 1 is only required if the parameter setting data deviates from the default values 6 4 GWA 4NEB 812 6030 02b CP 521 Print Mode Table 6 1 Contents of the Parameter Blocks Setting the serial interface parameters Serial interface parameters Waiting times after CR LF and FF XON XOFF protocol The XON XOFF Protocol has priority over the BUSY signal Parameter setting data for entering message texts Text parameters Parameter setting data for message text printout Output form for date and time of day Page format Headers and footers Setting the mode Parameters for ASCII mode GWA 4NEB 812 6030 02b 6 5 Print Mode CP 521 Dividing the parameters into seven parameter blocks has the advantage that you only need to assign parameters to the block which deviates from the default values However this parameter block must be entered complete even if individual parameters within the block are to retain their default values If the value entered exceeds the limit value this value is automatically replaced by the limit value The low limit is used if the value entered is below this value The high limit
108. or time of day HMS HSM MSH MHS H Hours SHM SMH M Minutes S Seconds Separator for time of day ASCII character 2E 20g to 7Fy 24h clock Ger d D D 24h clock 12h clock US UK e E Page format Lines per page Left margin Page number Top Bottom Header and footer Header 1 K1 Text 80 characters No headers or Header 2 K2 Text 80 characters footers Footer 1 F1i Text 80 characters Footer 2 F2 Text 80 characters 20 to FFy 484 72p 00H to 3Cy 00g 0 0 U u B bottom No other characters GWA 4NEB 812 6030 02b A 7 Summary CP 521 Operating mode Print mode with user sub Transparent module ASCII mode without user ASCII mode submodule Character delay time 0001 to 3000 100ms 0001 100ms four decimal digits Message length 000 to 256 bytes 064 bytes three decimal digits If length 0 at least one end code must be entered End of message identifier 1 End of text character ODy Olp to 7Fy carriage return 2 End of text characters 01 to 7Fy A Only significant in ASCII mode Only significant in interpretive ASCII mode A 8 GWA 4NEB 812 6030 02b CP 521 Summary A 4 Parameter Setting Data for ASCII Mode User Program Table A 1 PIQ for Job Transfer Parameter Setting Data for Parameter Block 0 Hc MN CN LE 2 Baud rate 110 Bd 200 Bd 300 Bd 600 Bd 1200 Bd 2400 Bd 4800 Bd 9600 Bd oOcoooo OM TIIIIIII oOoococc ON OO None 04
109. ormat e For the date Day Month Year e For time of day Hour Minute Second Example Configuring message texts with place holders for date and time of day You want to store the following message texts in DB 3 Message text 7 The motor went down at time of day Message text8 This is the daily listing for lt date gt KS 7 The motor went down Message text number 7 Separator message text with place holder for time of day C at T Message text end of text character KS 8 This is the daily Message text number 8 Separator message text C listing for D Message text place holder for date end of text character 6 24 GWA 4NEB 812 6030 02b CP 521 Print Mode 6 4 4 Place Holders for Message Text The place holder is replaced by a message text on printout The number of the message text to be replaced is specified when the message is configured Direct entry of the message text number KPa a is the number of the message text to be inserted You must specify a when configuring the message text The values 1 to 255 are allowed for a If the message text called contains place holders these are treated as text and printed out You can use the dummy character KPa place holder several times in one message text In this way you can connect several message texts and print them out together Example Configuring message texts with pl
110. printer for example you must set the same baud rate in DB 1 Set the parameters for the serial interface on your printer as desired and then set the parameters in DB 1 in the memory submodule e See 3 5 1 for configuration examples with terminal diagrams e Parameter setting in DB 1 is explained in 6 3 GWA 4NEB 812 6030 02b 6 1 Print Mode CP 521 2 Setting the CP 521 parameters Store all parameter setting data in the memory submodule in DB 1 Parameters for the printer interface baud rate type of interface BUSY signal e Configuration data for entering message texts function character end of text character Configuration data for the message text printout output form for date and time of day headers and footers Set the memory submodule parameters using a programmer in off line mode 3 Configuring message texts You must configure at least one message text in one of the DBs 2 to 63 in the memory submodule If you have configured a message text in a DB you can configure further message texts later in other DBs and store them also in the memory submodule See 6 4 for an explanation of message text configuration 4 Establishing connections You must take the following measures when the CPU is in the POWER OFF state Establish a connection between the CP 521 and the printer e Plug the configured memory submodule into the CP 521 You can then switch the CPU on POWER ON 6 2 GWA
111. ransfer to be aborted The CP 521 acknowledges this as follows Table 7 32 Message Invalid Job PIl Coordination information Coordination bit Send Receive reset Number of messages in receive buffer Irrelevant GWA 4NEB 812 6030 02b 7 55 ASCII Mode CP 521 Message 4X4 Illegal job is transmitted if the CPU tries to continue data transfer after it has been aborted BOXXj The CP 521 aborts a receive job immediately A080p if e there is no message present in the CP CP acknowledgement 5000p or there is a receive message error in the CP Exception Receive messages with error 094 character delay time exceeded are sent to the CPU All characters received correctly in the CP before message 09x is sent are sent to the CPU Table 7 33 Message No Receive Message Present PII EM 5X Coordination information 01 00 Receive coordination bit reset a o0 Number of messages in receive buffer Table 7 34 Message Error in Receive Message PII Coordination information X Cause of error exception character delay time exceeded 3 y ese ordrar O pom wem E ase women 0000 7 56 GWA 4NEB 812 6030 02b CP 521 ASCII Mode 7 5 3 Further Error Messages he CP 521 signals further errors stored in byte 0 status byte of the module which you can read in and evaluate via the PII Byte 0 which documents the status of the module is divided into two half bytes whose values can be c
112. relevant byte If a setting lies outside the permissible limit values the clock is not set The CP sends the Time date error error message Table 6 18 Transfer of Additional Inputs in the Case of the Set Clock Job Day O1gcp to 31gcp 01 BCD to 125cp or 24h clock in DB 1 on the 81 pcp tO 92gcp with 12h clock p m memory submodule Leap years are taken into acacount automatically 2 Hour O0gcp fO 235cp With 24h clock Configuration of 12h clock Olgcpto 12gcp with 12h clock a m Es Ea Setting the page numbers job 20 Specify the page number in binary code in byte 1 Executing page feed job 504 If job 6Oy Output line feed has not yet been executed it will be cancelled by this job Outputting line feed job 60 This job generates a blank line A subsequent job 50y Execute page feed deletes this job if it has not yet been executed GWA 4NEB 812 6030 02b 6 43 Print Mode CP 521 Deleting the message buffer job 704 All CPU jobs stored in the buffer are deleted Printout of all messages job 804 The message texts are printed out as configured with message text number in ascending order No place holders are evaluated Printer control characters are executed Transfer parameter setting data job 904 On restart the CP 521 receives the DB 1 data as initialized by you on the memory submodule You can change the data of parameter blocks 0 2 and 7 with this job Memory contents rem
113. rmation Coordination bit reset s pem o pem 0000 e pem S remm S Byte 1 The coordination bit is reset Byte 2 Data valid Byte 4 Number of messages in the receive mailbox of the CP 521 GWA 4NEB 812 6030 02b 7 47 ASCII Mode CP 521 Example Receiving a fixed length message Let s assume you have plugged into the module in slot 7 initial address 120 and you want to receive twelve byte long data messages with the CP 521 Write the incoming data into data block DB 40 EMPFANG Receive fixed length 12 bytes C DB 40 Open target DB ERE IW 120 L H OF00 AW iL H 0800 Job not processed by CP If flag 90 0 transfer coord job is set jump to label 001 The coordination job is transferred to the CP in byte 0 and the send permission in byte 1 Coordination job initiated Block completed Wait cycle after Stop Run or POWER UP till CP status reported If no new job has been initiated after the FB has been run 0000 data not relevant is transferred to the CP Read in of bytes 0 and If no data has been sent from the CP to the CPU byte 0 501 jump to label 002 Read in of bytes 2 to 7 Read in the 6 data bytes transferred from the CP to the CPU in block one byte 1 014 7 48 GWA 4NEB 812 6030 02b CP 521 ASCII Mode KH C001 OW 120 IW 120 KH 6002 IW 120 KH FOOF KH 5000 GWA 4NEB 812 6030 02b and transfer the acknowledgement for block No 1 to the C
114. rs GWA 4NEB 812 6030 02b 6 33 Print Mode CP 521 6 5 Data Transfer from the CPU to the CP 521 Data is transferred in the data cycle via the I O bus 6 5 1 Data from the CP 521 to the CPU Status of the CP 521 the printer and current clock data The CP 521 makes the following information available cyclically via the PII of organization block OB 1 Table 6 12 Data from the Module to the CPU E Status of the CP 521 Printer status and day of the week Date and time of day on the CP 521 clock This information can then be read into the control program with load operations and evaluated Reading the status of the module in print mode byte 0 in the PII Byte 0 Status of the module is divided into two halves The information in one half byte is independent of that in the other half byte They can be combined as required The following pages contain a description of the individual bits 6 34 GWA 4NEB 812 6030 02b CP 521 Print Mode Table 6 13 Status of the Module in Print Mode Byte 0 in the PII No error X 1 Memory submodule Fault in submodule configuration fault X 2 No text No message texts have been con figured on the memory submodule Message text No message text has been stored on number not the memory submodule under the configured number specified No backup battery On the CP 521 no battery inserted battery fault Message buffer The module cannot process any overflow further print jobs
115. s You can store a further three 16 bit variables in bytes 2 to 7 if you have configured place holders for variables in the message text You must enter the data in the form in which you configured it in the message text in the memory submodule 6 4 6 At printout the place holders are replaced by actual variable values GWA 4NEB 812 6030 02b 6 45 Print Mode CP 521 Table 6 19 PIQ in the Case of the Print Message Texts Jobs Job numbers n Print message text with CR LF Print message text without CR LF 4 Output page feed p Output line feed 01 to FF 1to 255 0000 to FFFF 0000 to FFFF 0000 to FFFF Permissible insertions when printing the message text You can enter place holders when configuring message texts on the memory submodule At printout these place holders are replaced according to their meaning You can enter place holders for Date and time of day 6 4 3 e Further message texts 6 4 5 e Variables 6 4 6 e Control characters for the printer double width type bold type 6 4 4 The CP 521 can report further error messages to the CPU 6 6 E g e Default time set Printer not ready e No backup battery 6 46 GWA 4NEB 812 6030 02b CP 521 Print Mode Example Initiating output of a message text without job monitoring CP replies are not evaluated The CP is installed in slot 7 initial address 120 A memory submodule on which message text 9 is configured
116. s CPU job not accepted 08g to the CPU in byte 0 of the PII Status of the module If you must send a large number of jobs within a short period check that there is still space in the message buffer You can only scan the CPU job not accepted error message two program cycles after the job has been assigned Figure 6 5 Take into account the following to ensure correct scanning of the message buffer in the control program ist PRC 2nd PRC 3rd PRC CPU sends job 1StDAC CPU sends job CPU can to CP 521 to CP 521 evaluate error message Transfer of job Transfer of error message PRC program cycle DAC data cycle Figure 6 5 Job Transfer and Error Message Evaluation 6 40 GWA 4NEB 812 6030 02b CP 521 Print Mode 6 6 Overview of Possible Jobs in Print Mode The CPU transfers the job to the CP 521 in word 0 The job number is stored in byte 0 Table 6 16 Permissible Jobs in Print Mode Byte 0 in the PIQ 1 Set clock specify settings in bytes 1 to 7 E WEREN Specify page number in byte 1 30 Output message with CR LF at the end H Specify message text number in byte 1 Specify message text number in byte 1 Output message without CR LF at the end Output page feed Oa l Delete message buffer S Printout of all messages Configuration of the serial interface Setting the XON XOFF character parameters Print mode Transparent ASCII mode Interpretive ASCII mode Print jobs These are writt
117. slssslsns 6 42 6 18 Transfer of Additional Inputs in the Case of the Set Clock JOD rrept orui ea a p e ees 6 43 GWA 4NEB 812 6030 02b 6 22 6 23 PIQ in the Case of the Print Message Texts PIQ in the Case of the Set Clock Job PIQ in the Case of the Setting the Serial Interface Parameters Job ww eee 6 58 PIQ in the Case of the Setting the XON XOFF listing parameters Job 1 eee 6 59 PIQ in the Case of the Setting Print Mode Job 6 59 PIQ in the Case of the Transparent ASCII Mode Job PIQ in the Case of the Interpretive ASCII Mode Job GWA 4NEB 812 6030 02b CP 521 Print Mode 6 Print Mode 6 1 General The CP 521 enables the output of message texts to a printer in print mode e Output of message texts defined by you in the memory submodule in data blocks DB 2 to 63 Insertion of the current time of day and date in the message text to be printed out The clock data is supplied by the integrated real time clock e Insertion of current variable in the printout The variable values can be transferred from the CPU to the CP 521 6 2 Prerequisites for Operating in Print Mode The following conditions must be met in order to operate the CP 521 in print mode 1 Printer settings The printer settings must agree with the your configured settings in the memory submodule in the parameter blocks of DB 1 If you have set a baud rate of 1200 baud on the
118. t loop interface TTY interface pin assignment terminal diagram U Unplugging module 3 1 User submodule 2 11 V V 24 interface setting terminal diagram Variable inserting data formats Ww Waiting times 6 10 X XON XOFF listing setting 6 65 XON XOFF protocol 2 8 GWA 4NEB 812 6040 02b Siemens AG Suggestions AUT E1114B Postfach 1963 Corrections Werner von Siemens Str 50 For publication D 92209 Amberg Fed Rep of Germany Title CP 521 Printer ASCII Communications Module Order No 6ES5 998 0UD21 Firm Dept Should you come across any printing errors when reading this publication we would ask you to inform us accordingly using this form We would also welcome any suggestions you may have in the way of improvement Address Suggestions and or corrections EWA 4NEB 812 6030 02b
119. ted The message text message text to be printed must fixed be 250 message text characters long number 3 variables per Transfer values of Insert 16 bits the variables in variable bytes 2 to 7 to the CP 6 22 GWA 4NEB 812 6030 02b CP 521 Print Mode You can enter place holders in either lower or uppercase Example Place holders for date and time of day D a T t Place holders for variables KH Kh KH kh Transfer of data when using place holders for Inserting variables Transfer the values for the place holders Insert variables to bytes 2 to 7 on the CP 521 Access to bytes 2 to 7 depends on the order of the place holders in the message text e The first place holder in the message text is replaced by the data in bytes 2 and 3 e The second place holder in the message text is replaced by the data in bytes 4 and 5 The third place holder in the message text is replaced by the data in bytes 6 and 7 GWA 4NEB 812 6030 02b 6 23 Print Mode CP 521 6 4 8 Place Holders for Date and Time of Day When printing out a message text the following takes place e The place holder D for the date is replaced by the actual date e The place holder T for the time of day is replaced by the actual time The output format of the date and the time of day can be configured You must do this in data block 1 parameter block 4 on the memory submodule 6 3 3 The following is the default output f
120. terface Example 1a Setting the RS 232 C V 24 interface with the FORCE VAR programmer function The module is installed in slot 7 initial address 120 An initialized memory submodule is plugged into the module A printer is now to be operated with Busy signal yes e TTY interface e XON XOFF listing yes A printer is now to be operated with e RS 232 C V 24 interface e XON XOFF listing yes H Byte 6 7 data bits byte 7 handshake OFF 124 H 0001 Byte 4 Busy no byte 5 RS 232 C V 24 interface 122 Byte 2 9600 baud bytes 3 even parity 120 H 9000 Byte 0 Job Transfer parameter setting data Byte 1 Parameter block 0 6 62 GWA 4NEB 812 6030 02b CP 521 Print Mode Example 1b Setting the XON XOFF listing The same details apply as in example 1a QW 122 KH 1113 Byte 2 XON character DC 1 as ASCII code Byte 3 XOFF character DC 3 as ASCII code QW 120 KH 9020 Byte 0 Transfer parameter setting data job Byte 1 Parameter block 2 GWA 4NEB 812 6030 02b 6 63 7 1 General so er a EN ee ex 7 7 2 Prerequisites for Operation in ASCII Mode 7 7 3 Setting the CP 521 Parameters in ASCII Mode 7 7 3 1 Setting the CP 521 Parameters with Job 9OXXy_ 7 7 3 2 Setting the CP 521 Parameters with the Memory Submodule 0 0c eee eee ee 7 7 4 CPU Job Requests with CP Responses in ASCI MOG eri cemere near tea ede 1 7 4 1 Sending Messages
121. the CP 521 in print mode without XON XOFF protocol The waiting times for CR LF and FF are not significant when evaluating the BUSY signal Interface You can chose between the RS 232 C V 24 and TTY interfaces here See 2 3 for the characteristics of the interfaces The TTY interface is the default GWA 4NEB 812 6030 02b 6 9 Print Mode CP 521 Data format Characters are transmitted between the CP and the peripheral device in an 11 bit character frame You can choose between seven and eight data bits within the character frame 7 data bits 1 start bit 7 data bits 1 parity bit 2 stop bits 8 data bits 1 start bit 8 data bits 1 parity bit 1 stop bit The default is 7 data bits Hardware handshaking This parameter is only significant in conjunction with the RS 232 C V 24 interface If you set hardware handshaking ON the RTS CTS DTR and DSR control signals of the RS 232 C V 24 interface are evaluated Hardware handshaking has priority over the XON XOFF protocol Hardware handshaking OFF is the default i e the control signals are not evaluated Table 6 3 Parameter Setting Data for the Serial Interface Parameter Blocks 1 and 2 00 to FF 25ms 00 to FF 25ms XON character ASCII character FF 00 to 7Fp No XON XOFF XOFF character ASCII character protocol 00 to 7Fy Parameters for waiting times These parameters are only significant if you are not using an X
122. they are collected in one receive mailbox This receive buffer has a capacity of 1 Kbyte and can store 100 messages You program the CPU so that it reads out the existing messages from the receive mailbox in eight byte blocks two job bytes and six data bytes 1 The CPU sends a job Coordinate data transfer Receive to CP 521 You have previously set the message length end of message character and permissible character delay time on the CP in the relevant parameter blocks 2 The CP 521 starts data transfer It sends the first six bytes of the oldest message in the receive buffer FIFO memory 3 The CPU acknowledges the data received 4 The CP 521 sends a further block and so on until the whole message has been transferred from the CP 521 to the CPU The CPU receives an immediate final acknowledgement 6 5X00 to the Coordinate receive job A080 if no receive message is present GWA 4NEB 812 6030 02b 7 39 ASCII Mode CP 521 Receiving fixed length messages If you want to receive fixed length data messages from a peripheral device using the CP 521 you must define the message length with which both devices are to work If the CP is to receive data it must be configured with the same length as the sending peripheral device since the send length is not transferred The following is a description of which jobs the CPU uses to allow the CP 521 to receive data from peripheral devices and how the CP 521 acknowledges these
123. tion Example CP 521 Send block 1 Send 6 bytes from DB 2 Block 1 acknowledged by CP Remove error messages Send job completed Reset send active Reset start flag send B 6 GWA 4NEB 812 6030 02b CP 521 Application Example Empfang L Sh KH AW Zh GWA 4NEB 812 6030 02b Read 6 byte message Job processed by CP Receive active Coordinate receive Receive active Wait cycle after STOP RUN till CP status reported Reset jobs Data received from CP Store 6 bytes of receive data in DB 3 B 7 Application Example CP 521 Acknowledge from CPU to CP Receive message complete Reset receive active B 8 GWA 4NEB 812 6030 02b CP 521 Application Example AN JC Empfang BE FB GWA 4NEB 812 6030 02b Data exchange CPU CP 521 free running 5 Hz timebase 100 ms pause 100 ms pulse Send edge flag Send job in 200 ms time if no receive active Basic setting receive if no send job active B 9 Application Example CP 521 Test Store input byte 1 and 2 in send buffer Data exchange CPU CP 521 Test Display receive data in output byte 3 and 4 B 10 GWA 4NEB 812 6030 02b CP 521 Application Example B 7 Testing an Example Program You can test the program after entering all blocks Enter all send data in the send PC via the simulator module input byte 1 and 2 This data is transferred to the receive
124. uffer max 100 Irrelevant ES Irrelevant 7 Irrelevant T GWA 4NEB 812 6030 02b 7 29 ASCII Mode CP 521 If you send a message of variable length and you use the maximum message length the last CPU job request 7 and the CP acknowledgement 8 appear as follows CPU job request B02B Table 7 20 Data Transfer Sending the 43rd Data Block Data block number 43 max eae ca feats fa fo Data Byte 255 IEEE Data Byte 256 cs en 7 PE do mem 7 Since a message may not exceed 256 bytes you can transfer a maximum of 43 data blocks in one message 42 of 6 bytes and 1 of 4 bytes This leaves only four bytes for data in the last data block 2By 7 30 GWA 4NEB 812 6030 02b CP 521 ASCII Mode CP response to job B0O2B Table 7 21 Acknowledging the Last 43rd Data Block o 5X Acknowledgement for job Send data Send coordination bit set if data valid Pack Coordination data valid 3 2B Number of the 43rd data block max 4 00 64 Number of messages in receive buffer max 100 Final CP response After the whole data message has been transferred from the CP 521 to the peripheral device the CPU receives a last message from the CP 521 This resets the coordination bit Table 7 22 Final Coordination Information o 8X Acknowledging the job Send data o ecoranatonbitvesst o 2 fo oma Co reem 00 64 Number of messages in the receive buffer
125. ule You can also include in the message text control commands for the printer These are then executed during printing double width type on off ASCII mode In ASCII mode messages of up to 256 bytes in length can be transferred between the CPU and a peripheral device connected to the CP 521 On receipt of a Send job from the CPU the CP 521 transfers the data from the PIQ Process Image of the Outputs of the CPU to a Send mailbox until the message has been completely transferred from the CPU Then the CP 521 transfers the data autonomously from the Send maibox to the peripheral device Data received from the peripheral device is first stored by the CP in a Receive mailbox From there it can be read into the PII Process Image of the Inputs with a Receive job from the CPU Serial interface The CP 521 has a RS 232 C V 24 interface and a passive TTY interface The following are examples of peripheral devices that you can connect to the serial interface of the CP 521 e Keyboard Printer with active TTY interface e Terminal Printer with RS 232 C V 24 interface e CPU 944 ASCII interface e CP 523 e another CP 521 2 2 GWA 4NEB 812 6030 02b CP 521 Technical Description EPROM EEPROM You can use EPROM and EEPROM memory submodules with up to 8 Kbytes The EPROM EEPROM is configured with the programmer Print mode In print mode the paramter setting data for the serial interface and for the format of the printo
126. understand Yes 4 s the document technically accurate Yes 5 Does the level of technical detail meet your requirements Yes 6 Would you like more illustrations Yes 7 Please ratethe quality of the graphics Excellent Good Adequate Poor Additional Comments No No No No No No Manual CP 521 Order No 6ES5 998 8HD21 Edition 3 Name Title Company Name Address City State Zip GWA 4NEB 812 6030 02b GWA 4NEB 812 6030 02b Complete Configuration A Programmable Controller with a CP 521 and Printer Complete Configuration Point To Point Connection GWA 4NEB 812 6030 02b CP 521 System Overview 1 System Overview The CP 521 is a powerful and active printer ASCII communications processor module that can be used in the S5 100U not with CPU 100 6ES5 100 8MA01 The module has a dedicated processor and can be operated in print mode or ASCII mode Print mode enables printout of message texts This allows you to document process states and process faults In ASCII mode the module can exchange data with other peripheral devices such as terminal devices communications modules or also other CP 521s In this way you can network programmable controllers point to point connection The peripheral device and the CP 521 are connected via a serial interface You have the option of a passive TTY current loop interface or an RS 232 C V 24 interface Parameter assignment to the printer
127. ut is defined on the memory submodule in data block DB 1 You can configure up to 255 different message texts in DBs 2 to 62 The CP 521 can only be started up in print mode if a memory submodule containing at least one message text is plugged in e ASCII mode You can define the paramter setting data for the serial interface on the memory submodule in DB 1 In ASCII mode the CP 521 can also be started up without a memory submodule in which case the parameter setting data for the serial interface is then transferred from the user program to the CP 521 Integrated real time hardware clock The CP 521 has an integrated real time hardware clock The clock can be set and read either with a programmer or in the user program 2 5 GWA 4NEB 812 6030 02b 2 3 Technical Description CP521 2 2 Technical Specifications For environmental mechanical and electromagnetic conditions see the pro grammable controller manual Galvanic isolation TIY signals are floating Memory submodule EPROM EEPRO M Serial interface V 24 R 232C TTY passive Transmission mode Asynchronous 7 bit mode char frame of 11 bits 1 start bit 7 data bits 1 parity bits 2 stop bits 8 bit mode char frame of 11 bits start bit 7 data bits 1 parity bits 2 stop bits Transmission rate 110 to 9600 baud Permissible cable length TIY PT 88 30m 98ft V 24 RS 232 C 15 m 49 ft Battery failure display yellow LED yes
128. y bit always 1 space parity bit always 0 none 4 BUSY signal Interface TTY 00 00 RS 232 C V 24 01 Data format 7 data bits 00 00 8 data bits 01 HW handshake OFF 00 00 ON 01 GWA 4NEB 812 6030 02b 7 7 ASCII Mode CP 521 Parameter setting data for parameter block 2 Table 7 3 PIQ for the Transfer the parameter setting data for parameter block 2 Job ope LP LL 20 2 XON XOFF protocol XON character 00 to 7F no protocol FF FFFF En H H 3 XON XOFF protocol XOFF character 00 to 7F no XON XOFF no protocol protocol 7 7 8 GWA 4NEB 812 6030 02b CP 521 ASCII Mode Parameter setting data for parameter block 7 Table 7 4 PIQ for the Transfer the parameter setting data for parameter block 7 Job Print Mode ame e LL O Parameter block number and 0 if memory sub code for Print mode module with message texts plugged in without memory sub module Table 7 5 PIQ for the Transfer the parameter setting data for parameter block 7 Job Transparent ASCII Mode Parameter block number and a 0 if memory sub code for Transparent ASCII module with mode message texts plugged in without memory sub module Character delay time 0001 to 0BB8 0001 100 ms Message length in bytes 0001 to 0100 40 64 Not significant 00 to FF GWA 4NEB 812 6030 02b 7 9 ASCII Mode CP 521 Table 7 6 PIQ for the Transfer the parameter
Download Pdf Manuals
Related Search
Related Contents
G2 7779S 39320D/39320/29320/29320LP - Support Samsung HG32ED470SK Инструкция по использованию NEC Express5800/120Rh-2 N8100-1126F User's Manual BROSSE À DENTS ÉLECTRIQUE Mode d`emploi SPAZZOLINO EJournal User Manual LHI 425 Pipeweld Wiley Professional Community Server Themes AIT Drive Copyright © All rights reserved.
Failed to retrieve file