Home
A120 KS-Functions User Manual DOK--279375.20
Contents
1. No No No of marker bits of marker bytes of marker words of marker double words of system marker bits of system marker bytes of system marker words of system marker double words of timers of counters other parameters Examples 37 38 Examples 4 8 Reading of the system status list The system status list contains data about the type of CPU the DIP switch setting and the firmware version This list is already defined declared in the A120 CPU and has the declaration number 2 permanently assigned to it It will be read out with the mes sage type multiple read as described in chapter 4 4 2 The data structure of the response message is shown below The data have the format byte f D10 D11 D12 D13 D14 D15 D16 D17 D18 to D63 Identcode of the CPU DIP switch position of the 8 pole switch DIP switch position of the 4 pole switch ab cd ef gh ik other parameters From this the part number follows as abcdefgh ik For exampel ab 00 dec cd 27 dec ef 66 dec gh 03 dec ik 03 dec It follows the part number is _276603 03 20
2. first address of the operand string Exam ple The markers 999 up to 1001 have to be transmitted In byte D11 the value 3 number of markers and in bytesD12 up to D13 the value 999 in hexadecimal for mat has to be entered In the byte range D14 up to D64 the send station of the message can store the oper and values which have been defined in D10 up to D13 The different operand types re quire one up to four bytes for the operand value Example A marker bit 1 bit requires one byte a marker double word 82 bit requires four bytes in total The black arrow in Figure 8 marks the number of bytes necessary for the resp function which have to be reserved for the message Display of Message Structure and Timing 20 LN AA 7 O A A A A o A passos o Delete Declaration Terminate Data Declaration Single Read SM Data SYS Single Read SM Data lO Read System Status List Read System Definition List Read free Declaration Number 7 ALE FU AI EC CO IE A E E E E A E Write Time and Date N Multiple Data Wet cl E UA RoV RoV RoV RoV RoV RoV RoV N N NA HEM EE poe 1 TA 7 1 ENE E n 10 E o A A meore E E ESA e A E A AI parra o E E O E EE ES Values which have to be defined from the user CA AN A Figure 9 The Message Content of a System Message for a Slave Response 20 Display of Message Structure and Timing 13 14 2 2 3 The response m
3. 7 t_WS1 1 a Figure 11 Timing Diagram Polling Mode 16 Display of Message Structure and Timing 20 The time t_PS is the reaction time of the controller to a short message SMG 81 which has been sent from the master For this reaction of the programmable controller a re sponse time of up to 110 msec is allowed for the slave In case that this time is ex ceeded then the program in the master station must be able to recognize that as an error by selecting an appropriate waiting time t_WM and must repeat the call Theo retically the master can react directly to the polling signal SMG 81 of the slave station In order to prevent the master from receiving too many polling signals the master sta tion has a time interval of max 120 msec before it has to send a new polling signal When changing from polling mode to the operating mode system messages the tim ing code is reduced to 10 msec Due to the fact that the system message is passing the serial port byte by byte and not complete the developer has to make sure that the period of time between two bytes does not exceed 40 msec Figure 12 shows the time structure when sending a message from the master to the slave station 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms La System Message oi Master i SMG TE TE TE TE 80 Slave ro oa po SMG E ME SO E 80 tPT aa tP
4. Hex and not 13 OD Hex any more Embedded Command Byes A F Fi F2 0 0a os 0s 0s 0s or 08 oe 90 OW OATS Single Read Signal Memory OC FO 1 5 1 XX XX xXx Data Figure 22 Response Message of the Modicon A120 Examples 29 20 4 4 Multiple Access to declared Data Besides a single access on data also multiple or cyclical access on data is possible For this it is necessary to declare these data i e declaration lists have to be defined in the A120 The declared data are then transmitted either event controlled or on request cyclical 4 4 1 Structure of a Declaration List For multiple read or write tasks on data of the signal memory SM it is necessary to define a declaration list in the Modicon A120 This list must be marked unambiguous with a number the so called declaration number 4 4 1 1 How to read a free declaration number It is always possible to define more than one declaration list The declaration numbers of the lists are defined in ascending order starting with the value 17 please compare details on Figure 9 In case that one of the declarations is deleted then a gap in num bering occurs An additional request might therefore be necessary in order to get the information about the next free declaration number The respective system message and response message is shown in Figure 23 and Figure 24 In this example it is assumed that the first ten declaration lists are already defined The
5. Modicon A120 and the peripheral in sequence charts 20 Principle Program Structures 19 3 1 How to Keep the Communication Active The start of the polling routine loop 1 is the first program element which starts the communication In case that the master can fulfill the requirements concerning the tim ing code as mentioned in chapter 2 3 then loop 1 is processed permanently until a system message is sent Loop 2 shall keep the polling operation active in case that insignificant irregularities happen When all three tests fail it has to be guaranteed that the polling operation loop 3 is activated again Start of Polling Send SMG 80 Send Message Send Message no esc Send SMG 81 esponse Message no within the Timing Code Figure 14 Communication Operation 20 Principle Program Structures Wait for Acknowledgement Acknowledgement Test lt 3 Send SMG 80 Receive Response Message 20 20 3 2 How to Create a System Message The creation of system messages has to be carried out in parallel to the before men tioned communication routine These program parts my influence the communication routine in the way that an unpermissible increase of the operating time occurs In case that the masters computing power is too low then an increased priority in the pr
6. before in other examples In Figure 34 please see how a single list with the declaration number 1B hex 27 in decimal format is cleared In order to be able to delete all declaration numbers the value 0 is entered as the declaration number e E 508 6 EEEE tes Seba o fects prjojofriotoli7 tejo Figure 33 Cleanse single Declaration List in A120 ese 160 100 ed A Sel LV ed Ue tes ocarDecaraion o fects frofefol ojo 7 ojo Figure 34 Clear all Declaration Lists in A120 34 Examples 20 4 5 Using Timers and Counters For reading or writing purposes of timers and counters the A120 offers two possibilities The older one upward compatible solution which is available for all firmware versions has to be used with care When working with this older version the actual and setpoint values as well as the status of the timer or counter are overwritten simultaneously This version won t be subject of this documentation The newer solution which is available in firmware versions On the other hand the new solution which is however available only from firmware le vel 3 allows an individual access to the actual as well as setpoint value The illustrated message shows the job telegram with which at a definite timer Byte D11 1 with the number 16 Bytes D12 D13 0010 Hex the setpoint value Byte D10 3D Hex is set to 33 Byte D14 D15 0021 Hex Pure EFE ES AE a EA Figure 35 Set timer setpoint val
7. eee tenet eens 9 The Message Header evo csi and galan a ice et ieee 9 The Message Content 00 c cece nett ene 10 Message Protections ici acted cate ware dy A eae Seto ete AS 14 The Communication Time Frame 00 cece teens 16 Principle Program Structures 0ccee eee e cece eee 19 How to Keep the Communication Active 00 6 c cece tees 20 How to Create a System Message 00 cece eee teens 21 Analyses of Response Message 0 cece ete etn 23 EXAMPLES oa o ee 25 Generaly aan a a 26 Starting and Stopping of the PC User Program 0 2 c eee eee eee ee 27 Starting of the SYSteOM imita a 27 Stopping of the System 0 ccc cece eee ae 27 Single Read of three Successive Marker Bits 0 00 cece cence ene mm 28 Multiple Access to declared Data ooccooccocccccoccc 29 Structure of a Declaration List oooocccocccccconorr eee 29 How to read a free declaration number 0 cece eens 29 Declaration of four successive marker bytes for multiple read 29 Terminate Data Declaration resp declare Send Condition 04 30 Execution of a Declaration LiSt oocooocooocoonccrnr 32 Periodic Scanning of a Declaration List oooooccccoccccco ees 32 Polling while waiting for the Send Bit oocccccccccccccccnc es 32 Clearing of Declarations oooocccocccccconnr eee 33 Using Timers and Counter
8. functions Cl functions The Cl functions are a special feature of the Modicon A120 arithmetic logical units ALU s which allow the connection of external devices to the programming interface RS232 all ALU s or the communication interface Modnet 1 port only ALU202 of the Modicon A120 The following external devices can connected o Operating and monitoring devices o Portable hand held devices o Permanently installed parametrization modules o All kinds of operator panels o Personal Computer production data aquisition PDA visual display systems O Other intelligent peripheral devices The documentation on hand gives all information necessary in order to be able to use the Cl function for individual applications The main emphasis is the coupling of exter nal devices to the A120 programming port RS 232 C Arrangement of This Guide This chapter describes the idea of the Cl functions and the possible solutions on basis of the Cl functions This chapter explains the message interchange the structure of the messages and the message content the Cl functions This chapter explains the data exchange between the programmable controller A120 and the periperal in sequence charts In this chapter some examples about the Cl functions are shown 20 20 Validity Note The functions explained in this documentation are applied to the system software A120 Validity march 1991 vi 20 0594 Suppleme
9. A120 KS Functions User Manual DOK 279375 20 0399 Translation of the German Description DOK 271974 20 0791 Notes Application Note Caution The relevant regulations must be observed for control applications in volving safety requirements For reasons of safety and to ensure compliance with documented system data repairs to components should be performed only by the manufacturer Data Illustrations Alterations Data and illustrations are not binding We reserve the right to alter products in line with our policy of continuous product development If you have any suggestions for improve ments or amendments or have found errors in this publication please notify us using the form on one of the last pages of this publication Training Schneider Automation offers suitable further training on the system Addresses See addresses for the Technical Support Centers at the end of this publication Trademarks All terms used in this publication to denote Schneider Automation products are trademarks of Schneider Automation All other terms used in this publication to denote products may be registered trademarks and or trademarks of the corresponding Corporations Microsoft and MS DOS are registered trademarks of Microsoft Corporation Windows is a brandname of Microsoft Corporation in the USA and other countries IBM is a registered trademark of International Business Machines Corporation Intel is a registered trademark of the Intel C
10. T t_PS2 lo _PM2 i t_WM2 i t_WS2 t_WM3 Figure 12 System Message gt Slave 20 The slave station recognizes the end of a system message when the time interval PT 20msec t_PS is passed after the last byte to the slave The slave station sends a short message SMG 80 to the master when the message end has been rec ognized The master then demands by sending SMG 80 short messages the slave station to send the logical acknowledgement after a time interval t_PM t_PT O up to 20msec Correspondingly to the polling operation also here different waiting times have to be taken into consideration In case that these waiting times are exceeded then a communication error has to be recognized by the master station Display of Message Structure and Timing 17 Figure 13 shows the timing diagram for the send sequence of a response message from the slave to the master station The time intervals are correspondent to the send operation from master to slave 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms Master SMG SMG 80 80 i System Message i Slave TE TE TE TE l t PT i t_PM2 LS del t_ws2 Figure 13 Response Message Slave gt Master 18 Display of Message Structure and Timing Chapter 3 Principle Program Structures This chapter explains the data exchange between the programmable controller
11. annot be controlled or checked might happen In case of un expected behavior of the program it is recommended to check the number of generated system messages A programming routine which generates a system message each PC program cycle might easily generate up to 100 system messages per second To be able to prevent this it is recommended to use a 1 2 Hz flashing pulse in order to control the generation of system messages 20 20 As mentioned before it is possible that sometimes an overflow of the send buffer oc curs even when the KS functions are used in the correct way Therefore it might hap pen that the master peripheral does not receive immediately the related message Other messages are sent in the meantime Therefore it is recommended always to wait for the response message before a new system message is sent A further possibility is to program a type of sorting mecha nism which allocates afterwards the response messages to the related system mes sages The content of bytes A up to D5 are either already defined or are very easy to determi nate byte F1 The values for the other bytes from D6 up can be taken from the tables in Figure 9 and Figure 10 The generation of the protection byte is of no importance to the understanding of the KS function therefore it is not mentioned in the following examples The resp content of the protection byte is marked with For the reason of better understanding all message co
12. are transmitted with data bytes D10 up to D13 For further details please see chapter 4 4 1 2 4 4 2 2 Polling while waiting for the Send Bit In case that a send condition has been declared then the short message SMG 80 is used When using the short message SMG 81 the programmable controller A120 does not send any system messages 20 Examples 33 4 4 3 Clearing of Declarations The declarations cannot be cleared deleted in the A120 This can be done only when the program is loaded again into the programmable controller PC When the user pro gram is loaded into the PC then all memory areas are standardized i e in this case all declaration list must be defined again Using the on line exchange function of Dolog AKF12 has no influence on the declara tion lists It is possible to generate an overflow when too many declaration lists are send to the A120 In the case of doubt it is recommended to clear all declaration lists and to gener ate new lists It is also possible to clear only parts of these list In difficult situations the next free declaration number can be found as mentioned in chapter 4 5 When all declaration lists are cleared deleted also other lists are lost Is for example Viewstar 200 XA used in the application then also the lists for this application are cleared The resp messages for clearing are shown in Figure 33 and Figure 34 The response messages are not mentioned again and are structured as already explained
13. d possible solu tions or applications 20 The KS Functions 1 2 1 1 1 2 The KS Functions Introduction Mini programmable controllers PCs like the Modicon A120 are used in substantial quantities for machine control purposes and for the control of small applications in the process industry Besides the display of message texts and alarms it must be possible to modify setpoint values and other parameters in the programmable controller Very often color graphic displays of the process are required process data have to be scanned and stored resp processed on a Personal Computer for production data acquisition PDA In some cases special sensors like bar code readers are connected To be able to fulfill these demands the openness of a programmable controller be comes more and more important The programmable controller Modicon A120 is there fore designed as an open controller the KS functions are part of this concept This documentation shall give the necessary background information to the user in or der to make this specific product feature easier to understand Possible Peripherals The name KS functions defines a feature of the Modicon A120 arithmetic logical con trollers ALUs which allows the connection of external devices to the programming or the communication interface of the ALUs The following peripherals are possible a Operating and monitoring devices o Portable handheld devices o Permanently ins
14. ddresses IB IW ID Q QB QW QD M MB MW MD SM SM SMB SMB SMW SMD TIW TSW CAW CSW Inputs binary Byte Inputs Word Inputs Double Word Input Binary Outputs Byte Output Word Outputs Double Word Outputs Marker Bit Marker Byte Marker Word Marker Double Word System Marker Bit System Marker Bit I Os System Marker Byte System Marker Byte analog I Os System Marker Word System Marker Double Word Timer Timer Actual Value Word Timer Set Value Word Counter Counter Actual Value Word Counter Set Value Word 4 The KS Functions l IB IW ID Q QB Qw QD M MB MW MD SM SM SMB SMB SMW SMD TIW TSW CAW CSW 1 1 1 1 1 1 1 1 a oo a oo ee oe a oo A IB IW ID QB QW QD MB MW MD SM SM SMB SMB SMW SMD TIW TSW CAW CSW 18 16 18 16 18 16 18 16 18 16 18 16 18 16 18 16 125 32 3970 1985 992 50 18 1 20 18 1 10 567 567 567 794 794 794 20 Chapter 2 Display of Message Structure and Timing This chapter explains the message interchange the structure of the messages and the message content the KS functions Display of Message Structure and Timing 5 2 1 Message Interchange The communication between the programmable controller PC Modicon A120 and the peripheral device is based on the master slave principle The PC is always slave sta tion The peripheral therefore must be able to keep the data e
15. essages are broken down according to the above mentioned descrip tion Please be aware that the bytes in the response message have partly a different meaning The meaning of the bytes D6 up to D8 correspond to the meaning of the bytes in a send message Byte D9 can be used from the slave station Modicon A120 in order to transmit different error messages to the master station In case that the A120 station sets D9 to 0 then no errors are detected and the system message which was send from the master was according to the before mentioned conditions In the bytes D10 up to D64 the slave station transmits the values of the before de clared operands to the master station The data ranges marked with PS for details please see Figure 9 are predefined in their order With that it is possible to read out complete internal lists of the program mable controller e g system status lists or system definition lists at once e in one message The procedure is this case is the same like when reading out operand blocks which are predefined via declaration numbers with the difference that the declaration numbers cannot be freely selected but are specified from the system Message Protection The protection of the data transmission is done in two levels For the physical layer the convention of the RS232 port secures automatically the control of the data transmis sion This level is less important to the user For the logical level a s
16. ge of Values Declaration Number Range of Values ALU 200 Range of Values ALU 201 Range of Values ALU 202 Number NB Value for Number of used Operands SYS or lO Start Address Lowest Address of the afore mentioned Number of Operands Range of Data Information to be transmitted Irrelevant Range of Data Any values can be entered Attention at data byte D9 decimal values are shown Variables Values which have to be defined from the user for each transmission of data Figure 8 The Message Content of the System Message for the Request of the Master 20 Display of Message Structure and Timing 11 12 Definite values can be assigned to the bytes D6 function byte and D7 subfunction byte For the data byte D8 declaration byte at this position the resp declaration num ber has to be entered for functions which operate with declared data The range of val ues RoV for the declaration number depends on the selected ALU type and must not be exceeded Via the content of byte D9 I O slot number a module of the A120 can be addressed e g I O module Example To be able to read out the input conditions of an I O module in slot 3 the slot number 3 has to be entered In byte D10 the resp operand type in hexadecimal format must be entered if neces sary Byte D11 describes the number of operands per transmitted message In byte D12 and D13 the start address is entered
17. ioned The structure of the system mes sages is explained in details in chapter 2 2 The short messages only consist of a short message header They are used for the polling operation as well as for the normal communication In accordance with the defi nition the following hexadecimal numbers are used for the polling operation and for the communication a Short message SMG for the communication 80 a Short messages SMG for the polling operation 81 The short message SMG80 is used exclusively for the synchronization during the communication and is transmitted between the different system messages i e while the master expects a system message from the slave This is also valid for the send bit declaration For the polling operation ST 81 is used exclusively 2 1 6 The Structure of the Message Elements Each message consists of different message elements The short message has only one message element whereas the system message can have up to 69 message ele ments k 11 Bits st so e s2 se sa os se ez rc s k 8 Bits 1 Byte gt Explanation a ST Start Bit a BO up to B7 Data Bits o PC Parity Bit Vertical Parity odd number of bits logical 1 o SP Stop Bit The length of a message element is 11 bits when using the A120 programming interfa ce 8 Display of Message Structure and Timing 20 2 2 The Structure of the System Message The system message is
18. ite floating point values a As with Modicon A120 and Modicon Micro we recommend to use the single read and write on markers as the standard method see user manual page 28 chapter 4 3 O As with Modicon A120 and Modicon Micro it is meaningful to store markers of the same type in a marker chain and to access these as a block See user manual page 4 Table 1 0594 20 Chapter 1 Chapter 2 2 1 2 1 1 2 1 2 2 1 3 2 1 4 2 1 5 2 1 6 2 2 2 2 1 2 2 2 2 2 3 2 3 Chapter 3 Chapter 4 4 1 4 2 4 2 1 4 2 2 4 3 4 4 4 4 1 4 4 1 1 4 4 1 2 4 4 1 3 4 4 2 4 4 2 1 4 4 2 2 4 4 3 4 5 Table of Contents The KS FUNCHONS eiii A 1 INTOQUCION ia e OE ee 2 Possible Peripherals voesioorta cian e tale ae pew eel eee pee 2 Additional Possibilities using the KS Functions 00 ee eee ees 4 Display of Message Structure and Timing oooooooo 5 Message Interchange siivcino2 ated dhe hie Lae O ed io 6 Polling Operation 22 cera ies deca tescite then Gott ehe gee el hehe ade weeds 6 The Master Slave Communication with Acknowledgement 0 00ee eee 6 The Master Slave Communication with Information Response 7 The MasterSlaveCommunication with Error Message c cee eee eens 7 Message Types isis feet A A Sua ate e 8 The Structure of the Message Elements 0 0c cece cette eee teens 8 The Structure of the System Message cece
19. nes the number of data bytes D This value can be entered only after the definition of the message content The Message Content The different KS functions operand types and operand contents are defined in the message content from the master or the resp slave station In this context the mes sage direction is of importance for the assignment of the different functions to the trans mitted bytes Therefore the send message master gt slave and the receive message slave gt master should be written separately For both senddirections separate layout plans have been created in order to simplify the composition of the message contents for the different functions The hatched sec tions in the plan show the message elements where the user has to fill in values de pendent on the communication task Bytes which are marked with N can have any value It is recommended to set these bytes to 0 Figure 8 shows the structure of the message content in master gt slave direction 10 Display of Message Structure and Timing 20 Operand Description Representation Operand Description Representation Marker Bit Marker Byte Marker Word 1 Byte Operand Input Bit e Operand 1 Byte Operand Input Byte e Operand 2 Byte Operand Input Word e Operand Marker Double Word MD 23 4 Byte Operand Input Double Word 1D e Operand System Marker Bit 1 Byte Operand Output Bit Q e Operand System Marke
20. ns the embedded command Declare SM Data multiple read For details please see Figure 25 tes Declare Signal Memory oC FO 1 2 1 1B 21 7 SM Data multible read Figure 25 Declaration of four successive marker bytes In case that no transmission error has been detected then the slave station responds with the message as shown in Figure 26 At this moment no data transmission takes place It is only used to confirm the correct reception of the declaration message tes Declare SM Data multiple FO 1 2 1 1B read Figure 26 Response Message of the Modicon A120 4 4 1 3 Terminate Data Declaration resp declare Send Condition To be able to use a declaration list it always has to be activated This happens normally by sending the system message End Data Declaration From this moment the de clared data can be read after a request message The activating message is always related to one declaration list The declaration number of this list has to be named ex plicit Figure 27 shows the corresponding system message where the declaration num ber 27 1B Hex is named Fi Ez oi 2 09 oe 5 0s or 58 oT S al fEndDataDecaraton ojejo rjojo ojo oTw Figure 27 End Data Declaration Sometimes it is necessary only to send event controlled data from the A120 to the master station e g marker bytes The event in this example is the positive edge of an operand type bit i e the value of the ma
21. nt to User Manual A120 KS Functions DOK 279375 20 0399 KS Functions for Modicon Micro The KS functions described in the following manual are valid without any restrictions also for Modicon Micro KS Functions for Modicon A250 and the A120 cen tral processing units ALU 204 ALU 205 The KS functions described in the following manual are available from AKF125 version 3 0 also for Modicon A250 The KS functions are available also for the A120 central processing units ALU 204 and ALU 205 In case of these applications the following deviations in comparison to the application with A120 should be considered for this compare user manual page 13 Figure 9 o The following A120 system messages do not exist with A250 and ALU204 5 o write system definition list write target equipment list start user program in cold restart mode start user program in hot restart mode o Note Modicon A250 and the CPUs ALU204 5 are basically started with the use of hardware jumpers o With the following system messages for the A250 depending on the system a differ ent data format must be used o read system status list o read system definition list O Since A250 possesses considerably more interfaces than A120 the declared num bers cannot be accessed freely This means the user must get a free declaration number from A250 and cannot select it freely see user manual page 31 chapter 4 4 1 1 o From AKF125 version 4 0 it is possible to read and wr
22. ntents are displayed in hexadeci mal format Please note that the values are shown not complete i e the hex value 09 is displayed only as a 9 Examples 27 4 2 Starting and Stopping of the PC User Program 4 2 1 Starting of the System The system message send from the peripheral to the Modicon A120 contains the em bedded command Start User Program according to Hardware Settings The structure of the message is shown in Figure 17 The value for byte F1 is 9 due to the fact that bytes D1 up to D9 have been used The bytes D8 and D9 don t contain necessary data for this KS function therefore their value is 0 reend Comana A Fi or oe oe os os os or oe oo TS Start User Program UP according to oC FO HW Settings Figure 17 System Message Start of PC User Program In case that no transmission error has been detected then the slave station Modicon A120 responds with the message as shown in Figure 18 The difference to the request message from the master is byte F in this case which contains the value 0D i e a message from A120 to the master Embedded Command Byes A F Fi F2 Di 2 09 oe 05 05 7 0a 99 5 Stat UP according toHWSetings 0 Jo pr jojo jrjojoj i jofo Figure 18 Response Message of the Modicon A120 4 2 2 Stopping of the System The system message shown in Figure 19 describes the embedded command Stop User Program which is send from the periphe
23. o called protection byte is used in order to ensure a correct data transmission This byte is added to each system message For further details please see Figure 10 Display of Message Structure and Timing 20 Embedded Command Value for the Protection Byte CLOS NC CO CA EC E pr Aaa w GR CD I SN O EA EA pe Foa I Bem ACA COS CC CA CS A oe EE a ECO RA CAN E o 0 0 ee EE a E CI LS A IS Figure 10 Generation of the Protection Byte S The data transmission is protected via a odd parity check i e all bits which are neces sary for the parity are checked for the number of bits which are logical 1 Is the num ber of these bits an even number then the corresponding parity bit is set to 1 high in the other case it is set 0 low The parity check is carried out vertically For this all bytes max byte 1 up to byte 64 are listed is binary digits Each column now repre sents a bit string with an allocated parity bit The parity bit of each column is collected in a byte and represents the value of the protection byte This binary value must now be converted into a hexadecimal format This value now represents the last value in the message 20 Display of Message Structure and Timing 15 2 3 The Communication Time Frame The developer of peripheral devices has to pay special attention to a correct time syn chronization of the messages exchanged between the master and the slave station In case that the mas
24. ogram sequence has to be assigned to communication routine Figure 15 shows the recom mended steps when creating a system message The upper part of the chart shows de cisions related to the selected function mode number and content of different oper ands while the second part contains standard tasks which bring the message in its fi nal and correct form The developer of the program can define how the necessary decisions for the first part are made i e via menu methods or programs which support special applications How the the complete message is linked into the communication routine is indicated with position 2 In this process the communication routine guarantees trouble free transmission within the timing code Principle Program Structures 21 22 Select Embedded Command and Coding D6 D9 In case that unction 8 13 or 19 20 are n selected yes no Select Number of Information to be processed Define Operand Type Byte D10 oyo Start Address Bytes D12 D10 Enter Data Bytes D14 D64 i Y Define Message Length D1 D64 Calculate Parity of Bytes A D64 Arrange Bytes A D64 to String Loading of String for Sending Figure 15 Creation of System Messages Principle Program Structures 20 20 3 3 Analyses of Response Message For the evaluation of
25. orporation Copyright All rights are reserved No part of this document may be reproduced or transmitted in any form or by any means electronic or mechanical including copying processing or by online file transfer without permission in writing by Schneider Automation You are not authorized to translate this document into any other language 1999 Schneider Automation GmbH All rights reserved 20 20 gt q l Terminology Note This symbol emphasizes very important facts Caution This symbol refers to frequently appearing error sources Warning This symbol points to sources of danger that may cause financial and health damages or may have other aggravating consequences Expert This symbol is used when a more detailed information is given which is in tended exclusively for experts special training required Skipping this information does not interfere with understanding the publication and does not restrict standard applica tion of the product Path This symbol identifies the use of paths in software menus Figures are given in the spelling corresponding to international practice and approved by SI Systeme International d Unit s l e a space between the thousands and the usage of a decimal point e g 12 345 67 Chapter 1 Chapter 2 Chapter 3 Chapter 4 Objectives This documentation describes a special product feature of the programmable controller Modicon A120 the Communication Interface
26. r Byte 1 Byte Operand Output Byte QB e Operand System Marker Word SMW 2 Byte Operand Output Word QW e Operand Sytsem Marker Double Word SDW 4 Byte Operand Output Double Word QD e Operand Timer Bit T 1 Byte Operand j a TAW 2 Byte Operand Pera ie of the A120 firmware Timer Actual Value Timer Setpoint Value Counter Bit Counter Actual Value TSW 4 Byte Operand C 1 Byte Operand CAW 2 Byte Operand Counter Setpoint Value CSW 4 Byte Operand Start User Program UP acc to Hardware Settings Start UP in Cold Restart Mode Start UP in Hot Restart Mode Stop UP Standardize Signal Memory SM System specific afafjaja Standardize Signal Memory all Ranges Delete Declaration Number Terminate Data Declaration Declare SM Data multiple read Declare SM Data multiple read Declare SM Data multiple write Declare SM Data multiple write Single Read SM Data Single Read SM Data Read System Status List Read System Definition List Read free Declaration Number Multiple Data Read Single Write SM Data Single Write SM Data Write System Definition List CO Ol NIN OID DI OD aA a rm rm ny ry Write Target Equipment List Write Time and Date Multiple Data Write Values to be entered Range of Values RoV Ran
27. ral to the A120 Embedded Command Byes A F Fi F2 Di 2 09 oe 05 05 7 oa 99 S ES rrpp eee Figure 19 System Message Stop PC User Program In case that no transmission error has been detected the slave station Modicon A120 responds with the message shown in Figure 20 Embedded Command Byes A F Fi F2 0 2 05 4 0s 98 07 8 99757 Ra a ee eee Figure 20 Response Message Modicon A120 28 Examples 20 4 3 Single Read of three Successive Marker Bits Please note that the data which are read out of the Modicon A120 should always be a string of successive information and should always be read as a group e g marker bits Byte D10 20 Hex In the following example three marker bits have to be read out M31 7 M31 8 and M31 9 i e the value of byte D11 is 3 These markers are the continuously allocated numbers 999 1000 and 1001 999 03 E7 Hex The system message of the peripheral to the Modicon A120 contains the embedded command Single Read Signal Memory SM Data The message is shown in Figure 21 aa 160 10180 fil el ad ia tes ET E AEREA Ee El Figure 21 System Message for Single Read of Signal Memory Data In case that no transmission error has been detected the slave station Modicon A120 responds with the message shown in Figure 22 It is assumed that all marker bits have the value xx Due to the fact that the message is one byte shorter therefore the byte F1 is now 12 0C
28. reported free declaration number therefore is 17 10 27 1B Hex Embedded Command Byes A F Fi Fe Di 02 05 04 0s 8 07 D5 09 5 Read ree Dedaraton Number 0 foots rojopfoj jojojs o s 0 Figure 23 System Message Read the smallest free Declaration Number EEE ES A ee DTN DA DS DE Be BS D7 ease Be S Read ree Declaration Number 0 oD foayrofo o 7 ololsjoje ojml Figure 24 Response Message of the Modicon A120 4 4 1 2 Declaration of four successive marker bytes for multiple read In case that four successive marker bytes e g marker bytes 7 8 9 and 10 shall be read then they have to be defined in a declaration list In this example it is assumed that already ten other declaration lists have been defined before e the number of the declaration list is 27 1B Hex It is possible to add additional groups of data into the same declaration list e g a group of marker bits or other data Please be aware that the net data quantity must not exceed 55 bytes In this example no further data are declared besides the four marker bytes i e no further declaration message is necessary 30 Examples 20 Each declaration list must be activated with a so called activating message This can be a message End Data Declaration or a message for the declaration of a send con dition for further details please compare chapter 4 4 1 3 The system message of the peripheral request to the A120 contai
29. rker bit M2 1 or in other format marker bit M33 21 Hex changes from 0 to 1 This send condition can be defined for each declaration list and terminates the data declaration The system message request therefore has the same effect like the mes sage shown in Figure 29 End Data Declaration The Send Bit Supervision is then immediately active In extension of Figure 8 the structure of the system message for request of the send condition is shown in Figure 28 20 Examples 31 A Caution As already mentioned for Figure 8 the number for the I O slots slots no 1 up to 18 is shown in byte D9 in decimal format In the resp message the value for D9 has to be entered in hexadecimal format The byte D8 with its range of values RoV contains the declaration number for the decla ration list which names the desired marker bytes for details please see 4 4 1 2 This data declaration must be carried out before the send bit is declared because of the fact that the Send Bit Supervision is active immediately Please compare the message structure with Figure 8 fe eee Declare OC RoV SYS AD AD Send Condition OC RoV Pn EA AD AD Figure 28 Declare Send Condition Due to the fact that no input or output bit of an 1 O module is used as send condition but an internal marker bit M2 1 21 Hex of the ALU byte D9 0 is used as the send bit therefore byte D8 has the value 27 1B Hex the byte D10 has the
30. s occccccccccco es 34 Table of Contents vii viii Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13 Figure 14 Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 20 Figure 21 Figure 22 Figure 23 Figure 24 Figure 25 Figure 26 Figure 27 Figure 28 Figure 29 Figure 30 Figure 31 Figure 32 Figure 33 Figure 34 Table 1 Table of Contents Figures Possible Peripherals ocoococcoccocon ett eee eee 3 Polling Operation a See eee a 6 Master Slave Communication with Acknowledgement 00 2 eeeee eee 6 The Master Slave Communication with Information Response 0 5 7 The Master Slave Communication with Error Message 00ee eee eeee ees 7 Structure of the System Message 0 cece eens 9 Structure of the Message Header 0 cece eect ete eens 10 The Message Content of the System Message for the Request of the Master 11 The Message Content of a System Message for a Slave Response 13 Generation of the Protection Byte S 0 1 kee 15 Timing Diagram Polling Mode 0 cece nees 16 System Message Slave 0 cece cee teen eet e eee eee e eens 17 Response Message Slave Master 0 cece cece cence teen eee e nee 18 Communication Operation 0 00 cette eee eee 20 Creation of System Messages 0c cece ete eee een
31. s 22 Evaluation of the Response Message 0 eee ence tenet ene 23 System Message Start of PC User Program 0c cee cece eee nes 27 Response Message of the Modicon A120 0 cece eee 27 System Message Stop PC User Program 00 cece cece eee eens 27 Response Message Modicon A120 2 0 c eee tee eae 28 System Message for Single Read of Signal Memory Data o oooooo 28 Response Message of the Modicon A120 00 0 e eect eee 28 System Message Read the smallest free Declaration Number 29 Response Message of the Modicon A120 ocooccccccccc 29 Declaration of four successive marker bytes o occooccocccoccc 30 Response Message of the Modicon A120 0 cece eee tees 30 End Data Declaration ooocooccccoccnc teeta 30 Declare Send Condition 0 cece cee eee ENER Ta 31 Declare Send Condition Wade hack et ew ce awa 31 Response Message of the Modicon A120 0 0c eee eet eee 31 Send Data of the Declaration List 27 0 ccc cece cee eee teens 32 Response Message of the Modicon A120 ocooccccccccc eee 32 Cleanse single Declaration List in A120 0 cece ccc eee 33 Clear all Declaration Lists in A120 0 0 ccc ccc cette eens 33 Tables Operand OVENWICW so sess pis eee eae ea el A ee a Re RW ee 4 20 Chapter 1 The KS Functions This chapter describes the idea of the KS functions an
32. sage which is similar to the master message response but including the requested information Due to the fact that the response message is not sent immediately therefore short messages which are similar structured like polling messages are sent in the meantime Master PC Slave A120 Request Message Response Message with Information Figure 4 The Master Slave Communication with Information Response The MasterSlaveCommunication with Error Message The master sends a message with a control information or a data request to the slave request In case that an error occurs e g data fields are read which have not been configured then the slave responds with an error message similar to the master mes sage response This error message contains only the first four bits with a changed status The status is different to zero For details please see Figure 10 Due to the fact that the respective response message cannot be transmitted immedi ately after the request therefore short messages are interchanged in the meantime Master PC Slave A120 Send Message Response Message with Error Message Figure 5 The Master Slave Communication with Error Message Display of Message Structure and Timing 7 2 1 5 Message Types Two different message types the short message and the system message are possi ble for the four communication principles ment
33. subdivided into three element groups o Message Header o Message Content o Message Protection Figure 6 Structure of the System Message 20 2 2 1 The system message is merged using the before mentioned parts Note All values transferred into the message have to be in hexadecimal format The Message Header The message header consists of 9 bytes Only the first three bytes A F and F1 are of importance to the user The hexadecimal value of the byte F2 is always FO The header comprises the following information a The direction of the message a The length of the message content a The type of message Display of Message Structure and Timing 9 The structure of the message header is explained in the following ee EA E ES A E Message Header for Short Message in Polling Ope ration Message Header for Short Message in Communica tion Operation Values to be Entered Range of Values Range of Values Legend ie id a aa From Master to Slave Modicon A120 Request po f R O ESNE DAA AR ee E ae Number of Bytes within Message 0 5 6 64 Figure 7 Structure of the Message Header 2 2 2 The message type is coded in byte A A 0 stands for a system message The short messages length only one byte are mentioned only in order to complete the picture The byte F contains information whether a message is transmitted from the A120 or to the A120 Byte F1 defi
34. talled parametrization modules o All kinds of operator panels o Personal Computers production data acquisition PDA visual display system O Other intelligent peripheral devices This documentation includes all information necessary to be able to use the KS func tions for individual applications The main emphasis in this manual is the connection of devices to the Modicon A120 programming interface RS 232 C i e as a real point to point connection In principle it is also possible to use the KS functions via the commu nication interface ALU 202 An example for this is the MMI product Viewstar 200XA for A120 20 20 A120 Slave Figure 1 Possible Peripherals The KS Functions 3 1 3 Additional Possibilities using the KS Functions Using the KS functions the peripherals can be used for the following 0000 out request All operand types with different system defined address ranges can be used when control of the programmable controller define data blocks for cyclical read or write functions read data once or cyclical write data once or cyclical read data event controlled e receiving data from the programmable controller with reading or writing data In Figure 2 please find the possible address ranges The size of the resp address range is defined in the AKF12EN user program Table 1 Operand Overview Abbreviation Meaning Operands A
35. ter cannot fulfill the necessary timing code then unstable conditions or in the worst case a faulty communication can be the result The timing code of the programmable controller Modicon A120 is oriented on the re quirements of Personal Computers equipped with the MS DOS operating system regis tered trademark of Microsoft The developer has to differ between the polling time t_P and the waiting time t_W The polling time describes the time interval in which the corresponding communication partner has to send a message in the opposite direction The waiting time describes the max time interval after which the slave or the master station consider the commu nication as faulted and after which the stations generate the corresponding counter measures The reference of the resp time to the station type in the picture below is carried out with M master station or S slave station Please pay special attention to the waiting time t_WS In case that the predefined tim ing code for the resp operating mode is exceeded then the RS 232 port is standard ized and the I O buffer in the Modicon A120 is deleted The timing code for the polling operation is dimensioned in its operating description to 55 msec Figure 11 shows the timing diagram for this operating mode 55 ms 55 ms 55 ms 55 ms 55 ms Master SMG SMG A 81 Slave i i i SMG l i 81 i t PS1 n t PM1 i 1 i _ t_WM1 e
36. the messages please see chapter 3 2 for details about the linking into the program structure The most important point for the analysis of the response message is byte D9 In case that byte D9 is different to 0 then an error is detected Dependent on the error type the developer has to think about the consequences for his program In case that no error has been detected the developer can use the message in the program The operand type incl content will be analyzed and processed according to the application requirements if necessary Check Byte D9 Analyse Error according 0 Eye to Table Check String for Send Back Data a Send Message executed Data available as defined Assign Data to Operand Load Data for Routing e g Loading for Display Purposes Figure 16 Evaluation of the Response Message Principle Program Structures 23 24 Principle Program Structures 20 Chapter 4 Examples This chapter gives some examples about the use of the KS functions Examples 25 26 Examples 4 1 General The programmable controller PC Modicon A120 is able to process one system mes sage job message per program cycle and is able to load one response into the send buffer which is then send out The KS functions are processed always at the end of the PC program cycle In case that several system messages arrive in short s
37. uccession then they are stored in the input buffer If in addition to that also send conditions are present then the output messages be longing to it are stored into the send buffer Therefore it is possible to load several sys tem messages per PC program cycle These messages are then send asynchronous to the PC user program cycle They are processed according to the polluter pays princi ple i e send condition fulfilled or system message arrived The size of the send buffer is 1 kbyte and can therefore store a larger number of messages before an overflow happens The delay for the PC program cycle is appr 7 msec per system message single scan The declaration of data takes 20 up to 25 msec The future scan takes less than 7 msec When working with send conditions the capacity of the RS 232 port can be exceed ed The port works principally with 9600 Baud When neglecting the timing require ments nearly 900 short messages length 11 bit can be transmitted per second For system messages this number is considerably lower A complete system message with 55 user bytes has a total length of 69 bytes 69 11 bits 759 bits Therefore a total number of 12 6 complete system messages can be transmitted per second when ne glecting the timing When using send conditions this means that the developer has to make sure that at no time more than 10 messages per second should be generated Otherwise an overflow of the send buffer which c
38. ue of timer 16 to 33 The response message looks as follows pa a Fi Je 0 02 pos bs 0s poe 07 8 os S raeme suda o foots rojofoj ojo 7 ojo Figure 36 Response message of A120 20 Examples 35 4 6 Changing the Time and Date Time and date can be changed with the message shown below For example to change over from summer to winter time The date and time readings are achieved ba sically via the corresponding system marker In the following example the time and date 12 a m on 12 12 1990 should be set The corresponding job message is illustrated in Figure 37 The corresponding re sponse message is not shown here again Bytes ERAN EEE EE ee Figure 37 Write time and date Here D10 centuries D11 year D12 month D13 day D14 hour D15 minute D16 second 36 Examples 20 20 4 7 Reading of the System Declaration List The system declaration list contains data about the number of the configured markers system markers timers and counters This list is already defined declared in the A120 CPU and has the declaration number 1 constantly assigned to it It will be read out with the message type multiple read as described in chapter 4 4 1 The data structure of the response message is shown in the following The data has the format Word D10 D11 D12 D13 D14 D15 D16 D17 D18 D19 D20 D21 D22 D23 D24 D25 D26 D27 D28 D29 D30 to D54 No No No No No No No
39. value 20 hex and the bytes D12 and D13 have the values 00 hex and 21 hex The structure of the system message request is therefore AE A tes Bese Saco E A EA EN Figure 29 Declare Send Condition In case that no transmission error is detected the A120 responds with the message shown in Figure 31 eee ee eb tes Bese Send conan o Js oo o a e o e ee Figure 30 Response Message of the Modicon A120 32 Examples 20 4 4 2 Execution of a Declaration List 4 4 2 1 Periodic Scanning of a Declaration List Loading of the declared data without send condition is carried out in principle after the receipt of a corresponding system message request This request message can be send cyclical or event controlled from the peripheral to the A120 The system message request from the peripheral to the A120 contains the embedded command Multiple Read Data The data which will be transmitted here have been de fined in the declaration list with the number 27 1B hex The respective message is shown in Figure 31 SA mk A EEE EE tes M AE Figure 31 Send Data of the Declaration List 27 With the response message the slave station A120 sends the requested predeclared data The resp message is shown in Figure 32 A lA JNA i lt i A tes AA es ee E AE eae ee Figure 32 Response Message of the Modicon A120 According to the definition of the marker bytes in the declaration list the marker bytes 7 8 9 and 10
40. xchange active with the programmable controller Modicon A120 The following types of data exchange are possible 2 1 1 Polling Operation The master station Personal Computer scans the slave station in regular time in tervals in order to control the transmission link and to synchronize the exchange of data This is done with short messages SMG which contain only a systemdefined HEX character but no information Master PC Slave A120 Poll Message Poll Message Figure 2 Polling Operation 2 1 2 The Master Slave Communication with Acknowledgement The masterstation sends a message with control information or data to the slave re quest The slave then confirms the message with a long message similar to the struc ture of the master message response Due to the fact that response messages nor mally cannot be sent immediately therefore short messages SMG which have a simi lar structure as the polling messages are sent in the meantime Master PC Slave A120 Send Message with Control Information and Data a Logical Response Message Figure 3 Master Slave Communication with Acknowledgement 6 Display of Message Structure and Timing 20 20 2 1 4 The Master Slave Communication with Information Response The master sends a message with a data request to the slave request The slave an swers with a response mes
Download Pdf Manuals
Related Search
Related Contents
8ch standalone dvr - CCTV Cameras & Security Camera Systems KOHLER K-2054-0 Use and Care Manual Product Name - Forestry Suppliers, Inc. Desa Tech CGP10 Gas Heater User Manual EMUFDD 4.30 – NETWORK USER MANUAL 3.5", 5.25", 8" / FLAT 3A1026F G3 Reservoir and O-Ring Replacment Kit 点検要領 Untitled - Sea LC590.700.VE100 Samsung DVD-CM250 User Manual Copyright © All rights reserved.
Failed to retrieve file