Home
1775-6.5.1, PLC-3 Communication Adapter Module User Manual
Contents
1. From CMD STS DATA Application x Layer Network DST SRC CMD STS TNS From Application Layer Layer avis Packet Legend x low hex digit of CMD byte supplied by application layer 10064 1 DST and SRC The DST destination byte is the number of the station that receives the network packet The SRC source byte is the number of the station that sent the packet There are 255 possible station numbers from 0 to 254 decimal You reverse the DST and SRC of the command message to form the DST and SRC of the corresponding reply message CMD High Nibble The high nibble of the CMD command byte is supplied by the network layer Bit 6 26 value of the CMD byte is the command reply indicator It is 0 for command messages and 1 for reply messages Therefore the high hex digit of the command byte is 0 for command messages and 4 for reply messages The low nibble comes from the application layer STS Low Nibble The low nibble of the STS status byte is supplied by the network layer In a command message this field is set to zero In a reply message reporting no error or a remote error this field is also set to zero The high nibble comes from the application layer Chapter 12 Network and Application Layer Protocols If the network layer of your computer cannot deliver a command to another station it writes a local error code into this field to generate
2. Figure 9 1 The Application and Network Layers From CMD STS FNC ADDR DATA Application x Layer DST SRC CMD STS Ne From Application L ayer dm From Application Layer Packet Legend x low hex digit of CMD byte supplied by application layer 1006 1 The network layer uses these fields of a Data Highway command the destination DST and source SRC byte specify the address of the station that is receiving the command and the address of the station that is sending the command a command CMD byte at the network layer indicates whether the message is a command or reply a status STS byte at the network layer indicates whether the message was successfully executed by the sending station a transaction TNS field identifies the particular command and reply cycle the message belongs to Again these bytes and fields are described in much greater detail later in this manual Notice Figure 9 2 that the network layer DST CMD STS TNS and the application layer is treated as data by the data link layer We say that this data is framed by the data link layer The data link layer uses these fields of a Data Highway command start of text STX endoftext ETX enquiry ENQ acknowledge data link escape DLE negative acknowledge start of header end of transmission EOT block check character BCC
3. 4 10 Remote Station Address Specifications 4 12 EXDI6SSIOTI ue E ENG woes ERAN Eua 4 1 p P M 5 1 General Sete eee 54 Editing the Message Instruction 5 1 Allocating Memory 5 2 Editing Message Procedures 5 2 Table of Contents Message Procedure Commands General ceo kr IGRROE CES Assignment Command CREATE Command DELETE Command Execule iilos sie Gan Sted e dh edebat EXIT Command GOTO Command IF Command ON_ERROR Command STOP Command Functions Comments 0 0 0 ccc cece eee eee eens Error Reporting bes debct Reporting Error Codes Recovery from Errors Error Programming Gerieral zoe erstes abt etd e ares Individual Commands Message Procedure Compu
4. Remote Error Codes Received from the 1773 Module Error Error Code Type number of bytes after the TNS is not a multiple of 4 For PLC PLC 2 word write commands 1 A 2 byte ADDR field is expected after the TNS word but only one byte is present 2 There is an odd number of data bytes in the command packet 3 The ADDR value is odd that is it does EM not specify a word address For PLC 3 read commands 1 There is more than one byte of data after the byte address 2 Number of bytes to read is odd 3 Number of bytes to read is zero 4 Number of bytes to read is greater than the maximum allowed in reply packet 244 5 Sum of packet offset and size of data in words is greater than 65 535 6 Sum of packet offset and size of data in words is greater than the total transaction size For PLC 3 bit write commands More than 4 bytes of data exist after the PLC 3 address in the command message For PLC 3 write commands 1 There is not at least 2 bytes of data after the end of the block address 2 There are an odd number of data bytes after the end of the block address 3 Sum of packet offset and size values specifies more than 65 535 words 4 Sum of packet offset and size is greater than total transaction size 83 reply For all PLC PLC 2 read and write commands The local 1775 KA module has executed a B 5 Remote Error
5. Not Full gt lt pr CK Timeout DLE ENQ DLE OK 10048 1 In Figure 10 12 retransmission occurs when noise hits both sides of the line This type of noise destroys the DLE ACK while also producing invalid characters at the receiver The result is that the receiver changes its last response to NAK and the transmitter retransmits the original message packet 10 19 Chapter 10 Full Duplex Protocol Figure 10 12 Message Transfer with Retransmission SOURCE XMTR LINK RCVR SINK DLE STX DLE EXTBCC Not Full XXXX gt DL CK ug e Timeout DLE ENQ x DLE DLE STX DLE EXTBCC Message Discarddill x DLE ACK OK HJ Note that this is detected as a duplicate message 10049 1 Figure 10 13 shows a DLE NAK response to the initial message transmission because the message sink is full After the message sink is no longer full a retransmission of the message causes a DLE ACK response 10 20 SOURCE OK Chapter 10 Full Duplex Protocol Figure 10 13 Message Transfer with Message Sink Full XMTR LINK RCVR SINK DLE STX xxxx DLE EXT BCC Full DLE DLE STX xxxx DLE ETX Full DLE
6. Transmit BCC TXFREE Deallocate UART RETURN 10083 1 D 12 Appendix D Detailed Flowcharts Figure D 14 SEND Subroutine Input e Link Data Byte SEND Common e TXWAIT A Sleep Variable Disable Processor Interrupts Enable UART Transmit Interrupt SLEEP UART Transmitter Suspend at Empiy TXWAIT Yes Disable UART Transmit Interrupt Output Byte to UART Indivisible Zone Enable Processor Interrupts NOTE This figure assumes the use of a Z80 SIO Return 10084 1 D 13 Appendix D Detailed Flowcharts Figure D 15 SENDDATA Subroutine SENDDATA Input e Link Data Byte TXALLOC Allocate UART or Wait SEND Transmit Link Data Byte SEND Is Data Yes Byte DLE Transmit a Second DLE TXFREE De allocate UART RETURN 10085 1 D 14 Appendix D Detailed Flowcharts Figure D 16 TXALLOC Subroutine SLEEP Wait at TXALWT Until UART is Free Set IN USE Flag Indivisible Zone Common RETURN e N USE Flag e TXALWT A Sleep Variable 10086 1 Figure 0 17 TXFREE Subroutine 11667 TXFREE Common Reset INCUSE e N USE Flag Flag e TXALWT A Sleep Variable WAKEUP Continue Any Proces
7. d etel ud tow p 2ng CI uo igi igi ctal Hi igi igi cta 3 d Digit Byte M 3 Digit b Physical Read Write ADDR Field Set this bit to 0 to select low byte of word 10065 1 Since ADDR specifies an address as the number of bytes from the beginning of PC memory its value is double the corresponding PC word address The PLC 3 logical addressing format also applies to PLC 3 type commands You can use this format to specify up to 6 levels of PLC 3 extended addressing Figure 12 5 shows an example of the logical addressing format for addressing a word in the PLC 3 data table The first field in the format contains a set of bit flags Each flag is associated with one of the levels of a PLC 3 extended address If a flag bit is set to 1 there must be an address specification for the corresponding level in the address fields that follow If a flag bit is zero the address fields that follow should not contain an address specification for that level instead a default value is assumed 12 11 Chapter 12 Network and Application Layer Protocols 12 12 The default address is 3 data table 1 Current context All others 0 You must always specify the value for the lowest level of the desired extended address even if it is the default value Since the present PLC 3 recognizes a maximum of 7 levels of extended addressing you cannot specify more than 7 levels with the logical addressing format If
8. 1771 KF Module A Y Allen Bradley Data Highway PC PC PC Up to 64 Stations 10006 1 Chapter 2 Installation Interfacing a PLC 3 controller to a PLC 2 Family processor through a 1771 module in a point to point link Figure 2 6 Figure 2 6 Linking a PLC 3 to PLC 2 Family Controller PLC 3 Controller Modem m 1775 KA Module PLC 2 Controller Modem NC NOTE Modems required only for 1771 KG Module distances greater than 50 feet 10007 1 2 9 Chapter 2 Installation Interfacing a PLC 3 controller as a slave station on a multipoint modem link Figure 2 7 Figure 2 7 Linking a PLC 3 to a Multi drop Modem Link Computer Multidrop Modem Master Station Multidrop Modem Link gt PLC 3 Controller Modem D L p FR 2 UL TES SERRE 1775 KA Module 10008 1 Slave Stations The first four applications above use the module
9. PLC 4 PLC 4 Microtrol Product Guide 1773 800 1773 6 5 1 In this chapter the addressing formats are presented in shorthand notation The notation used is as follows lt bit gt the number of a particular bit within the addressed word lt fileaddr gt the logical address of a PLC 3 file lt filesym gt asymbolic address of a PLC 3 file lt offset gt the number of words between the beginning of the file and the desired word offset is zero for the first word of a file lt size gt number of words of data to be transferred lt wordaddr gt the logical address of a PLC 3 word wordsym symbolic address of a PLC 3 word 4 1 4 Addressing Rules and Examples Number Systems 4 2 An expression can be used in place of any of the above fields in an address Within the above listed fields of an address specification numbers are interpreted as decimal base 10 unless you indicate that they are octal base 8 You can specify an octal number by enclosing the number in parentheses and starting it with a leading zero For example 17 is interpreted as decimal 17 but 017 is interpreted as octal 17 or decimal 15 An exception to the above rule occurs when addressing a word in the input or output sections of PLC 3 memory In these cases the word address lt wordaddr gt is normally interpreted as an octal number regardless of leading zeros To express an input or output word addres
10. SLEEP WAKEUP WAKEUP NOTE Sequence of processor execution is indicated by circled numbers 10090 1 The SLEEP and WAKEUP subroutines are always used in connection with some type of indivisible process interlock Indivisibility is achieved on many processors as on the Z80 by disabling processor interrupts For this reason SLEEP and WAKEUP assume that interrupts are off when they are called They will always return with interrupts off When one process calls SLEEP the results is a return from a call to WAKEUP by another process When a process calls WAKEUP the result is a return from a call to SLEEP by another process An interrupt subroutine that calls WAKEUP is viewed as a subroutine of the interrupted process Figure D 20 shows an example of interaction between SLEEP and WAKEUP In this example process B work up process A some time ago Now at 1 when A goes to sleep actual execution resumes after the wakeup call in B at 3 and 4 Some time later process C at an interrupt for example calls WAKEUP at 5 Execution flow proceeds to the instructions at 8 following the call to sleep in process A The next time A calls SLEEP the WAKEUP call in C will terminate This is not the only possible implementation of SLEEP and WAKEUP A second alternative implementation would allow a process to call D 17 Appendix D Detailed Flowcharts WAKEUP without losing immediate control of the processor If B wakes
11. lt Under MODULE STATUS select the option for 1775 At this point LIST presents you with the following menu for the 1775 K A module DATA HWY COMM ADAPTER nn CHASSIS cc SLOT ss 1 MODULE OPTIONS 2 DATA HIGHWAY PORT 3 MODEM PORT ENTER NEXT In the above and all following menus represents the thumbwheel setting of the 1775 K A module represents the chassis number and ss represents the number of the chassis slot containing the module For more information about the LIST function refer to Publication 1775 800 PLC 3 Installation and Operation Manual Module Options Selecting option 1 MODULE OPTIONS from the above menu section titled Programmable Configuration Parameters causes LIST to present the following menu KA nn MODULE OPTIONS 1 TIMEOUT 2 SEND UNPROTECTED 2 21 Chapter 2 Installation 2 22 3 ACCEPT UPLOAD DOWNLOAD 4 ACCEPT WRITES 5 BACKUP OPERATION 6 PLC 2 MASK ENTER NEXT This menu allows you to select options that apply equally to both the modem port and the Data Highway port of the 1775 K A module These options are described below Timeout The timeout is the maximum amount of time that the 1775 K A module will wait for another station to reply to one of its messages The allowed entries are to 9999 expressed in increments of 1 10 second LIST displays the timeout as xxxx 10 SEC Thus if you enter a timeout value of 100 the timeout per
12. DLE STX xxxx DLE EXT gt Not Full gt DLE ACK 10050 1 10 21 Chapter 10 Full Duplex Protocol If you were to connect a line monitor to the wires between station A and B and only the A to B subsystem were active you could observe the following Examples Normal Message STXxxxxDLE ETX BCC Path 1 DLE STX xxxDLE ETX BCC DL Path 2 DLE ACK DLE ACK Message with parity or BCC error and recovery STXxxxxDLE ETX BCC Path 1 DLE STXxx xxDLE ETX BCC DL s Path 2 DLE NAK DLE ACK Message with ETX destroyed Path 1 DLE STXxxxxx timeout DLE ENQ DLE STXxxxxDLE ETX BCC Path 2 DLE NAK DLE ACK Good message but ACK destroyed Path 1 DLE STXxxxDLE ETX BCC timeout DLE ENQ DLE STXxxx etc Path 2 DL CK DLE ACK Messages being sent in both directions Path 1 DLE STXxxxDLE ETX BCC DLE STXxxxxDLE ETX BCC DLE STX Path 2 DLE ACK DLE ACK Path 3 DLE STXxxx ETX BCC DLE STX Path 4 DLE ACK Combined Circuit AB DLE STXxxxDLE ETX BCC DLE STXxxxxDLE ETX BCC DLE ACK DLE STX Circuit BA DLE STXxxxDLE ACKxxxxDLE ETX DLE ACK DLE STX mbedded respons ACK on AB delayed sligh
13. DLE DLE encodes the value 10 hex in the network packet This is necessary to distinguish a text code of 10 hex from a DLE control code of 10 hex DLE ETX BCC terminates a message packet DLE ENQ requests the retransmission of the last received transmission The full duplex response codes sent by a station receiving a message are 10 3 Chapter 10 Full Duplex Protocol DLE ACK signals that the receiver has successfully received the last message sent DLE signals that the receiver did not successfully receive the last message sent Link Layer Message Packets A link layer message packet starts with a DLE STX ends with a DLE ETX BCC and includes all link layer data codes in between Data codes can occur only inside a message packet Response codes occur inside a message packet If you select the embedded responses option with LIST chapter 2 the response codes can also occur between a DLE STX and a DLE ETX BCC but these response codes are not part of the message packet they are referred to as embedded responses Figure 10 1 shows the format of a link layer message packet for full duplex protocol and the layer at which each portion should be implemented At the end of each message packet is the one byte BCC field Figure 10 1 Link Packet Format for Full Duplex Protocol From Applicaion Layer From Network Layer Data DLE STX From Network Layer 10038 1 10 4 Chapter 10
14. Either results in setting the remote error bit for the associates The PC is faulted rung 84 Execution of a message at the remote station was aborted because of a hard communication error on the cable or on backplane access between the module and the PC This error results in the setting of the remote error bit for the associates rung 85 An attempt to access an illegal address in the remote PC has aborted message execution Illegal accesses may result from Access outside the data table as defined at the remote station Access outside a memory access window protected commands only Either results in setting the remote error bit for the associated rung 86 Execution of a command is disabled at the remote station by a DIP switch option This error results in setting the remote error bit for the associates rung 87 The remote PC is in PROGRAM or REMOTE PROGRAM mode or the remote KA is in download mode This error results in setting the remote error bit for the associated rung 88 Execution of protected commands at the remote station is inhibited because its PROG light is on This error results in setting the remote error bit for the associated rung 89 The remote station has no memory to store messages This error will only be signalled after 5 re tries at half second intervals Remote Error Codes Received from the 1773 KA Module It indicates that either
15. Mil Modem NOTE Modems required only for distances greater than 50 feet a mmm gg Eee 1775 KA Module 10004 1 Chapter 2 Installation Interfacing a PLC 3 controller with a computer either directly or through modems Figure 2 4 Figure 2 4 Linking a PLC 3 Station to a Computer PLC 3 Controller m Modem ee mne see ft jo gt hes 1775 KA Module Modem 10005 1 2 7 Chapter 2 Installation Interfacing PLC 3 controller with a remote Data Highway through a modem link Figure 2 5 Figure 2 5 Linking a PLC 3 Station to a Remote Data Highway PLC 3 Controller B a Modem ERED u g Ji EX lw a 1775 KA Module NOTE All PCs are Allen Bradley 2 8 Modem
16. N 1 F EUN 14 2 3 RS 232 C X CHANNEL RS 232 C Connector 7 13 CAMS onnector Modulo is 3 2 of 1771 KG or 1771 KE KF Module 25 14 4 r 4 5 5 6 6 8 8 20 11 Conductors 2 and 7 3 and 25 must be twisted pairs for distances longer than 50 feet Set switch 3 on the 1775 OFF when the module is communicating with another Allen Bradley device 10009 If you want to connect the 1775 module to a 1775 K A module through the RS 232 C channel use the cabling pinout diagram Figure 2 9 to construct your own cable Chapter 2 Installation Figure 2 9 Connection to Allen Bradley 1775 KA Module Connect the Shield at One End Only N f pes 77 1 gt 2 3 RS 232 C CHANNEL RS 232 C Connector 7 25 Cer onnector 35 3 lt 2 of 1771 Module 25 7 4 4 5 5 6 6 8 8 20 20 Conductors 2 and 7 3 and 25 must be twisted pairs for distances longer than 50 feet Set switch on the 1775 KA OFF when the module is communicating with another Allen Bradley device 300103 If you want to connect the 1775 K A module to a modem or computer use the cabling pinout diagram Figure 2 10 to construct your own
17. 10041 1 Chapter 10 Full Duplex Protocol We could show paths 2 3 and 4 in a similar way The full duplex protocol is symmetrical that is anything that we can say about transmitter A receiver B and paths 1 and 2 applies equally to transmitter B receiver A and paths 3 and 4 There are actually two independent instances of the protocol operating simultaneously For simplicity we define the link protocol on the subsystem that carries messages from A to B with reference to figure 10 5 Figure 10 5 Message Transmission from A to B Transmitter jr 10042 1 Although the protocols on each subsystem operate independently there is a slight delay when you transmit a response code in the middle of a stream of message codes Also any non transient hardware problem that affects message codes traveling over a hardware circuit affects response codes on the same circuit Message Characteristics In the network layer chapter 12 the message source provides the transmitter with the messages it sends The message sink tells the receiver what to do with the messages it receives Upon request from the transmitter the message source supplies one network packet at a time It must be notified about the success or failure of the transfer to the receiver before supplying the next message When the message source is empty the transmitter waits in an inactive state until a message is available 10 8 Chapter 10 Full Duplex Proto
18. Full Duplex Protocol Block Check The block check character BCC is a means of checking the accuracy of each message packet transmission It is the 2 s complement of the 8 bit sum modulo 256 arithmetic sum of all data bytes between the DLE STX and the DLE ETX BCC It does not include any other message packet codes or response codes For example if message packet contained the data codes 8 9 6 0 2 4 and 3 the message packet codes would be in hex 10 02 08 09 06 00 02 04 03 10 03 EO DLE STX Data DLE ETX BCC The sum of the data bytes in this message packet is 20 hex The BCC is the 2 s complement of this sum or EO hex This is shown in the following binary calculation 0010 0000 20 hex 11011011 15 compliment 1 1110 0000 2s compliment EO hex To transmit the data value 10 hex you must use the data code DLE DLE However only one of these DLE data bytes is included in the BCC sum For example to transmit the values 8 9 6 0 10 4 and 3 hex you would use the following message codes Represents single data byte value of 10 10 02 08 09 06 00 10 10 04 03 10 03 D2 DLE STX Data DLE ETX BCC In this case the sum of the data bytes is 2E hex because only one DLE text code is included in the BCC So the BCC is D2 hex Chapter 10 Full Duplex Protocol The BCC algorithm provides a medium level of data security It cannot detect transposition of bytes during transmission of a packet It also cannot detect the
19. NU Allen Bradley PLC 3 Communication Adapter Module Cat No 1775 KA User Manual Table of Contents Introduction 1 1 Generali 2028 wk ad Sb 4 4 About This 21 1 Module Description 1 4 Specifications dus da cade vee 1 6 5 4 6 Installation RR Rom Ren 2 1 General css Lies LE ue RI ees 21 Hardware Installation 2 1 Programmable Configuration Parameters 2 1 Backup Configurations 2 2 Multiple 1775 KA Modules One PLC 3 2 33 Data Highway 3 1 General ume REIR EDS Rus 3 1 Some Terminology 3 1 Levels 3 4 Bala dae i ieena du QS 3 6 Addressing Rules and Examples 4 1 General ee 4 1 Number Systems 4 2 558 ede an 4 3 SVMOGIS 44 PLC 3 Address Specifications 4 7 PLC PLC 2 Address Specifications
20. station addresses 010 010 The module assume 440 the station addresses 010 After switchover Backup PLC 3 Primary PCL 3 You previously set these station addresses 010 010 The module assume the station addresses 110 010 10013 1 Chapter 2 Installation Using Manual Switchover After you select the BACKUP OPERATION for a rev D or later 1775 module you may choose to use your PLC 3 backup system for manual switchover In manual switchover you must initiate the switchover by changing the position of a switch in a backup cable Refer to the PLC 3 Programmable Controller Backup Concepts Manual pub 1775 803 for more details You must be sure to turn off the faulted PLC 3 processor before you begin the switchover however If a manual switchover occurs the PLC 3 processor is waiting for a the response is ignored response another station on the Data Highway is you may not receive a response from initiating a message either PLC 3 processor You must program other stations on the Data Highway to recover from this condition you are only communicating with the the other stations on the Data Highway primary PLC 3 will receive time out errors for messages they send after the primary goes deactive and before switchover occurs You can program the MSG instruction to execute a message upon switchover or you can send commands to the backup PLC 3 processor Figure 2 13 As long as you get responses f
21. One of the following may be true Packet lost on ring or Two or more controllers on the loop have the same ID number PLC 4 Microtrol must be allocated Undefined function Function not available this mode Controller number is invalid Invalid Parameters B 15 Remote Error Codes Received from the 1773 Module Improper command may return this error code EEPROM bad No reply queued Device resource unavailable if these error codes occur they will most likely occur during controller The 1773 KA module then aborts the message Illegal accesses may result because Invalid Read Write length or All Bit writes not to the same PLC 4 or Invalid address or start up This error occurs if you attempt to access an illegal address in a 85 Memory Protection Violation 86 The command cannot be executed because of the switch settings on the 1773 KA module 87 The controller you have addressed is in Program mode This error results in setting the remote error bit for the associated rung 88 Reserved 89 1773 KA unable to buffer message in memory This error will only be signalled after 5 re tries at half second intervals It indicates that either a very heavy traffic load is being presented to the remote station or that the dynamic memory of the remote station is corrupted If the problem clears up after cycling power and does not recur the cause may
22. Tell Network Layer of Failure 11 10 10053 1 Chapter 11 Half Duplex Protocol Transceiver Actions Since the transceiver receives dirty input from the physical world it must be capable of responding to many adverse situations Some of the things that can conceivably happen are listed here The message sink can be full leaving the transceiver with nowhere to put message message can contain a parity error The BCC can be invalid The DLE SOH DLE STX or DLE ETX BCC may be missing The message can be too long or too short spurious control or data code can occur outside a message A spurious control code can occur inside a message Any combination of the above can occur The DLE ACK response can be lost causing the transceiver to send a duplicate copy of a message that has already been passed to the message sink Each slave station is in a passive mode until it receives a DLE ENQ or DLE SOH code While in a passive mode a slave ignores any transmission code that is not DLE ENQ or DLE SOH When a slave receives a DLE SOH it resets its BCC accumulator and message receiving buffer The next code it receives must be its specific station number of the global station number 377 octal If the packet does not contain the appropriate station number the slave ignores it and waits for the start of a new transmission If a slave receives a message packet with the appropriate s
23. These control characters are described in greater detail later in this manual The type of protocol you choose for the data link layer determines the meaning of these control characters 9 3 Chapter 9 Computer to PC Communiation Figure 9 2 The Application Network and Data Link Layer of RS 232 C Communication Full or Half Duplex From STS FNC ADDR DATA Application Layer N N N N N N N N Data From DST SRC CMD STS ds From Application Layer pon N p x we AN po E P pr Nd x x P d x Data Data Link DLE STX From Network Layer BLE mom Layer Packet Full Duplex Link Packet and Half Duplex Slave Packet From CMD STS FNC ADDR DATA Application Layer N N N N N N N N Data k DST SRC STS TNS icati etwor From Application Layer Layer Data Data Link DLE SOH STN DLE A From Network Layer DLE BCC layer Packet Half Duplex Master Message Link Packet 10037 1 9 4 Full Duplex vs Half Duplex Protocol for the Data Link Layer Chapter 9 Computer to PC Communication We use the term protocol to describe the relationship between two similar layers at two different stations The protocol could for example be the relationship between the d
24. counter are stored as consecutive words in the same file Addressing a Word Range To address a range of words in PLC 3 memory use one of the following formats lt wordaddr gt lt size gt lt filesym gt lt offset gt lt size gt lt wordsym gt lt size gt Figure 4 5 is an example of addressing a range of PLC 3 words Figure 4 5 Example of Addressing a Range of PLC 3 Words N 15 9 20 Number of words to Address of first word be transferred to be transferred Delimiter 10022 1 You may use word range only as source field in an assignment command The destination must be a file that is as large as or larger than the source range Addressing a Word To address a single word in PLC 3 memory use one of the following formats 4 8 Chapter 4 Addressing Rules and Examples lt wordaddr gt lt filesym gt lt offset gt lt wordsym gt Note that lt wordaddr gt is interpreted as an octal value if the addressed word is in an input or output file Otherwise lt wordaddr gt is interpreted as a decimal value section titled Number Systems To access words in the pointer of floating point sections of PLC 3 memory use the PLC 3 extended addressing format You can read about extended addressing in PLC 3 Programmable Controller Programming Manual pub 1775 6 4 1 Addressing a Bit To address a specific bit within a PLC 3 word use one of the following formats lt w
25. create the reply message packet copy over certain information from the command fill in any reply information submit the packet to the network destroy the command packet Application programs communicate by sending information back and forth in the command status and data fields of network packets Application protocols may vary depending on the types of application programs that are communicating Application Message Fields Figure 12 2 shows the general format of the application fields for a command message Not all command messages have FNC ADDR or DATA bytes Figure 12 3 shows the general format of the application fields for a reply message Not all reply messages have DATA bytes In addition to the application layer fields shown in these figures some of the PLC 3 command messages also contain these application layer fields EXT STS extended status Packet Offset Chapter 12 Network and Application Layer Protocols Word Offset TOTAL TRANS total transaction size Appendix lists the message formats command and reply of every command the PLC 3 can send or receive CMD and FNC command and function For these message formats which include an FNC byte the low nibble of the CMD command byte together with the FNC function byte define what action the command executor at the destination station will perform For those message formats which do not include an FNC byte the CMD byte alone defi
26. into the same bytes of the corresponding reply message Do not change the TNS value in a reply message If you do the command initiator will not be able to match its command to the corresponding reply message Note that the low byte least significant bits of your TNS value will be transmitted across the link before the high byte most significant bits At any instant the combination of SRC CMD and TNS values are sufficient to uniquely identify every message packet in transit for duplicate message detection At least one of these fields in the current message must be different the command executor ignores the current Chapter 12 Network and Application Layer Protocols Application Layer 12 6 message During an upload or download the TNS value is the only way to distinguish between the physical read or write reply messages Recall from chapter nine that the application layer provides the Data Highway commands that you use to transfer data and manage the network This function is provided by the command initiators and command executors At the application layer the command initiators are responsible for creating a message packet and submitting that packet to the network layer maintaining the sequence number and the timeout accepting the reply canceling the timeout and sequence number destroying the reply message packet when it is no longer needed At the application layer the command executors must
27. 3 000 4 000 5 000 6 000 7 000 The receiver is designed to sense the signal generated by a similar transmitter and is electrically isolated from all other circuitry on the module It consists of an opto isolater circuit with an input and return connection at the RS 232 connector other signals on the RS 232 connector are driven and received by standard RS 232 interface circuits and have a maximum drive capability of 50 feet Chapter 2 Installation Pinout The necessary RS 232 C port connections are described in Table 2 D below Table 2 D RS 232 C Port Connections Signal at the 1775 KA Abbreviation Input Output chassis shield drain transmitted data TXD 2 Output received data RXD 3 Input request to send RTS 4 Output clear to send CTS 5 Input data set ready DSR 6 Input transmitted data return TXDRET 7 4 data carrier detect DCD 8 Input data terminal ready DTR 20 11 Output received data return RXDRET 25 13 TXD transmitted data caries serialized data It is output from the RS 232 connector RXD received data is serialized data input to the RS 232 connector RXD and RXDRET are isolated from the rest of the circuitry on the module RTS request to send is a request from the RS 232 connector to the modem to prepare to transmit It typically turns the data carrier on When you select the full duplex mode RTS is always asserted When you select the half duplex mode RTS is turned on wh
28. 3 processor It does not assume that you have any prior knowledge of the Allen Bradley Data Highway Organization The remaining chapters of this manual are organized as follows Chapter 2 describes installation of the 1775 K A module Chapter 3 presents concepts and terminology for operating the 1775 module on the Data Highway Chapter 4 presents general rules for specifying the data addresses you use in message procedures Chapter 5 explains how you create and edit message procedures and commands for the 1775 K A module Chapter 6 describes the command language you use in programming message procedures Chapter 7 describes how the 1775 K A module detects and reports various types of errors Chapter 8 presents detailed examples of 1775 K A module commands and message procedures Chapter 9 introduces a layered approach to writing a driver to enable a computer to communicate to the 1775 K s RS 232 C channel Chapter 1 Introduction Chapter 10 describes how to write a full duplex line driver to enable a computer to communicate to the 1775 K A s RS 232 C channel Chapter 11 describes how to write a half duplex line driver to enable a computer to communicate to the 1775 K A s RS 232 C channel Chapter 12 describes the network and application layers of a software driver to enable a computer to communicate to the 1775 K A s RS 232 C channel Appendix A sh
29. ASCII symbol W F SIZE DLE ETX BCC 8 characters max 00 B File symbol address plus word offset DLE STX DST SRC 575 TNS FNC PACKET TOTAL 0 01 OFFSET TRANS ASCII symbol WORD SIZE DLE ETX BCC 8 characters max EIU OFFSET C Logical Address DLE STX DST SRC CMD STS TNS FNC PACKET TOTAL OF 01 OFFSET TRANS PLC 3 logical symbol SIZE DLE ETX BCC 2 51 bytes Reply Format This is the same as he reply packet format for all reads A Format when successful execution E DATA Max of 244 bytes or 122 words A 15 Appendix A Message Formats B Format when reporting an error DLE STX DST SRC CMD TNS ETX DLE ETX Bcc 4F STS Where the extended status byte 15 optional Word Range Write Use this write command with a word symbol a file symbol plus a word offset or a logical address as a starting address This starting address must point to a word in a file This write command can write a block of data The function code is 0 zero A special case of this command is the single word write where the data field is only one word long Command Format A Word symbol address DLE STX DST SRC CMD STS TNS FNC PACKET TOTAL OF 00 OFFSET TRANS WIF DATA Max of 228 bytes DLE ETX BCC 00 or 114 words B File symbol address plus word offset DLE STX DST SRC CMD STS TNS FNC PACKET T
30. C5 3 CCUM 23 etc 2 The key data table word specifier was 4 characters long and began with a T C or P but it did not match the legal word specifiers e g CM 3 3 There was no colon following a legal word specifier Missing colon between file and word Illegal word specifier in a data table address Illegal context specifier When an expression determined the context in a data table address or when the global context context 0 was specified in a data table address a colon followed the context Attempt to execute a symbol not defined as a process The system symbol exists but refers to a symbolic address rather than to a process B 9 endix B Remote Error Codes Received from the 1773 Module 10 Error Error Code Type 169 192 194 199 200 201 202 203 204 205 206 local local local local local local local local local local local Either the number or the expression following the an address has a value outside the range 0 to 15 decimal Value specified in a bit assignment statement was other than a zero one Illegal use of EXIT command Illegal use of STOP command STOP encountered in procedure Attempt to read write at bad address Unable to evaluate the expression in the given base This will occur for example if the argument of a FROM BCD function is not a valid BCD bit pattern It will also occur when invalid
31. Codes Received from the 1773 Module Error Error Code Type shutdown request to the local PLC 3 processor For all PLC 3 read and write commands The local 1775 KA module has executed a shutdown request 84 reply For diagnostic status commands determination of the physical address of the end of the ladder diagram program or of the backplane error occurred during lk end of user memory In polled mode the RS 232 C port has received a NAK which caused a system reset For all PLC PLC 2 read and write commands Local PLC 3 backplane error either memory parity or timeout disconnect In polled mode the RS 232 C port has received a NAK which caused a system shutdown For all PLC 3 read and write commands Backplane error memory parity or timeout disconnect In polled mode the RS 232 C port has received a NAK which caused a system reset 85 reply For diagnostic read commands The command is an illegal request to read from the 1775 KA module s backplane window For PLC PLC 2 read commands 1 PLC 3 file does not exist 2 PLC 3 file is too small 3 PLC 3 file is more than 65 535 words long For PLC PLC 2 bit write commands 1 PLC 3 file does not exist 2 Destination bits do not exist in PLC 3 file 3 Length of PLC 3 file is greater than 65 535 words For PLC PLC 2 word write commands 1 The destination file does not exist in PLC 3 memory 2 The destination word does not exis
32. DST identifies the 1775 station DLE STX separates the data link protocol information from the network packet Link layer data 00 0F and 11 FF hex encodes the bytes of the network packet DLE DLE encodes the value 10 hex in the network packet This is necessary to distinguish a text code of 10 hex from a DLE control code of 10 hex DLE ETX BCC terminates a message or polling packet DLE ENQ indicates the start of a polling packet Response codes from station receiving a message or poll DLE ACK signals that the receiver has successfully received the last message sent DLE NAK serves as a global link reset command It causes all slaves to cancel all messages they have ready to transmit to the master The 1775 module responds to this by writing error code 84 into its error word in the PC data table DLE EOT is the response that a slave sends to a poll from the master when the salve has no messages to send Link Layer Packets Half duplex protocol uses three types of transmissions Polling packet Master message packet Slave message packet The master station transmits both polling packets and master message packets while slave stations transmit slave message packets Figure 11 1 illustrates the formats of these packets Note that the slave message packet has the same format as the full duplex message packet The master message packet is the same as the slave message packet
33. ENTER MESSAGE Enter the message type This is always 1 1 ENT TYPE for the 1775 KA module Enter a single 1775 KA assignment PROC 1 ENT command or the name of a message procedure In this case the name of the message procedure is PROC 1 End edits EE ENT Allocating Memory Before the 1775 K A module can transfer data to or from any file in PLC 3 memory that file must exist and it must have enough memory allocated to it to accommodate the data transfer You can create and allocate a file using the PLC 3 memory management commands Refer to the PLC 3 Programming Manual publication 1775 801 for a description of memory management Editing Message Procedures Table 5 B shows an example of editing a message procedure through an Industrial Terminal connected to a 1775 S4A module Table 5 C shows how to edit the same message procedure through a data terminal connected to a 1775 S4B module 5 2 Table 5 Example of Editing a Message Procedure Through an Industrial Terminal Create the message procedure In this ME MH1 ENT case MH1 mean Data Highway message procedure number 1 Enter message procedure commands other commands Note that you must use either an EXIT or a H022 B0 5CC 1 ENT STOP command to end each procedure B0 6 CC 1 2 ENT EXIT ENT CANCEL CMD Insert the symbol definition for the name of IS ENT the message procedure ENTER SYMBOL Enter the name of the message procedure PROC 1 ENT S
34. Each command can be abbreviated to the letters shown in the format column of Table 6 A In general it is best to abbreviate a command to the shortest possible form This not only makes the commands easier to program but it also saves memory space and reduces execution time 6 1 Chapter 6 Message Procedure Commands Assignment Command 6 2 Blanks may be inserted anywhere to improve the readability of a message procedure However blanks should be kept to a minimum because they use memory space and slow execution of the message procedure The assignment command is the most fundamental yet versatile of all the commands Its primary purpose is to copy data from the source location to the destination location Table 6 B lists the various types of sources and destinations Any type of source in Table 6 B may be used with any type of destination listed Table 6 B Data Source and Destination Types Direct Value Procedural user symbol Procedural user symbol except when source is remote Interprocedural user symbol Interprocedural user symbol except when source is remote Logical address Logical address Local symbolic address Local symbolic address Global symbolic address Global symbolic address Expression Of special interest is the case where a user symbol is the destination of the assignment In such a case if the user symbol was not previously defined in the message procedure a new symbol is generated If th
35. Module t______ 10044 1 10 11 Chapter 10 Full Duplex Protocol Table 10 A Transmitter for Full Duplex Protocol TRANSMITTER is defined as loop Message GET MESSAGE TO SEND Status TRANSFER Message SIGNAL RESULTS Status end TRANSFER Message is defined as initialize nak limit and enq limit SEND Message start timeout loop WAIT for response on path 2 or timeout if received DLE ACK then return SUCCESS else if received DLE NAK then begin if nak limit is exceeded then return FAILURE else begin count NAK retries SEND MESSAGE message start timeout end end else if timeout begin if enq limit is exceeded then return FAILURE else begin count ENQ retries send DLE ENQ on path 1 start timeout end end end loo SEND Message is defined as begin BCC O send DLE STX on path 1 for every byte in the message do begin add the byte to the BCC send the corresponding data code on path 1 end send DLE ETX BCC on path 1 end GET MESSAGE TO SEND This is an operating system dependent interface routine that waits and allows the rest of the system to run until the message source has supplied a message to be sent SIGNAL RESULTS This is an implementation dependent routine that tells the message source of the results of the attempted message transfer WAIT This is an operating system dependent routine that waits for any of several events to occur while allowing other parts of the system to run 10 12 Chapte
36. RS 232 C port of the 1775 K A module and you will not be able to enable it again through LIST until you select a different station number If you make no selection the station number will be 377 by default Baud Rate This option specifies the communication rate over the RS 232 C port The choices are 110 baud 2400 baud 300 baud 4800 baud 600 baud 9600 baud 1200 baud 19200 baud For long line communication the maximum allowed rate is 4800 baud The default baud rate is 1200 baud see Table 2 D Backup Configurations Chapter 2 Installation Communication Mode This option determines whether the RS 232 C port of the 1775 module can operate in a half duplex polled or full duplex unpolled mode Select full duplex for point to point communication through the RS 232 C port Select half duplex if the 1775 K A module is installed as a slave station on a multipoint modem link If you make no selection the 1775 selects the full duplex unpolled mode by default Even Parity This option determines what kind of parity check is used for all communications through the RS 232 C port If option 5 EVEN PARITY is selected the 1775 module will test for even parity in all communications through its RS 232 C port If this option is not selected the module will not perform any parity checking At power up the PLC 3 disables the even parity option by default Send Embedded Responses
37. Received from the 1773 KA Module Local and Reply Error Codes Local and Reply Error Code Listing for the PLC 3 Processor Error Error Code Type 32 Local The size of the local file involved in a file assignment command is greater than 65 535 bytes 34 local station number greater than 376 octal was specified for the remote address in an assignment command 35 local Attempt to send unprotected command is invalid 37 local The per packet timeout which can be set through LIST ran out before a reply was received This means that the remote station acknowledged ACK the command message but did not send the reply in the allotted time cf error 92 81 reply For diagnostic read commands 1 A 2 byte ADDR field and a 1 byte SIZE field are missing after the FNC byte in the command message 2 The number of bytes of data requested in the SIZE field is greater than the maximum number allowed per reply packer 244 or SIZE is 0 zero For PLC PLC 2 read commands 1 The required 2 byte ADDR field and 1 byte SIZE field are missing in the command message 2 The ADDR value is odd that is it does not specify a word address 3 The value of SIZE is 0 zero 4 The value of SIZE is greater than 244 5 The SIZE value specifies an odd number of bytes For PLC PLC 2 bit write commands Incomplete bit description because the B4
38. a very heavy traffic load is being presented to the remote station or that the dynamic memory of the remote station is corrupted If the problem clears up after cycling power and does not recur the cause may be or CPU failures triggered by heat or noise If the problem recurs repeatedly the probable cause is too many messages Remote Error Codes Received If the remote station has a 1773 K A module the remote error codes will from the 1773 KA Module have the meanings listed in the table below 81 Illegal command This error is sent from the 1773 KA if the command message was incorrect in any of the following command code subcommand code and size of the command or the requested reply size This error results in the setting of the remote error bit for the associated rung Controller is already allocated to a RS 232 C device or to PLC 4 Microtrol Programmer orExtended PLC 4 Microtrol function is in progress Some condition exists with a controller on the loop Either the cable between the 1773 module and a controller is unplugged or the addressed controller is not on the loop Either results in setting the remote error bit for the associated rung 84 Execution of a message at the 1773 KA module was aborted because of a hard communication error on the cable between the module and a controller on the loop This error results in the setting of the remote error bit for the associated rung
39. address of the counter block 2 An acknowledgment is part of the data highway protocol C 1 Appendix Diagnostic Port Counters Modem Port Counters C 2 At this byte offset This counter is stored 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Command messages sent Reply messages received Command messages received Reply messages sent received sent received sent Undeliverable reply messages Computer link timeout preset to 500 msec Maximum number of NAKs accepted per message preset to 10 Maximum number of ENQs sent per messge preset to 10 Current NAK count Current ENQ count Overview Detailed Flowcharts The flowcharts in chapter 10 and 11 give a simplified view of an example of software logic for implementing full duplex protocol In this appendix we present flowcharts which give a detailed view of an example of software logic for implementing full duplex protocol We have not shown any error checking or recovery relating to interaction with the modem handshake driver a third process To do this would overly complicate the flow charts and in many cases such error checking and recovery are not needed Figure D 1 Data Flow Program for Full Duplex Protocol Data Link Layer Physical Link Layer Messages Mult
40. base 10 numbers unless you indicate that they are octal base 8 You can specify an octal value by starting the number with a leading zero For example 17 in an expression is interpreted as decimal 17 but 017 is interpreted as octal 17 or decimal 15 Operators This section describes the operators listed in Table 4 B Bit Operator The bit operator allows you to address a specific bit of a value stored under a user symbol For example the statement 112 24 7 US_3 4 puts the value 0 or 1 of bit number 4 of user symbol US_3 into input file 12 word 24 bit 7 The bit address itself can also be a user symbol or an expression For example in the statement 112 24 7 US_3 44 US_1 the expression 4 US_1 specifies a particular bit within user symbol US_3 Note that the value appearing after the bit operator must be within the range of values allowed for bit addresses Since user symbols are 32 bit values a bit address for a user symbol must be in the range of 0 to 31 decimal Bit addresses for data table words must fall in the range of 0 to 15 decimal Logical Operators The logical operations are complement AND and OR These operations are used to construct logically true or false conditions They are generally used in decision statements such as the IF command see section titled IF Command chapter 6 4 15 4 Addressing Rules and Examples The result of a logical complement is 1 true i
41. be RAM or CPU failures triggered by heat or noise If the problem recurs repeatedly the probable cause is too many messages B 16 Diagnostic Counter Block Data Highway Port Counters At this byte offset This counter is stored 18 19 20 21 22 23 24 25 26 27 28 29 NOTES Bad CRC on acknowledgement 2 Local error A No acknowledgment before timeout occurred Local error B Contention while master detected message transmission by another station Acknowledgment contained an error Local error C Local errors Sum of A B and C above Waits no receive buffer space at destination station Timed out master failed False polls failure to transfer Received acknowledgment when not master Message size too small less than 5 bytes Incorrect DST or SRC DST Memory not available for receive buffer Received message has bad CRC value 2 Message too long Message arrived when no buffer space left Retransmissions of previously received message Aborts result of line noise Messages successfully transmitted Messages successfully received Command messages sent Reply messages received Command messages received Reply messages sent 1 The address of the first byte of the counter block can be determined by using the diagnostic status command Addresses of the other bytes listed here can be derived by adding the appropriate number of bytes to the staring
42. bytes enter the ASCII codes for the 1 to 8 characters of the symbol name If the symbol name is more than 8 characters long enter only the first 8 characters Figure 12 6 Format for PLC 3 Symbolic Address First character Second character Etc Eigth Character 0 Zero 10067 1 The physical addressing format applies only to PLC 3 physical read and physical write commands Physical word addresses run in sequence starting with 0 zero for the first word of PLC 3 memory Physical addresses occupy 2 words 4 bytes in the following bit format Fuse nez wes xao ATO ATA ATT Second byte o jo jo jo o jo jo Third byte AT as aa AT Fourth by ATejAIS AT4 ATS AT2 Chapter 12 Network and Application Layer Protocols In this format A1 through A24 represents the 1 to 24 bits of the physical address For example to address a command message to physical word address 12 200 decimal 002FA8 hex you would use the following binary code in the address field TT T DET semon e f fe Pe Le fe femnas Third byte e pere p p EC ma Packet Offset Fourth byte A single message packet cannot transmit more than 244 bytes of user data To allow for data transfers of more than 244 bytes the 1775 KA module automatically transmits as many packets as necessary to complete the message Thus a message may consist of several packets strung together The packet o
43. cable 2 16 Chapter 2 Installation Figure 2 10 Connection to user Supplied Modem or RS 232 C Device RS 232 C MM CHANNEL Connector of 1775 KA Module Set Switch ON to ground 25 Protective Ground 1 Transmitted Data 2 Received Data 3 232 Request to Send 4 evice Clear to Send 5 Data Set Ready 6 Signal Ground 7 Line Signal Detect 8 mE Data Terminal Ready 20 25 Return 10011 1 Private lines are permanently connected phone lines used with modems Dialup is not needed Usually the modem hold the handshake lines in the proper states The RS 232 port can be connected to standard American dial up modems and some European modems Other European standards specify that the DTR signal will cause the modem to answer the phone whether it is ringing or not causing the phone to always be busy Since the modem port asserts DTR while waiting for a call it cannot be used with such modems The types of dial up network modems that can be used are classified into the following types Manual these are typically acoustically coupled modems The connection is established by human operators at both ends who then insert the handset into couplers to connect the computers DTE controlled answer these unattended modems are directly connected to the phone lines A module controls th
44. characters occur in numeric values e g 57 12X Function being used is not defined Expression is too complex Attempt to divide by zero Bad port specifier That is the character following the is other than H h M or m User symbol used as part of remote address specification Undefined data following assignment command This error would occur for instance if the modifier UNRPOT were used instead of UNPROT Error in remote specification 1 A character other than or following the station number specification H045 T 2 Something other than EOL PROT or UNPROT following a remote source address 012 55 8 9 Third party transfer That is in an assignment command both the source and the destination were remote addresses Error in evaluating a PLC 2 address or PLC 2 address greater than 65 535 Zero range specified in an assignment command Remote Error Codes Received from the 1773 KA Module Error Error Code Type 207 local Word range specified in destination address 208 local Destination and source addresses disagree in type 209 local Not of data highway message type 210 local Use of a non PLC 3 type address in a local address operand does not exist or the word specified is beyond the end of the file 211 local In an assignment command one of the local files 213 local A local fi
45. do this Note that the CREATE command for memory allocation is different than the CREATE command for creating symbolic addresses Chapter 6 The following rules apply when specifying a PLC 3 logical address in a message procedure 1 Symbolic addresses must be defined to either the word level or the file level of specification 2 A word address may be either a a block address specified to the word level b a symbolic address of a word or c a symbolic file address followed by a colon and an offset 3 Asize specification must be preceded by a word address and a comma 4 An offset specification must be preceded by a file address and a colon 5 A bit number must be preceded by a word address and a slash 6 To access the pointer or floating point sections of memory extended addressing must be used These rules are applied in the formats given below for addressing PLC 3 data locations Addressing a File The format for addressing a PLC 3 file is one of the following lt fileaddr gt lt flesym gt For assignment commands that copy data from one file to another both the source and the destination file must be exactly the same size 4 7 4 Addressing Rules and Examples For PLC 3 timer and counter files it is important to note that the data words are stored in the following order CTL PRE ACC That is the control preset and accumulated values for a given timer or
46. either the Data Highway or the Modem port OFF Module is disabled due to a fault in the PLC 3 processor or Data Highway port is disabled through the LIST function 1 Depends on amount of data highway activity 2 5 Chapter 2 Installation 2 6 Data Highway Cable Connections There are two cable connectors or ports on the front of the 1775 KA module Figure 2 1 The bottom port labeled DATA HWY is for connection to the Allen Bradley Data Highway If you are using the 1775 module in a Data Highway application plug the Data Highway dropline cable into this port For details on the installation of the Data Highway cable refer to the Data Highway Cable Assembly and Installation Manual publication 1770 810 RS 232 C Cable Connections The RS 232 C port labeled MODEM INTERFACE on the 1775 module can interface with any RS 232 C device that is capable of understanding and generating the communication protocol described in this chapter Some typical RS 232 C applications are Interfacing two PLC 3 controllers through a modem link Figure 2 3 Figure 2 3 Linking Two PLC 3 Controllers PLC 3 Controller 0 Modem p uU rm cH SOC 1775 KA Module PLC 3 Controller
47. exactly the same size as source file H045 N4 17 B3 5 20 20 words starting at word 5 of binary file 3 Destination file must be large enough to accept full range being transferred H045 N4 17 B3 5 H045 N4 17 5 B3 5 13 ju et Decimal bit numbers 10033 1 Data File Word range Word Bit Priority Write Chapter 8 Programming Examples Writing Data to a Remote PLC PLC 2 Station Assignment Statement 021 040 B3 l Destination PLC PLC 2 file must be at least as large as source PLC 3 file H021 040 B3 5 20 20 words starting at word 5 of binary file 3 Destination file must be large enough to accept all words being transferred 021 040 B3 5 13 021 040 5 B3 5 13 Decimal bit numbers 021 040 lt B3 5 A Priority assignment command nprotecten Write affected by switch settings at remote PLC PLC 2 station refer to publication 1771 802 or 1774 6 5 8 H021 040 B3 5 U Unprotected command Space required 10034 1 8 3 Chapter 8 Programming Examples Message Procedure Figure 8 4 presents a printed listing of a Data Highway message procedure As the listing indicates the purpose of the procedure is to monitor the state of a status bit in a remote Data Highway station Figure 8 4 Example Data Highway Message Procedure PROCEDURE REM_TURNON This procedure will monitor the state of a bit in
48. format for the label is LABEL _A Nothing else may appear on the same line with the label The label itself must conform to the same rules of construction as user symbols do The trailing colon is required when you first generate the label but do not use the colon any other time you refer to the label When a GOTO command is encountered execution of the message procedure resumes with the first command after the label specified in the GOTO Note that you cannot use the GOTO command to jump from one procedure to another even if the procedures are nested The IF command makes logic decisions in the message procedure Table 6 A shows the format of the IF command The first parameter of the IF command is an expression Chapter 4 The entire expression must be enclosed in a set of parentheses The expression may be made as complex as desired through the use of multiple operators and nested expression The second element in the IF command is an embedded command If the value of the expression is true 1 the embedded command is executed If 6 7 Chapter 6 Message Procedure Commands ON_ERROR Command 6 8 the value of the expression is false 0 the embedded command is not executed The embedded command may be any of the available commands except another IF or an ON_ERROR Figure 6 1 demonstrates the combination of a label a command and an IF command to construct a simple loop that assigns the integers 0 through 7
49. insertion or deletion of data values of zero within a packet Two Way Simultaneous Operation On a two way simultaneous link two physical circuits connect four distinct and independent software routines Figure 10 2 shows these software routines as transmitters XMTR A and B and receivers RCVR A and B Figure 10 2 Data Paths for Two Way Simultaneous Operation Path 1 Transmitter Receiver A B A B 10039 1 There are also four independent data paths involved Paths 1 and 3 carry message codes between A and B paths 2 and 4 carry response codes between A and B A software multiplexer combines those message codes and response codes going in the same direction At the other end of the link a software separator separates those message codes from the response codes Internal software directs the message codes to the receiver and the response codes to the transmitter On each physical circuit you can intermingle response codes from a receiver to a transmitter with message codes sent from a transmitter to a receiver unless you do not choose the embedded response option in LIST Figure 10 3 shows this implementation 10 6 Chapter 10 Full Duplex Protocol Figure 10 3 Software Implementation of Data Paths Transmitter Receiver A Software Multiplexer Software Separator 10040 1 Figure 10 4 shows path 1 with unrelated parts of Figure 10 3 removed Figure 10 4 Data Path 1 Transmitter icd
50. of a Z80 S10 10097 1 D 23 Appendix D Detailed Flowcharts Figure D 28 Receive Interrupt Subroutine RECEIVE INTERRUPT NOTE This figure assumes the use of a 780 10 WAKEUP AT RXDWAIT INTERRUPT RETURN 10098 1 Figure 0 29 SENDNET Subroutine Input SENDNET e Message Buffer An Implementation Dependent Routine to Put a Message on the INPUT Queue Reset the BUFFER Flag RETURN 10099 1 D 24 Appendix D Detailed Flowcharts Figure D 30 GETBUF Subroutine GETBUF Is there a Buffer GETFREE Get an Empty Buffer Is there No a Buffer RETURN Save Ad dress of Set the BUFFER Flag RETURN 10100 1 D 25 Appendix D Detailed Flowcharts Figure D 31 GETFREE Subroutine CHE An Implementation Dependent Routine to Try to Allocate an Empty Message Buffer RETURN D 26 10101 1 Symbols Empty 2 24 A Addresses 4 3 4 5 Addressing rules 4 1 addressing a file 4 7 addressing a word 4 8 4 11 addressing a word range 4 8 4 10 expressions 4 13 4 14 number systems 4 2 PLC 3 address specifications 4 7 PLC PLC 2 address specifications 4 10 remote station address specifications 4 12 symbols 4 4 4 5 4 6 Application layer protocol 12 6 ADDR address 12 10 application message fields 12 6 CM
51. or until its retry limit is exceeded When the slave transceiver receives a DLE it discards the current message The next time the slave is polled it will send the next message available from the message source If no message is available in the message source the slave responds to a poll with DLE EOT Chapter 11 Half Duplex Protocol When the slave transceiver receives a DLE NAK it takes messages from the source until the source is empty It discards each message while sending an error code back to the source The master can use this to clear the message source buffer of each slave after the master has been down Half Duplex Protocol Diagrams The following figures show the events that occur on various interfaces Control characters are shown in bold type Link level data is represented by xxxx Line noise is represented by Each message packet is shown ending in BCC Time is represented as increasing from the top of the figure to the bottom Figure 11 4 shows normal message transfer from the master to a slave Figure 11 4 Normal Message Transfer SOURCE SOURCE SINK MASTER LINK SLAVE SINK DLE SOH STN DLE STX xxxx DLE ETXBCC Not Full DLE ACK OK 10054 1 11 13 Chapter 11 Half Duplex Protocol Figure 11 5 shows a message transfer in which the BCC was invalid After a timeout the message is retransmitted After the retransmis
52. reported at the remote station The correlation is as follows B 1 Remote Error Codes Received from the 1773 Module 2 These codes are sent by the 1775 This error code is then stored at the command station decimal STS byte hexadecimal EXT STS byte hexademical not used no error not used 81 not used 83 not used 84 not used 85 not used 86 70 not used 87 F0 1 231 F0 2 232 F0 3 233 F0 4 234 F0 5 235 F0 6 236 F0 7 237 F0 8 238 F0 9 239 F0 10 240 241 Note that a value of FO hex in the STS byte indicates that the EXT STS byte actually contains the error code for the reply message Currently only the 1775 KA module is capable of generating and accepting reply messages with error codes reported in this way In particular 1771 KA and 1774 K A modules cannot interpret these error codes The meaning of each error code depends on the command message that the local PLC 3 station receives from a remote station Section titled Local and Reply Error Codes describes the error conditions that the various commands can generate The error codes are listed according to the decimal value that would be stored at the command initiating station Remote Error Codes Received from the 1773 Module When a remote station transmits command the local 1775 module might issue a reply message that contains
53. section gt 63 context gt 15 or section gt 15 232 reply For all PLC 3 read and write commands Three or fewer addressing levels specified in for a PLC 3 word address 233 reply For all PLC 3 read and write commands Conversion of a file address to a block address resulted in more than 9 addressing levels 234 reply For all 3 red and write commands Symbolic address not found 235 reply For all PLC 3 red and write commands Symbolic address is of length zero or is longer than 8 bytes 236 reply For PLC 3 read commands 1 File not found 2 Destination address does not have enough levels to specify a PLC 3 word for word range reads or a file for file reads 3 The PLC 3 address specifies more levels than required 4 Word specified by the PLC 3 address does not exist For PLC 3 bit write commands 1 File not found 2 Destination address does not specify a PLC 3 word 3 The PLC 3 address specifies more levels than required 4 Word specified by the PLC 3 address does not exist For other PLC 3 write commands 1 Destination file not found 2 Destination address does not point to a word for word writes file for file writes 3 Destination address specifies more levels than required B 12 Remote Error Codes Received from the 1773 Module Error Error Code Type 4 Fir
54. send a protected write command only if a switch at the remote PLC PLC 2 prohibits other stations from sending unprotected write commands Unprotected commands can access any area of the data table By default command messages generated by the assignment command in PLC 3 message procedures are of the protected type To generate an unprotected command message use a blank space and the modifier U after the assignment command DELETE Command Chapter 6 Message Procedure Commands For example the command H027 0121 17407 would generate a protected write command to write the value 1740 7 into word 121 of Data Highway station 27 The command 027 0121 17407 U would generate an unprotected command to do the same thing You may disable the transmission of unprotected commands through LIST options section titled Module Options chapter 2 The CREATE command generates a symbolic address and assigns it to a logical address Table 6 A illustrates the format of the CREATE command To create a local symbolic address use the CREATE command by itself the modifier LOCAL is optional To create a global symbolic address use the modifier GLOBAL after the CREATE command In either case the symbol has meaning only at the station where it was created The modifier GLOBAL can be abbreviated to G and LOCAL can be abbreviated to L For example the statement C G TOTAL 0 0 0 7 creates the global
55. specify the scope of the system symbol it is assumed to be local Note that the terms local and global symbols should not be confused with local and remote stations Both local and global symbols having meaning only at the station in which they were generated User Symbols A user symbol represents a numeric value You can generate a user symbol and assign a value to it by means of the assignment command Chapter 7 User symbols are either procedural or interprocedural Procedural user symbols are known only to the procedure in which they are generated Interprocedural user symbols are known to the procedure in which they are generated and to any other procedure nested within that procedure User symbols can contain data that is up to 32 bits long If the high order bits are insignificant that 1s if they can be truncated without changing the value of the data then the contents of the user symbol can be stored in a data field that is less than 32 bits long Attempting to put a data value into a field that is too small for it will generate an error code of 189 Appendix B PLC 3 Address Specifications Chapter 4 Addressing Rules and Examples The PLC 3 processor uses logical addresses to reference data in memory No PLC 3 address is valid unless it memory location has been allocated You can allocate memory by using the CREATE command in PLC 3 programming The PLC 3 Programming Manual publication 1775 6 4 1 explains how to
56. support only one channel Chapter 10 Full Duplex Protocol Full Duplex Protocol 10 2 In general full duplex protocol gives higher data throughput but it can handle communication between only two peer stations Half duplex protocol provides master slave polling capability and can handle communication with as many as 255 slave stations but it gives lower data throughput This chapter describes the data link layer for full duplex protocol Chapter10 describes the data link layer for half duplex protocol Chapter 12 describes the network layer and the application layer for both protocols The full duplex protocol resembles ANSI 28 1976 specification combining features of subcategories D1 data transparency and F1 two way simultaneous transmission with embedded responses You can use full duplex protocol for a point to point link or a multidrop broadband MODEM link that allows two way simultaneous transmission It is more difficult to implement than half duplex because it requires you to use interrupts and multi tasking programming techniques It is intended for high performance applications where you need to get the highest possible throughput from the available communication medium At the 1775 K A module select the unpolled mode with the LIST function chapter 2 Transmission Codes Full duplex protocol is a character oriented protocol that uses the ASCII control characters extended to eight bits by adding a
57. the I O Scanner Message Handling Module cat no 1775 S4B Using the 1775 K A module Using the 1775 GA 7 5 General Individual Commands Programming Examples This chapter presents some detailed examples of 1775 K A module commands and message procedures The first set of examples shows individual commands that could be programmed directly into a PLC 3 message MSG instruction Figure 8 1 illustrates the differences in reading and writing data between two PLC 3 stations Figure 8 2 shows how to write different types of data to a remote PLC 3 station Figure 8 3 shows how to write different types of data to a remote PLC or PLC 2 station Figure 8 1 Reading and Writing PLC 3 Data Word Reading word 5 of binary file 3 at data highway station 045 into word 17 of integer file 4 10012 MSG STAT RE MESSAGE TYPE 1 ET CTL FB200 0000 200 STAT CHANNEL E2 5 1 DN 47 15 NA 17 H045 B3 5 STAT ER 13 Destination Source local remote Writing word 5 of binary file 3 into word 17 of integer file 4 at data highway station 045 10012 MSG STAT Ea MESSAGE TYPE 1 ERES CTL FB200 0001 200 STAT CHANNEL E2 5 1 DN 15 H045 N4 17 B3 5 STAT ER 13 Destination Source remote local 10032 1 8 1 Chapter 8 Programming Examples Data Type File Word range Word Bit 8 2 Writing Data to a Remote PLC 3 Station Assignment Statement HO45 N4 B3 Lo Destination file must be
58. the memory protect keyswitch is off but will reject the write commands and return an error code of 86 if the memory protect 2 23 Chapter 2 Installation keyswitch is on At initial power up the module enables the ACCEPT WRITES option by default Backup Operation This option determines whether or not a pair of 1775 KA modules will provide backup for each other Enable option 5 BACKUP OPERATION for both the primary and backup 1775 K A modules to enable backup operation as described in section 2 3 backup configurations If you make no selection for option 5 backup operation is disabled by default The revision C or earlier version of the module does not have the BACKUP OPERATION option PLC 2 Mask This option determines whether or not the 1775 K A module will mask out the upper octal digit of the source address when receiving a PLC 2 type command from another station If you enable option 6 PLC 2 MASK the module mask out the upper digit of the address for selecting the input file This causes stations with common second and third digits of their address to access the same input file For example stations 023 123 223 and 323 would all access input file 023 If you disable option 6 each station accesses a unique input file with the same number as the station number For example station 123 would access input file 123 station 223 would access input file 223 If you make no selection for option 6 the PLC 2 MASK option
59. to successive words in binary file 50 Figure 6 1 Example of Looping 0 LOOP B50 NUM NUM NUM 1 IF NUM LE 7 GOTO LOOP 10027 1 The ON ERROR command specifies what action should be taken if an error is encountered during execution of the message procedure The ON ERROR command is not executed sequentially in the procedure it is executed only when an error occurs Table 6 A illustrates the format of the ERROR command The ON ERROR command contains an embedded command that is executed when an error occurs The ON ERROR command applies to all other commands between itself and the next ON ERROR command For example consider the following sequence STOP Command Functions Chapter 6 Message Procedure Commands command line 1 command line 2 ON_ERROR GOTO RECOVER command line 3 command line 4 ON_ERROR ERR_CODE B2 16 command line 5 In this sequence the first ON_ERROR command applies to command lines 3 and 4 while the second ON_ERROR command applies to command line 5 Some command lines might not have an ON ERROR command that applies to them If an error occurs in such a command line the procedure will stop executing Appendix B lists the error conditions The STOP command terminates execution of the MSG instruction in the PLC 3 ladder diagram program This means that the STOP command stops execution of the current procedure and all procedures nested t
60. transfer but the corresponding reply message actually contains the data being transferred In write operations the command message contains the data being transferred and the reply message merely reports the status receipt or non receipt of the transfer The PLC 3 processor must be free to control its own processes at the same time that the 1775 K A module is communicating over the Data Highway For this reason both the processor and the module have their own programs and programming languages Figure 3 1 illustrates how these two programming levels processor and module interrelate PLC 3 Program The first link in the communication process is your PLC 3 ladder diagram program You send a Data Highway command message by means of the message MSG instruction Figure 3 1 shows a typical MSG instruction Chapter 3 Data Highway Communication When the rung becomes true the message instruction begins sending command s across the Data Highway At the same time bits in a control file word change their state Table 3 B to reflect the status of the command Even if the rung becomes false the message command will continue to send commands across the highway Table 3 B The Status of Bits in a Control File Word WHEN the message instruction is true the enable bit 16 is set the latched enable bit 12 is set the remote Data Highway module has received the message instruction the request bit 17 is set the 1775 KA
61. 100 FS Fs 46 1000110 F 1D 0011101 GS Gs 47 1000111 G 1E 0011110 RS Rs 48 1001000 H 1 0011111 US Us 49 1001001 20 0100000 SP none 4A 1001010 J 21 0100001 none 4B 1001011 K 22 0100010 4C 1001100 L Y Appendix Message Formats 23 0100011 none 4D 1001101 M none 24 0100100 none 4E 1001110 N none 25 0100101 none 4F 1001111 0 none 26 0100110 amp none 50 1010000 P none 27 0100111 none 51 1010001 Q none 28 0101000 52 1010010 29 0101001 none 53 1010011 54 1010100 T 1 Will be dislayed when Control Code Display option is set on A 6 55 1010101 56 1010110 57 1010111 58 1011000 59 1011001 5A 1011010 5 1011011 5 1011100 50 1011101 5 1011110 5 1011111 60 1100000 61 1100001 62 1100010 63 1100011 64 1100100 65 1100101 66 1100110 67 1100111 68 1101000 69 1101001 c lt lt oO a a Message Formats 9 Dat 1101010 6A 6B 1101011 6C 1101100 6D 1101101 6E 1101110 6F 1101111 0 70 1110000 71 1110001 q 72 1110010 r 73 1110011 s 74 1110100 t 75 1110101 u 76 1110110 V 77 1110111 w 78 1111000 x 79 1111001
62. 5 6 5 1 January 1985 Copyright 1992 Allen Bradley Company Printed in USA
63. ATION ADAPTER Data Highway Port Indicators RS 232 C Port MODEM NTERFACE r Data Highway Port DATA HW 10000 1 In addition the module provides the following software features Programmable configuration parameters Command language that allows for complex logic decisions looping and nesting Symbolic representation of data and addresses Embedded arithmetic expressions and logic operations Decimal octal or BCD binary coded decimal data entry Chapter 1 Introduction Specifications Function Interface the PLC 3 Processor with the Allen Bradley Data Highway and or with an RS 232 C device Location Single slot in PLC 3 main chassis or expander chassis Communication Ports Data Highway RS 232 C Modem Applications Table lists the specifications for the 1775 module Table 1 C Module Specifications Communication Rate To Data Highway 57 6 kilobaud recommended Backplane Power Requirement 2 5A 45V DC Ambient Temperature Rating 0 o 60 C operational 400 to 85 C storage To modem programmable from 110 baud to 19 2 kilobaud Cabling To Data Highway Data Highway dropline cable Cat no 1770 CD or equivalent Humidity Rating 5 to 9596 without condensation To modem Modem interface cable cat no 1775 or equivalent As already mentioned the 1775 K A module serves tw
64. ATUS A 6 QTOD 2 copy time of day hrs mins IF ERROR GE 81 AND ERROR LE 92 GOTO NO STN no station fatal error IF A GE 72 GOTO TIMEOUT after ten errors tell operator 8 EXIT rd NO STN energize 1775 54 report generation rung 554 3 5 1 exit procedure with an error STOP TIMEOUT energize 1775 S4B report generation rung 1 return to _ 10035 1 8 4 Chapter 8 Programming Examples Some of the statements in the sample procedure are not necessary to accomplish the bit monitoring However they were included to illustrate more of the functions and programming techniques available with the 1775 KA module Note that the 300 second timer used in this example is not an accurate real time clock This is because the time between successive executions of the bit timer check depends on Data Highway activity and on the activity of the local PLC 3 processor For example if the 300 second timer times out immediately after its done bit is checked the 1775 module will not detect this condition until its next pass through LOOP2 If the Data Highway is busy with other activity it will take a while for LOOP2 to check the remote bit PLC 3 ladder diagram programming provides better timer updates and responses The example procedure also assumes that the referenced memory areas have been created Specifically 1 Status file S5 must be big enough to hold a reasona
65. Been Made 1 RETURN 10080 1 D 9 Appendix D Detailed Flowcharts UART Sharing Figure D 11 shows the transmitter XMIT and receiver RCVE routines sharing the transmit side of the UART XMIT transmits messages and inquiries RCVE transmits responses Therefore each must wait until the other is thru before it can transmit thru the UART The TXALLOC and subroutines work together to ensure that XMIT and RVCE do not try to use the UART at the same time TXALLOC and TXFREE are called in the SENDCTRL SENDETX and SENDDATA subroutines Figure D 12 Figure D 13 and Figure D 14 Figure D 11 Sharing the Transmit Side of the UART XMIT RCVE gt lt TXALLOC P cod ye UART U Not In Use a Signal e TS REC n ise TXFREE XMIT RCVE 10081 1 D 10 Appendix D Detailed Flowcharts Figure D 12 SENDCTL Subroutine SENDCTL TXALLOC Input e Control Code Allocate VART or Wait SEND Transmit DLE SEND Transmit Control TXFRE E Deallo cate RE TURN 10082 1 D 11 Appendix D Detailed Flowcharts Figure D 13 SENDTX Subroutine SENDTX Input TXALLOC Allocate UART Common or Wait e RESP The Response Code Variable SEND Transmit DLE SEND Transmit ETX Zero Out Any Previous Response Code at RESP SEND
66. Communication Adapter Module cat no 1771 User s Manual 1771 802 Communication Controller Module cat no 1771 KC KD User s Manual 1771 811 1771 6 5 8 PLC 2 Family RS 232C Interface Module cat no 1771 KG User s Manual 1771 822 1771 6 5 15 Data Highway RS 232 C Interface Module cat no 1771 KE KF User s Manual 1773 801 1773 6 5 2 PLC 4 Communication Interface Module cat 1773 KA User s Manual 1774 819 1774 6 5 8 Communication Adapter Module cat no 1774 User s Manual 6001 800 6001 6 5 1 6001 NET For VMS Network Communications Software User s Manual 6001 802 6001 NET For RSX 11 Network Communication Software User s Manual Terminology In this manual you will read about the various commands the 1775 KA module can send and or receive To distinguish between commands we use some of the following terms protected command can read or write only specified areas of PC data table A switch on the PLC PLC 2 Family and PLC 4 Controllers determines if the PC will accept only protected commands from another PC or an RS 232 C device When you use a protected command you may have a limited area that you can read or write in the other station s memory an unprotected command can read or write into any area of PC data table A switch on the PC that receives the commands determines if the PLC PLC 2 Family and PLC 4 controller will accept unprotected commands from anoth
67. D and FNC command and function 12 7 ETX STS extended status 12 9 STS status 12 8 Applications of 1775 KA modules 1 8 Assignment command 6 2 6 3 6 4 Backup 2 24 2 27 2 28 2 29 Basic command set 8 C Comments 6 11 Computer to PC communication 9 1 Control file word 3 4 Counters Data Highway port counters C 1 modem port counters C 2 CREATE Command 6 5 D Data transfers 3 6 DELETE Command 6 5 Index E Editing 5 1 editing message procedures 5 2 5 3 editing the message instruction 5 1 5 2 Error codes B 1 local error codes B 1 B 4 remote error codes B 3 reply error codes B 4 Error Reporting 7 1 access to error block 7 5 error block operation 7 2 error monitoring 7 2 recovery from errors 7 1 reporting error codes 7 1 Execute Command 6 6 EXIT command 6 6 Expressions 4 13 4 14 F Flowchart D 1 Full Duplex protocol 10 1 block check 10 5 definition of link and protocol 10 1 full duplex protocol diagrams 10 17 functions 6 9 message characteristics 10 8 receiver actions 10 13 transmission codes 10 2 transmitter actions 10 9 two way simultaneous operation 10 6 Full duplex protocol link layer message packets 10 4 G GOTO Command 6 7 H Half Duplex Protocol 11 1 Half Duplex protocol half duplex protocol diagrams 11 13 line monitoring 11 20 protocol environment definition 11 7 Index Hal
68. DLE EOT Network Layer The Network and Application Layer Protocol The network protocol defines a network packet format for interaction between application programs The link protocol merely serves to carry data blocks between two applications regardless of which data link protocol half or full duplex you use The application programs may be located at opposite ends of a point to point full duplex link or at different points on a multidrop half duplex link The network protocol can even handle the transfer of messages between application programs in the same device The network layer ignores the internal functioning of data link protocols It requires that the data link driver accepts a message for delivery tries to send it and indicates whether it was delivered Program And Message Types The network protocol was designed on the assumption that application programs are of two types command initiators and command executors Corresponding to this division there are two message types Command messages initiated by command initiators and carried over the network to a command executor Reply messages the replies that command executors send to command initiators For each command message there is normally one and only one reply A rare exception occurs when the data link delivers a message but receives no acknowledgement to verify delivery At the command initiator the network layer sends a reply command executor recei
69. ER DST SRC CMD STS and TNS from last message e BUFFER Whether an Empty Buffer is Read e Receiver error flag P Reset Receiver Error Flag i GET CODE Get Next Input No Control Code SEND CTL Transmit LAST XMSG Transfer Message to Network Layer Ignore Flag 0 No Save Response ACK or NACK in LAST NOTE XMSG Returns ACK NACK or 0 for Ignored Message 10073 1 0 3 Appendix D Detailed Flowcharts Figure D 4 WTAK Subroutine own STARTTIME Start the ACK Timeout SLEEP Receive No a Response Go to Sleep at WTRESP Yes Indivisible Zone Y STOPTIME Common Cancel the Timer e WTRESP A Sleep Location e RESP A Variable Used to Pass the Response Code From the Receiver to the Transmitter Get the Response Code if Any From RESP RETURN 10074 1 0 4 Appendix D Detailed Flowcharts Figure D 5 SENDM Subroutine SENDM Reset BCC Accumula tor SENDCTL Send DLE STX BCC Link Data Done Include SENDDATA Include ETX in BCC Send Link Data Byte SENDETX Send DLE ETX BCC C RETURN 10075 1 0 5 Appendix D Deta
70. KA Communication Interface Module 3 1775 KA Communication Adapter Module 2 1771 Communication Adapter Module 1774 Communication Adapter Module Computer or other 1771 KC KD KE KF Communication Controller programmable Module RS 232 C compatible device Communication Terminology Stations communicate with each other by sending messages over the Data Highway There are two types of messages Command messages Reply messages 3 1 Chapter 3 Data Highway Communication 3 2 A command message either gives writes data to or requests reads data from one station to another A reply message is a station s response to a command message Command messages are generated by message procedures that you program into the 1775 module Execution of a message procedure is controlled by the message MSG instruction in the PLC 3 ladder diagram program When a 1775 module receives a command message from another station the module automatically generates the appropriate reply message As points of reference we can talk about local and remote stations The local station is the one currently initiating some action or the one we are currently doing something with All other stations are then remote We can also describe stations in terms of their relationship to a message The transmitting station is the one sending the message and the receiving station is the one that ge
71. KA module experiences an internal stack overflow 4 The 1775 KA module experiences severe Data Highway communication problems CLOSED _ the primary PLC 3 will not switch to backup when a fault occurs with the 1775 KA module 2 OPEN the 1775 KA module will disable is Data Highway port whenever the primary PLC 3 controller becomes deactive The module will no longer be able to transmit or receivemessages through its Data Highway port Also setting switch 2 to open enables the backup operation feature 2 CLOSED _ the Data Highway port on the module will remain active if the primary PLC 3 becomes deactive 3 OPEN the module may be connected up to 7 000 cable feet away from a 1771 KF a 1771 KG 1773 KA or another 1775 KA module In addition to setting switch 3 to the open position you must also set switch 2 to closed position This makes pin 25 on the RS 232 C port of the 1775 KA module active refer to figures 2 8 to 2 10 Note that switch 3 must always be closed for communication with an RS 232 C device other than a 1771 KF 1771 KG 1773 KA or 1775 KA module 3 CLOSED the MODEM INTERFACE port of the 1775 KA module may be connected to a standard RS 232 C device that is located within 50 cable feet of the module ET OPEN Switch 4 is reserved for future use and should always be left open Module Placement After setting the thumbwheel switch insert the module into any one of the module slots in the PLC 3 processor chassi
72. OTAL OF 00 OFFSET TRANS W F WORD DATA Max of 226 bytes 01 OFFSET 113 words C Logical address DLE STX DST SRC CMD STS TNS FNC PACKET TOTAL 0 00 OFFSET TRANS N Inni DATA Max length is 239 bytes minus address se length of the PLC 3 logical address DLE ETX BCC 2 51 bytes must be an even number of bytes ASCII symbol 8 characters max ASCII symbol 8 characters max A 16 Message Formats Reply Format This is the same as the reply packet format for all writes A Format when successful execution 4F B Format when reporting an error 4F STS Where the extended status byte is optional File Read Use this read command with either a file symbol or a block address for a starting address This starting address points to a file of words This read command reads a block of data You must read the entire file The file size must equal the exact size of the file or an error will be returned The function code is 4 Command Format A File symbol address DLE STX DST SRC CMD STS TNs FNC PACKET TOTAL OF 04 OFFSET TRANS ASCII symbol SIZE DLE ETX BCC 8 characters max B Logical address DLE STX DST SRC 575 TNS FNC PACKET TOTAL OF 04 OFFSET TRANS PLC 3 logical address SIZE DLE ETX BCC 2 51 bytes 17 Appendix A Message Formats Reply Format This is the
73. PLC 3 chassis set their thumbwheel switches to consecutive numbers starting with the number 1 You may write the selected number in the space provided beside the thumbwheel switch Chapter 2 Installation CAUTION To guard against unpredictable operation of the PLC 3 processor do not change the setting on any thumbwheel switch while the 1775 KA module is powered up Option Switches Figure 2 2 shows a set of four option switches on the bottom edge of the 1775 KA module Switches 1 and 2 are used when the PLC 3 controller is programmed to operate in a backup configuration Switch number 1 determines whether or not a fault in the 1775 K A module will cause the primary PLC 3 controller to switch over to the backup PLC 3 Switch number 2 determines whether or not the 1775 module will disable its Data Highway port when the PLC 3 becomes deactive Switch 3 is for RS 232 C communication Switch 4 is reserved for future use and should always be left open up or off Use Table 2 A below to determine the appropriate switch setting Figure 2 2 Option Switches 2 3 Chapter 2 Installation Table 2 A 1775 KA Switch Settings ee OPEN the PLC will switch over to backup whenever one of the following fault conditions occurs 1 The 1775 KA module tries to hold control of the PLC 3 backplane for more than 138 microseconds 2 The 1775 KA module experiences a execution timeout of more than 32 milliseconds 3 The 1775
74. R field to specify the address of the byte to be modified in the PC data table memory Put the low byte least significant bits of the PC address value into the first byte of the ADDR field Use the SET mask to specify which bits to set to 1 in the addressed PC byte Al in a bit position of the SET mask means to set the corresponding bit in the addressed PC byte to 1 a 0 in a bit position of the SET mask means to leave the corresponding bit in the PC byte unchanged Use the RESET mask to specify which bits to reset to 0 in the addressed PC byte A 1 in a bit position of the RESET mask means to reset the corresponding bit in the addressed PC byte to 0 a 0 in a bit position of the RESET mask means to leave the corresponding bit in the PC byte unchanged Note that the interface module at the receiving PC station executes this command by first making a copy of the addressed PC byte It then sets or resets the appropriate bits and writes the byte back into PC memory At the same time the PC processor can be changing the states of the original bits in memory Because of this some data bits may unintentionally be overwritten Command Format Message Formats DLE STX snc cup srs ADDR SET RESET OLE ETX aco 05 Up to 61 masks guts Tom Reply Format 45 11 Appendix A Message Formats Unprotected Read Use this command to read words of data from any area of PC data table memo
75. Remote station number Remote data highway station delimiter 10024 1 Addressing a Word To address a single word in PLC or PLC 2 memory use this format offset Addressing a Bit To address an individual bit in PLC or PLC 2 memory use this format lt offset gt lt bit gt Figure 4 8 illustrates this addressing format 4 11 4 Addressing Rules and Examples Figure 4 8 Example of Addressing Specific Bits in PLC PLC 2 Memory VE 010 Bit number 10 octal Delimiter Word offset from beginning of memory octal Address delimiter Remote station number Remote data highway station delimiter 10025 1 Remote Station Address To specify the address of data at a remote station use the format shown in Specifications Figure 4 9 This format applies to both PLC 3 and non PLC 3 remote stations The characters delimit a remote Date Highway station and the characters M delimit a remote modem station Figure 4 9 Example of Addressing a Word in a Remote PLC 3 Station 020 B 15 9 Word address at remote station Address delimiter Remote station number 20 octal Port identification for data highway port Remote station delimiter 020 WORD 9 v ev Lo Symbolic word address defined at remote station Remote station number 20 octal Port identifier for data highway port Remote station delimiter 10026 1 Remote station addresses are subject to the f
76. TRING In this case the name is PROC 1 ENTER SYSTEM Enter the address where the message MH1 ENT ADDRESS OR procedure is stored In this case the SYMBOL symbolic address MH1 can be used ENTER SYMBOL TYPE Enter the symbol type for the message procedure name This is always 2 for the 1775 KA module Table 5 C Example of Editing a Message Procedure Through a Data Terminal Enter the edit mode and create the EDIT 1 RET message procedure name Note that the 1775 S4B module automatically creates the symbol definition for the message procedure name Enter the insert mode of editing RET Enter the message procedure command other commands Note that you must use either EXIT or H022 B0 5 CC 1 RET STOP command to end each procedure B0 6 CC 1 2 RET EXIT RET EN Exit from the insert mode of editing RET Exit from the editing mode of the E RET 1775 S4B module __ 5 3 Chapter 5 Editing 54 Note that it is not always necessary to create a message procedure If you want to execute just a single assignment command that is no more than 76 characters long then you can enter that command as part of the ladder diagram message instruction Table 5 A If you want to execute more than one 1775 KA command or if a single assignment command is more than 76 characters long then you must create a message procedure to contain those commands Also note that every message procedure mu
77. The Basis commands can be sent to any Allen Bradley PC These commands are sometimes called PLC PLC 2 commands but all Allen Bradley PC s can receive them The PLC PLC 2 family and PLC 3 processors can also send these commands as well as receive them 3 Allen Bradley recommends using these commands for uploading or downloading only To write or read specific words or bits use the basic commands or the PLC 3 commands STS status The high nibble of the STS status byte is supplied by the application layer In command messages the STS byte is set to zero In reply messages the STS is used for reporting either application or network error codes A value of zero should be interpreted as no error that is the message was delivered and executed successfully Non zero status can be divided into two categories remote errors and local errors 12 8 Chapter 12 Network and Application Layer Protocols Remote errors mean that a command was successfully delivered by the network but the remote station was unable to execute the command The remote station then placed an error code in the high nibble of the STS byte Local errors mean that your network layer was unable to deliver the message to the remote station Your network layer then turns the command around stuffs the low nibble of the STS byte with the appropriate error code and returns it to your application All error codes are listed in appendix B When you receiv
78. This option determines whether or not the 1775 K A module will be able to send embedded responses through its RS 232 C port Responses are acknowledgments ACKs or NAKs to messages received from other stations An embedded response is one whose characters are transmitted between the bytes of a regular message In this way the response to a previously received message is transmitted along with a new message At power up the PLC 3 disables the embedded responses option by default The 1775 module can combine with the PLC 3 processor to form a backup system System backup is described in greater detail in the PLC 3 Programmable Controller Backup Concepts Manual pub no 1775 6 3 1 The following discussion is an overview of system backup and the role of the 1775 in various backup procedures There are two possible backup configurations for the 1775 module Two 1775 modules in the same PLC 3 controller One 1775 module in a primary PLC 3 controller and another 1775 in a backup PLC 3 controller The first configuration provides backup for the 1775 K A module itself Here both 1775 K A modules are always active and both are independent stations on their communication network Therefore each 1775 2 27 Chapter 2 Installation module must have its own unique station number If you want to send the same message through both 1775 KA modules you must program the two separate message instruc
79. a reply message which it returns to the command indicator in your application layer All error codes are listed in appendix B TNS The two TNS transaction bytes contain a unique 16 bit transaction identifier field A complete transaction consists of a command message and its corresponding reply message The TNS value in the reply must be the same as the TNS value in its associated command This enables the command initiator to associate an incoming reply message with one of the command messages it transmitted previously For command messages transmitted by a PC station the 1775 KA module assigns the TNS values For each command message transmitted by your computer station your application programs must assign a unique 16 bit transaction number simple way to generate the transaction number is to maintain 16 bit counter in your application program Increment the counter every time your command initiator application program creates a new message and store the counter value in the two TNS bytes of the new message When your computer program receives a reply to one of its command messages it can use the TNS value to tie the reply message to its corresponding command If the TNS value of a reply message matches the TNS value of a command message then that reply is the appropriate one for that command Whenever your computer network layer receives a command from another station it should copy the TNS bytes of the command message
80. a 0 in a bit position of the reset mask means to leave the corresponding bit in the PC byte unchanged Note that the interface module at the receiving PC station executes this command by first making a copy of the addressed PC byte It then sets or resets the appropriate bits and writes the byte back into PC memory At the same time the PC processor can be changing the states of the original bits in memory Because of this some data bits may unintentionally be overwritten Command Format N DLE STX SRC CMD STS TNS ADDR SET RESET DLE ETX BCC 02 Up to 61 masks otis tom Reply Format DLE STX SRC STS n DLE ETX BCC 42 Protected Write Use this command to write words of data into limited areas of the PC data table memory Your access can be limited by memory access rungs in the communication zone of the PC s ladder diagram program A 9 Appendix Message Formats A 10 Command Format i DLE STX SRC CMD STS TNS ADDR DATA Max of 243 bytes DLE ETX BCC 00 Reply Format Geta age sea oa 40 Unprotected Bit Write Use this command to set or reset individual bits in any area of PC data table memory The data field in this packet consists of 4 byte blocks each of which contains a 16 bit address field a set mask and a reset mask Use the ADD
81. a remote station and when that bit goes true turn on a bit locally for either 300 seconds or until the remote bit goes false lt gt gt gt gt gt ON ERROR 8LOG ERROR 0 log errors time of day CREATE TIM START B0 0 initialize error pointer CREATE TIM CTL S TCTL 1 timer start word CREATE TIM PRE 1 timer control word T ON BIT 0 timer preset word T DONE BIT 017 timer on bit CREATE PROCESS N3 7 timer done bit P ON BIT 5 process word ON 1 process on bit OPE C I0 LOOP 1 check remote bit in loop B0 0 1 SHO23 B5 3 2 fetch and save remote bit IF B0 0 1 EQ OF GOTO LOOP1 QTIM PRE 300 set timer for 300 sec QTIM START T ON ON iburn ermer GPROCESS P ON ON turn process on n LOOP 2 check timer and remote bit in loop B0 0 1 SHO23 B 3 2 fetch and save remote bit IF B0 0 1 EQ ON AND 8TIM CTL T DONE BIT EQ OFF GOTO LOOP2 GPROCESS P ON OFF EXIT PROCEDURE 8LOG ERROR This procedure will fetch the error block out of the Module Status Area and record it along with the time of day in status file 5 CREATE STATUS 55 CREATE ERR_BLK 2 5 1 4 0 CREATE 51 3 STATUS ERR_BLK 6 copy error block 6 words ST
82. accept unprotected write commands PLC 3 station can then write to any area of the PLC PLC 2 s data table by transmitting an unprotected write command section titled Command Message Type chapter 6 Accessing a PLC 3 from a PLC PLC 2 Processor While a PLC 3 processor can address any area of a PLC PLC 2 data table a PLC PLC 2 reads an input file that is a part of the PLC 3 data table That file is the PLC 3 input file with a number that corresponds to the station number of the PLC PLC 2 station For example the read write files assigned to PLC PLC 2 stations 1 to 100 octal would be as follows PLC PLC 2 Station Assigned PLC 3 Input File Number octal for Read Write Access 000 1008117 001 1001 002 1002 003 1003 004 1004 005 1005 006 1006 007 1007 010 1010 011 1011 012 1012 077 1077 100 1100 1 Station address 000 is assigned to input file 1008 Otherwise PLC 3 input files with an 8 or 9 in their address are not used for read write access by a PLC PLC 2 station except 1008 for station 0 3 9 Chapter 3 Data Highway Communication 3 10 PLC PLC 2 station numbers are octal while PLC 3 input files have decimal addresses This means that PLC 3 input files with an 8 or 9 in their address are not used for read write access by a PLC PLC 2 station The PLC PLC 2 station can use either protected or unprotected commands to access its assigned PLC 3 fi
83. ain the starting address of the diagnostic counters Command Format 06 01 Reply Format N Diagnostic Status You use this command to read a block of status information from the station interface module The reply to this command contains the status information in its DATA field Command Format 06 03 Reply Format CMD STS DATA Max of 244 bytes 46 N The status information varies with the type of station interface module Table A B describes this status DATA for 1775 KA modules A 26 Message Formats Table A B Contents of Status DATA for 1775 KA Modules Operating status of PLC 3 processor Bits 0 to 1 0 Program mode 1 Test mode 2 Run mode Bit 2 Not used Bit 3 0 Normal 1 Major processor fault Bit 4 0 Normal 1 Shutdown requested Bit 5 0 Normal 1 Shutdown in effect Bits 6 to 7 Not used Type of station interface Bits 0 to 3 6 1775 KA Data Highway port 7 1775 KA RS 232 C port Bits 4 to 7 4 PLC 3 processor Current context stored in bits 4 to 7 Thumbwheel number Mode control word The logical address of the mode control word is E0 0 0 8 A 27 Appendix A Message Formats A 28 Starting byte address of the diagnostic counters and timers There is a separate block of diagnostic timers and counters for the data highway port and the RS 232 C port The address given here is the one for the port that received the diagno
84. al publications 1771 6 5 1 and 1774 6 5 8 Accessing a PLC PLC 2 Station Access to a PLC PLC 2 station also depends on the type of command transmitted to that station There are two types of commands protected write commands unprotected read and write commands Protected write commands can only write to specified sections of the data table in a PLC PLC 2 processor Memory access rungs in the PLC PLC 2 ladder diagram program specify where in the data table the PLC 3 write data Unprotected commands on the other hand can read or write to any section of the data table at a PLC PLC 2 station Again refer to publication 1771 801 or 1774 819 for an explanation of protected and unprotected commands and memory access rungs Chapter 3 Data Highway Communication A PLC 3 station can read from any part of a PLC PLC 2 data table However A PLC 3 station cannot write to a PLC PLC 2 if the switch settings at the PLC PLC 2 station forbid access If the switches at the PLC PLC 2 station are set to accept only protected write commands then the ladder diagram program at the PLC PLC 2 station must contain memory access rungs to define which areas of the PLC PLC 2 station s data table are accessible In such a case a transmitting PLC 3 station can write to only those data table areas defined by the memory access rungs and only by means of protected write commands If the switches at the PLC PLC 2 station are set to
85. alue from 00 to FF hex The term code means in the following paragraphs an indivisible sequence of one or more bytes having a specific meaning to the protocol Indivisible means that the component bytes of a code must be sent one after another with no other bytes inserted between them It does not refer to the timing of the bytes This definition has less significance than for full duplex protocol since there is no multiplexing of transmission codes in half duplex protocol Half duplex protocol uses the following control codes DLE SOH DLE STX DLE ETX BCC CRC DLE DLE NAK DLE ENQ DLE EOT Half duplex protocol also uses the following link layer data codes Data single bytes having values 00 0F and 11 FF hex DLE DLE to represent the value 10 hex Link layer address code STN station identifier We can group these codes into two classes according to their use 1 message codes issued from a station sending a message or poll 2 response codes issued from a station receiving a message or poll These codes are issued by a station transmitting a message or poll DLE indicates the start of a message packet STN helps to designate the station number When the 1775 is communicating with another station as a peer the STN DST If the 11 3 Chapter 11 Half Duplex Protocol 1775 15 just one of several stations on a Data Highway the STN together with the
86. am containing message instructions to control execution of the 1775 KA message procedure 2 Allocate memory to the necessary PLC 3 data files 3 Create and edit the 1775 message procedure You can perform the first two steps through an Industrial Terminal cat no 1770 4 connected to the Scanner Programmer Interface Module cat 1775 54 The third step can be performed either through an Industrial Terminal or through a data terminal connected to the Scanner Message Handling Module cat no 1775 S4B These steps are described below Table 5 A gives an example of how to edit the message instruction in the PLC 3 ladder diagram program For more details on this type of editing refer to the PLC 3 Programming Manual publication 1775 801 5 1 Chapter 5 Editing Table 5 A Example of Message instruction Editing System Prompt Action Key Strokes Start edits SED ENT Insert rung IR ENT Enter the energize bit for the message B0 0 0 ENT rung In this case binary file 0 word 0 bit 0 ed Enter the message instruction MSG ENT ENTER FILE ADDRESS Enter the address of the file where the FB1 ENT message instruction will reside in memory In this case binary file 1 ENTER SYSTEM Enter the channel designation for the E2 5 1 ENT ADDRESS OR 1775 KA module In this case 2 is the SYMBOL module status 5 is the 1775 KA module type and 1 is the thumbwheel number of the module
87. aster should poll only the active slaves on a regular basis The master should poll the inactive slaves occasionally to see whether they will respond It is best not to allow the master station s transceiver to relay messages directly from one slave station to another Instead the transceiver should funnel all received messages to the message sink network layer The network layer can then analyze the messages and retransmit any that are addressed to a slave station Figure 11 3 is a flowchart which gives a simplified view of an example of software logic for implementing half duplex protocol from the master station s point of view 11 9 Chapter 11 Half Duplex Protocol Figure 11 3 Implementation of Half Duplex Protocol XCVR Y Select Station ima Y Poll Selected Station Y Start Timeout Receive Receive DLE EOT Message Set Active Station Flag Active Station Networ Layer has Yes Y Get Message from Network Layer E a Y Send Message Y Start Timeout No Timeouts for this Message OK Yes Duplicate Message No Give Message to Network L yer Y Send DLE ACK Poll Yes Received DLE ACK Y Remove Station from Active List 3 Timeouts for this Message Yes
88. at follow you type a letter key repeatedly until the selection you want appears on screen 3 A to select the baud rate you are currently using on the line Type B to select no parity Type C to select 1 stop bit Type E to select cursor on NIA Un Type F to select full duplex Message Formats Table A A ASCII Codes and Their Numerical Values ASO We Bay Dip 00 0000000 NUL Ny 2A 0101010 none 01 0000001 SOH Su 2B 0101011 02 0000010 STX Sx 2 0101100 03 0000011 Ex 2D 0101101 3 04 0000100 EOT Er 2E 0101110 05 0000101 ENQ Eo 2F 0101111 06 0000110 30 0110000 0 07 0000111 BEL B 81 0110001 1 08 0001000 BS Bs 32 0110010 2 09 0001001 HT Hr 33 0110011 8 0A 0001010 LF le 34 0110100 4 0B 0001011 VT Vr 85 0110101 5 0C 0001000 FF Fr 36 0110110 6 0D 0001101 CR Cn 37 0110111 7 0E 0001110 SO So 38 0111000 8 OF 0001111 SI 39 0111001 9 10 0010000 DLE 0 0111010 11 0010001 DC1 D4 3B 0111011 12 0010010 DC2 3C 0111100 lt 13 0010011 DC3 D 3D 0111101 14 0010100 DC4 D4 3E 0111110 gt 15 0010101 0111111 16 0010110 SYN Sy 40 100000 Q 17 0010111 ETB Eg 41 100001 18 0011000 42 1000010 19 0011001 43 1000011 C 1A 0011010 SUB Sp 44 1000100 D 1B 0011011 ESC Ec 45 1000101 E 1C 0011
89. ata link layer at station A and the data link layer at station B When you write a software driver for your computer you may implement either a data link layer that uses a half duplex protocol or a data link layer that uses a full duplex protocol You select the half duplex or full duplex protocol with the LIST function section titled Modem Port chapter 2 In general the full duplex protocol provides higher data throughput but you can use it only for communication between two peer stations Half duplex protocol is for one master and one or more slaves Half duplex protocol provides lower data throughput but is easier to implement than the full duplex protocol You should use half duplex protocol if You are using multidrop baseband MODEMS to connect multiple slave stations to a single master computer You must use MODEMS for this type of link unless there is only one slave You are using MODEMS that have only half duplex capability You are willing to sacrifice data throughput in exchange for ease of implementation Half duplex protocol does not allow embedded responses The 1775 K A module has slave mode capability only you must provide the master function from your computer 9 5 Full Duplex Protocol General If you are connecting the 1775 KA module to another Allen Bradley communication interface module such as a 1771 KG 1775 K A 1773 or 1771 KE KF module then you need not be concerned with the protocol d
90. ate message detection process In this process the receiver compares the SRC CMD and both TNS bytes of the current message with the corresponding bytes of the previous message received If these bytes are the same the receiver discards the current message and sends a DLE ACK If the current message differs from the previous one the receiver next tests the state of the message sink If the message sink is full the receiver sends a DLE NAK Otherwise the receiver forwards the current link level data to the message sink keeps a copy of the first six bytes of the current link level data for purposes of duplicate message detection sends a DLE Figure 10 8 is a flowchart which gives a simplified view of an example of software logic for implementing the receiver Table 10 B gives a detailed description of an example of software logic for implementing the receiver in structured English procedures In appendix D are flowcharts which give a detailed view of an example of software logic for implementing the transmitter Chapter 10 Full Duplex Protocol Figure 10 8 Receiver for Full Duplex Protocol RCVE CHAR LAST CHAR Receive DLE ETX BCC Yes Receive Message LAST LAST Send DLE LAST 10045 1 10 15 Chapter 10 Full Duplex Protocol Table 10 B Receiver for Ful
91. ble number of timeout errors error 37 2 Timer 1 is a one second timebase timer Bit B0 0 0 controls the ladder diagram rung that activates the timer Figure 8 4 refers to this bit as TIM START T ON BIT 3 S4 3 4 activates a message instruction that executes a report generation procedure In this way the 1775 K A module can indirectly cause execution of a report generation procedure to display a message on the operator s terminal 8 5 Introduction to Layered Communication Computer to PC Communication This chapter and the chapters that follow 10 11 and 12 described how to write a software driver that enables your computer to communicate through the RS 232 C port of the PLC 3 Communication Adapter Module Therefore you do not need to read these chapters if you are only using PC s The interface modules contain software drivers for PC to PC communication In this chapter and the chapters that follow 10 11 and 12 we describe a layered approach to writing a software driver for your computer According to the standard for network architecture developed by the International Standards Organization ISO communication networks should be divided into layers Each layer performs specific functions By separating the communication network into independent layers it is easier to make changes to one of the network s functions without having to redesign the entire network Ideally the layers of a network should be as indep
92. cedure is line number 1 and any following lines are numbered in ascending sequence Nested procedures begin with line 1 again thus the need for words 3 4 and 5 in the error block You do not enter the line numbers for a procedure the 1775 K A module automatically keeps track of the line numbers for you The line numbers do not appear in a listing of the message procedure but they are recorded internally by the module Error Block Operation Figure 7 1 illustrates how the error block works In this figure an addressing error invalid destination address occurs in procedure SUB2 which is nested 3 levels deep Word 5 of the error block gives the line number where the error occurred in procedure SUB2 Word 4 gives the number of the line in procedure SUBI that executed procedure SUB2 7 2 Chapter 7 Error Reporting And word 3 gives the number of the line in procedure MAIN that executed procedure SUB1 Figure 7 1 Examples of Error Block Operation Error Block Line Number Procedure Word Contents decimal MAIN e e e 124 150 SUB 1 1 1 SUB 1 2 1 28 SUB 2 150 7 3 e e 4 28 SUB 2 5 5 e 5 6 12 COUNT e e e 10030 1 7 3 Chapter 7 Error Reporting 7 4 10 Note that an ON_ERROR or an IF command may contain an embedded command to execute another procedure In these cases the embedded execute comma
93. coded decimal format in word 12 of the decimal section of PLC 3 memory After this function is executed word 12 will contain the following bit pattern 0000 0000 0010 0111 Chapter 6 Message Procedure Commands FROM_BCD Function The FROM_BCD function converts its parameter from binary coded decimal format to binary format The resulting value is 32 bits long For example the FROM BCD function in Figure 6 2 converts the contents of decimal word 12 from binary coded decimal to a regular decimal value of 27 From the above example section titled TO BCD Function the FROM BCD function stores the following bit pattern in user symbol COUNT 0000 0000 0000 0000 0000 0000 0001 1011 As you can see from these examples TO BCD and FROM BCD perform opposite functions Comments You can add your own explanatory comments to any command line in a message procedure To do this enter a semicolon after the command Then enter your comment after the semicolon Figure 6 3 illustrates the format for comments Figure 6 3 Format for Comments COUNT 0 gt NITIALIZE COUNTER 4 Comment Comment Delimiter Command 10029 1 Anything that appears between a semicolon and the end of the command line is considered to be a comment Comments may be any length The end of the command line and therefore the end of your comment is delimited by the carriage return and line feed pair of characters A comment can be the only t
94. col Whenever the receiver has received a link packet successfully it attempts to give the network packet portion link level data to the message sink If the message sink is full it must notify the receiver Figure 10 6 represents the protocol environment Figure 10 6 Protocol Environment Network Network Path 1 Packet Status Path 2 Full lt Software Softwar Hardware 10043 1 Full duplex protocol places the following restrictions on the network packet that is submitted to the link layer for transfer The size of a valid network packet is 6 bytes minimum and 250 bytes maximum The first byte of a network packet must be the station number of the receiver station The receiver ignores messages that do not contain the correct station number As part of the duplicate message detection algorithm the receiver checks the second third fifth and sixth bytes of each network packet Recall that a network packet consists of the source command and transaction fields At least one of these bytes of the current network packet must differ from the corresponding byte of the previous network packet in order for the receiver to accept the current network packet Otherwise the receiver assumes that the current packet is a retransmission of the previous packet so it discards the current packet Transmitter Actions Whenever the message source can s
95. d privilege the computer may begin issuing privileged writes You should however issue a shutdown command first If a different station already has the download privilege the second station is denied the privilege The function code is 5 Command Format OF 05 Message Formats Reply Format A Format when the command was successfully executed Eo edi ae ed 4F B Format when reporting an error DLE STX DST SRC CMD STS TNS ETX DLE ETX BCC 4F STS Where the extended status byte is optional Upload Request From a computer you use this command to inform the 1775 module that it wants to do an upload If the module grants the upload privilege you may begin issuing privileged reads You should however issue a shutdown request first If a different station already has the upload privilege the second station is denied the privilege The function code is 6 Command Format OF 06 Reply Format A Format when the command was successfully executed 4 23 Appendix A Message Formats B Format when reporting an error DLE STX DST SRC CMD STS TNS ETX DLE ETX BCC 4F STS Where the extended status byte is optional Restart Request From a computer you use this command to terminate an upload or a download You cannot issue this command until after you have successfully completed an upload or download operation with the destination s
96. d from NEXT the head SIZE STATUS L 0 MESSAGE SIZE STATUS Figure D 23 UNLINK Subroutine UNLINK MESSAGES Network Data Block Network Data Block Network Data Block Input Address of Queue E An Implementation Dependent Routine that Removes a Message from a Queue RETURN 1 Output e Message Control Block 10092 1 10093 1 D 19 Appendix D Detailed Flowcharts Figure D 24 LINK Subroutine LINK Input e Address of Queue Message Block An Implementation Dependent Routine that Places a Message onto a Queue RETURN 10094 1 D 20 GETBUF Check Availability of Receive Buffer Appendix D Detailed Flowcharts Figure D 25 XMSG Subroutine Output Flag e ACK if Message is OK e if Message is in Error W Clear BCC e 0 if Message is to be Ignored Biol Accumulator Available GETCODE Did T Buffer Overflow Link Data No Message Too Small Code No Station No m 7 Buffer Ignore Flag 0 Available 2 Return Compare Message with HEADER NAK Duplicate Save Byte Men age in Buffer mm Save New Header Get Next Code SENDNET Send Link Data to Network Layer Ye
97. dressing format Physical addressing format The PLC PLC 2 addressing format applies to PLC PLC 2 type commands transmitted to the 1775 K A module Use this addressing format whenever you have established a PLC 3 input file to imitate PLC PLC 2 memory section titled PLC PLC 2 Stations chapter 3 The ADDR address field is a 2 byte address field sent low byte first PC programs use logical addressing to specify octal bytes To generate a protected unprotected read write command use that same octal addressing to format the ADDR field as shown in Figure 12 4 For a block read write command always set the least significant bit to 0 to select the low byte of the word To allow PC read write commands to the computer set up a file in the computer to be addressed in this same way as if it were a PC data table Chapter 12 Network and Application Layer Protocols Figure 12 4 PLC PLC 2 Data Table Byte Addressing Least Significant Byte Most Significant EVO Transmitted First Transmitted Las a di N 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 3rd 4th Octal 5th Octal Low 1st Octal 2nd Octal 3rd Octal Digit Digit Hong Digit Digit Octal Digit Byte Digit a Protected Unprotected Read Write ADDR Field Least Significant Byte Most Significant Bye Transmitted First Transmitted Las 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
98. e a reply message from a PC station check the STS byte at the application layer If the STS byte is non zero refer to appendix B for the type of error that has occurred If your application layer receives a command message and detects an error it should format a reply message with a remote error code in the high nibble of the STS byte ETX STS extended status If the PLC 3 receives PLC PLC 2 commands error codes for those commands are returned in the STS byte only The PLC 3 can also create a second layer of error codes however relative to PLC 3 type commands CMD byte 15 If the command is a PLC 3 level command addressed to a remote PLC 3 then the remote error returned from the 1775 will have an additional status byte stuffed into the data area called an ETX STS If the STS byte is zero then the ETX STS will also be zero indicating no error If the STS bytes contain the value FO hex this is a flag to indicate that the ETX STS contains the non zero code To decode the contents of the STS byte and the ETX STS byte relating to the application programs of specific processors refer to Appendix B error codes 80 88 for remote errors and error codes 90 97 for local errors 12 9 Chapter 12 Network and Application Layer Protocols 12 10 ADDR address The address field in command messages can be in one of the following formats PLC PLC 2 addressing format Symbolic addressing format Logical ad
99. e in two phases Installing hardware Programming configuration parameters through the PLC 3 LIST function Please read the entire manual carefully before attempting to install the module For best results when installing the 1775 K A module proceed in the order indicated below Switch Settings The 1775 module has a number of hardware switches that must be set before the module can be installed in the PLC 3 processor There is a thumbwheel switch on the front edge of the module and a group of option switches on the bottom edge Thumbwheel Switch Figure 2 1 shows a thumbwheel switch on the front edge of the 1775 module This thumbwheel switch designates the number used by the PLC 3 processor to distinguish one 1775 K A module from another Rotate the thumbwheel to select the desired identification number 2 1 2 2 Chapter 2 Installation Figure 2 1 Front View of 1775 KA Module PASS 0 v can 9 TEST Self Test Indicators NO Thumbwheel Switch XMTG O iio RS 232 C port Indicators ps O MODEM INTERFACE COMMUNICATION ADAPTER Data Highway Port Indicators RS 232 C Port MODEM INTERFACE Data Highway Port 10003 1 If there is only one 1775 KA module in the PLC 3 chassis set its thumbwheel switch to the number 1 If there are multiple 1775 KA modules in the same
100. e modem via the 2 17 Chapter 2 Installation 2 18 DTR DSR and DCD signals It incorporates timeouts and tests to properly operate these types of modems Auto answer these modems have self contained timeouts and tests and can answer and hangup the phone automatically The modem port has no means to control an auto dial modem although it is possible that it can be used in conjunction with a separate auto dialer Answering The module continually asserts DTR when it is waiting for a call Under this condition the modem will answer a call and assert DSR as soon as ringing is detected The module does not monitor the RING indicator in the RS 232 interface Once DSR is detected the module starts a timer around 10 seconds and waits for the DCD signal When DCD is detected communication can start If DCD is not detected within the timeout the module turns DTR off This causes the modem to hangup and break the connection When the hangup is complete the modem drops the DSR line This causes the module to reassert the DTR line and wait for another call This feature protects access to the phone if someone calling a wrong number reaches this station Once DCD is detected the module continues to monitor the DCD line If DCD goes false the timeout is restarted If DCD is not restored within the timeout the hangup sequence is initiated This feature allows the remote station to re dial in the event the connection is lost b
101. e no selection the PLC 3 assumes the illegal address 377 by default Baud Rate This option specifies the communication rate over the Data Highway A communication rate of 57 600 baud is recommended Modem Port Selecting option 3 MODEM PORT from the above menu section titled Programmable Configuration Parameters causes LIST to present the following menu KA NN modem port ENABLE DISABLE PORT 2 STATION NUMBER 3 BAUD RATE 4 COMMUNICATION MODE 2 25 Chapter 2 Installation 2 26 5 EVEN PARITY 6 SEND EMBEDDED RESPONSES ENTER NEXT This menu allows you to select options that apply to only the modem port of the 1775 K A module These options are described below Enable Disable Port This option determines whether or not the 1775 K A module can communicate through its RS 232 C port You must select the ENABLE option in order to allow this communication to take place If you make no selection the PLC 3 disables the RS 232 C port by default Note however that you cannot use LIST to change any other parameters of the RS 232 C port unless you first disable the port After you are done entering parameters through LIST don t forget to enable the 5 232 port again Station Number This option selects the number by which the PLC 3 station is identified on an RS 232 C communication link In particular note that the number 377 is illegal Entering 377 as the station number will automatically disable the
102. e sign bit this means that the right arithmetic shift does not change the sign of a numeric value The rightmost bits are shifted out of the expression and are lost Comparison Operators Comparison operators result in a value of 1 if the comparison is true and 0 zero if the comparison is false For example consider the command 112 23 CACC 1 GE CACC 2 4 Addressing Rules and Examples 4 18 If the accumulated value of counter 1 is greater than or equal to the accumulated value of counter 2 then the number 1 is stored in word 23 of input file 12 If the accumulated value of counter is less than the accumulated value of counter 2 a value of 0 zero is stored in word 23 of input file 12 Resulting Values The result of an expression is 32 bit value If the high order bits are not significant that is 1f they can be truncated without changing the value of the expression then the result can be stored in a data field that is less than 32 bits long Attempting to put a value into a field that is too small for it results in an error code of 215 Appendix B General Editing the Message Instruction Editing This chapter explains how to create and edit message procedures and commands for the 1775 module The message procedure commands themselves are described in Chapter 6 The general steps for editing a 1775 message procedure are 1 Create and edit the PLC 3 ladder diagram progr
103. e symbol has already been defined using it again as a destination causes its value to be changed to the value given it by the latest assignment command Note that you can not transfer data from another station and place it into a user symbol defined at your local PLC 3 Format The equals sign 2 is the assignment command As Table 6 A shows the destination for the assignment is on the left of the equal sign and the source or the numeric value is on the right In all cases the source value is assigned to or copied to the destination location Thus the assignment is from right to left on the command line For example the statement 112 024 US 5 Chapter 6 Message Procedure Commands copies the value of user symbol US_5 into word 24 octal of input file 12 Modifiers Several modifiers may be added to the basic assignment command These modifiers affect three aspects of the assignment Scope of assignment Priority level of Data Highway message Type of command message transmitted Scope of Assignment A double equals sign can also be used for the assignment command The extra equals sign modifies the scope of an assignment involving a user symbol If the destination of the assignment is a user symbol the double equals sign defines the destination to be an interprocedural user symbol With the single equals sign the destination becomes a procedural user symbol For example the statement US 2 6 defin
104. ect multiple slave stations to a single master computer You are using MODEMS that have only half duplex capability You are willing to sacrifice data throughput in exchange for ease of implementation One environment for half duplex protocol is a multidrop link with all stations interfaced through half duplex modems The actual nature of the link does not matter much as long as the MODEMS support request to send clear to send and data carrier detect signals If you use dial up MODEMS they must also support data set ready and data terminal ready otherwise you should jumper data set ready to data terminal ready at the 1775 K A module You may have from 2 to 256 stations simultaneously connected to a single multidrop link Each station must have a receiver connected to the circuit and a transmitter that can be enabled or disabled by request to send 11 1 Chapter 11 Half Duplex Protocol Transmission Codes 11 2 You must program a computer to serve as a master that controls which station has access to the link All other stations are slaves and must wait for permission from the master before transmitting Each slave station has a unique station number from 0 to 376 octal The number 377 is a broadcast address When the master sends a message addressed to 377 all slaves receive it The master can send and receive messages to and from each station on the multidrop link If the master is programmed to relay messages t
105. edure PROC A 3 Data Highway DLE STX DST STS TNSW ADDR SIZE DLE EXT BCC EE Command message transmitted to station 24 10014 1 3 3 Chapter 3 Data Highway Communication Levels of Programming 3 4 2 Press the message instruction key 3 Specify message type 1 4 Choose a control file word where status information about the message command can be stored In our Figure 3 1 we used binary file 200 word 200 Data transfers can be either solicited or unsolicited depending on whether they are initiated by the local or a remote station respectively Either type of station initiates the data transfer by issuing a command message If the local station issues the command message the corresponding reply message is said to be solicited because the local station has solicited or requested the data contained in the reply message If a remote station issues the command message that message is said to be unsolicited For solicited messages a local station receives data from a remote station during a read operation The local station sends data to a remote station during a write operation For unsolicited messages a local station receives data from a remote station during a write operation A local station sends data to a remote station during a read operation In read operations the command message requests the data
106. elect this number to enable or disable the option NOTE Those selections shown in bold type affect the operation of the module the LIST display shows an asterisk to indicate when an option is enabled The selections not shown in bold type only cause a movement to another level of LIST This selections indicated in this figure are selected by default at the initial power up 2 20 KA 01 Data Highway Port Station Number 377 Enter Station Number gt KA 01 Data Highway Port Baud Rate 1 38400 2 57600 Enter Next gt 01 Modem Port Enable 1 Enable 2 Disable Enter Next 01 Modem Port Station 377 Enter Station Number gt 01 Modem Port Baud Rate 1 110 2 300 3 600 4 1200 5 2400 6 4800 7 9600 8 19200 Enter Next KA 01 Modem Port Communication Mode 1 Unpolled Mode 2 Polled Subscriber Mode Enter Next 10012 1 Chapter 2 Installation You access the LIST function by typing the word LIST and press the ENTER key After accessing the LIST function select option 6 MODULE STATUS from the SYSTEM MODE MENU LIST then presents you with a menu that describes the modules in your system The menu varies according to the modules in your 3 A typical menu might be MODULES 1 01 1775 8 A A 2 02 1775 8 A A 3 03 1775 13 A A 4 04 1775 S4A B A 5 05 1775 A E 6 06 1775 LX A A 7 07 1775 LX 8 08 1775 S4B B A 9 09 1775 54
107. en the module has permission to transmit otherwise it is off CTS clear to send is a signal from the modem to the RS 232 connector that the carrier is stable and the modem is ready to transmit The module will not transmit until CTS is true If CTS is turned off during transmission the module will stop sending until CTS is restored DTR data terminal ready is a signal from the RS 232 connector to the modem to connect to the phone line that is pick up the phone The module will assert DTR all the time except during the phone hangup 2 13 Chapter 2 Installation sequence Some modem will not respond to DTR until the phone rings while others will always pick up the phone whether it is ringing or not DSR data set ready is a signal from the modem to the RS 232 connector that the phone is off hook It is the modem s answer to The module will not transmit or receive unless DSR is true If the modem does not properly control DSR or if no modem is used DSR must be jumpered to an RS 232 high signal at the RS 232 connector It can be jumpered to DTR DCD data clear ready is a signal from the modem to the RS 232 connector that the carrier from another modem is being sensed on the phone line It will not be asserted unless the phone is off hook Data will not be received at the RS 232 connector unless DCD is true In the full duplex mode the module will not transmit unless DCD is true If the modem d
108. endent of one another and interact with one another in the same way as the organs of the human body Because the organs of the human body are independent of one another it s possible for a surgeon to operate on the lungs or heart without losing the life of the patient Yet at the same time the organs of the body interact when we run or walk or type on a word processor You should use a layered approach to developing communication software for your computer You don t have to design your communication software in this layered fashion but your software must perform all the functions described for the layers in this manual In most cases it will be easier for you to implement and debug the communication software if you follow this layered approach The Data Highway uses these four layers of the ISO model for communication between stations application layer provides the Data Highway commands that you use to transfer data and manage the network network layer determines how you address a Data Highway command It also provides less visible functions such as controlling the flow of information establishing a path between stations and routing messages from your station to another station 9 1 Chapter 9 Computer to PC Communiation 9 2 data link checks the path between stations for errors to ensure that data is transmitted in a proper sequence frames messages sent by a station and checks the integrity of messages
109. er PC or an RS 232 C device privileged commands are sent by intelligent RS 232 C devices only Such devices include computers and intelligent terminals Allen Bradley PC s do not send privileged commands but receive and reply to them A privileged command can read or write into any area in the memory of a PC whether or not switches on the PC have been set to allow it to receive only protected commands The term physical 1 3 Chapter 1 Introduction command is sometimes used synonymously to mean privileged command non privileged commands include any command that both PC s and RS 232 C device can send The non privileged commands include the protected write and unprotected read and write commands The non privileged commands are also referred to as PLC PLC 2 type commands Module Description Figure 1 1 illustrates the front of the 1775 K A module The module has the following hardware features Self test diagnostic indicators Thumbwheel switch for setting identification number Two ports one for Data Highway and one for RS 232 C communication Two sets of indicators one for each port Switches for selecting fault responses and communication option Chapter 1 Introduction Figure 1 1 Communication Adapter Module Cat No 1775 KA TEST i Self Test Indicators NO Thumbwheel Switch RS 232 C port Indicators MODEM INTERFACE COMMUNIC
110. er file and all of the stations 1775 modules have the same station number then all of these modules will transfer data through the same buffer file This can cause unpredictable results if several 1775 K A modules try to read or write to the buffer file at the same time When such a 3 station transmits a command message to a remote Data Highway station the thumbwheel number specified in the PLC 3 message instruction section titled PLC 3 Stations determines which 1775 module actually transmits the command 2 33 General Some Terminology Data Highway Communication This chapter introduces some of the concepts and terminology involved with operating the 1775 K A module of the Data Highway The Allen Bradley Data Highway is a communication network for industrial control applications The Data Highway consists of a central trunkline cable that may be up to 10 000 feet long This cable can link together as many as 64 distinct communication points or nodes called stations Each station consists of some type of processor and a station interface module The station interface module enables the processor to communicate with other stations on the Data Highway The 1775 module is the station interface module for the PLC 3 processor Table 3 A lists all possible combinations of station interface modules and processors Table 3 A Station Components Processor Station Interface Module PLC 4 Microtrol 1773
111. es US 2 to be an interprocedural user symbol and assigns to it the value 6 Do not use the double equals sign with anything other than a user symbol as the destination Message Priority Data Highway messages may be either one of the following priority levels 6 3 Chapter 6 Message Procedure Commands 6 4 Normal Priority If you use the less than sign lt with the assignment command the command will generate a priority Data Highway message Without the less than sign the assignment command will generate a normal Data Highway message For example the statement H027 115 4 lt 112 24 transmits a priority message to Data Highway station 27 octal The priority modifier can be used with either type of assignment or Important Stations with high priority messages are given priority over stations with normal priority messages throughout the command reply cycle For this reason a command should be given a high priority designation only when special handling of specific data is required Using an excessive number of high priority commands defeats the purpose of this feature and could delay or inhibit the transmission of normal priority messages Command Message Type Command messages are of two types protected unprotected As explained in section titled Data Transfers chapter 3 protected commands can access only specified areas of data table memory at a PLC PLC 2 station You will need to
112. es between retransmissions from a given station Figure 11 9 Duplicate Message Transmission SOURCE SOURCE SINK MASTER LINK SLAVE SINK Not Full DLE ENQ STN gt m XXXX DLE STX xxx DLE EXTBCC lt XXXX DL CK Sometime Later Not Full DLE ENQ STN DLE STX xxx DLE EXTBCC DLE ACK Discard Retransmission OK 10059 1 When a slave station fails to respond to a message from the master you should poll the slave to see if itis there If it answers the poll with a DLE EOT but consistently fails to ACK the master s message the slave s message sink is probably full If the slave answers with DLE EOT to a poll you should wait for the slave s receiver buffers to clear This situation is illustrated in figure 11 10 11 17 Chapter 11 Half Duplex Protocol Figure 11 10 Message Sink Full Case 1 SOURCE SOURCE SINK MASTER LINK SLAVE SINK DLE SOH STN DLE STX xxxx DLE ETXBCC Full Timeout Not Full DLE ENQ STN BCC 7 No Message DLE Sometime Later DLE SOHSTN DLE DLE ETX BCC Not Full XXXX DLE OK 10060 1 11 18 Chapter 11 Half Duplex Protocol When a slave station s message source and sink share a common memory pool as i
113. escribed here because the modules automatically take care of it However if you are connecting the 1775 K A module to a computer then you must program the computer to understand and to issue the full duplex protocol described in this chapter or the half duplex protocol described in chapter10 Specifically this chapter outlines the logic for a full duplex input output driver transmitters and receivers used on the RS 232 C link Definition of Link and Protocol physical link consists of a cable and associated hardware such as transmitter and receiver circuits Protocol is the set of programming rules for interpreting the signal transmitted over the physical link by the hardware devices You can connect the 1775 K A module to either of two types of links Point to point physical link Multidrop physical link You can select the 1775 K A module to provide either afull duplex unpolled protocol for peer to peer communication only half duplex polled protocol for peer to peer or master slave communication The type of communication protocol you can use depends on the type of physical link you have For this type of physical ink You can use this communication protocol a point to point link either a peer to peer or master slave communication a multi drop broadband MODEM link either a peer to peer or master slave communication a multi drop baseband a master slave communication MODEM link because the link can
114. esponse another station on the Data Highway is possibly neither of the PLC 3 processors will initiating a message respond to the message You must program other stations on the Data Highway to recover from this condition another station is communicating with the other station will receive no indication that the primary PCL 3 processor a switchover has occurred You can however program a MSG instruction to execute a message upon switchover fig 2 13 or send commands to the backup PLC 3 processor If you are able to communicate with the backup you know that no switchover has occurred Run Backup Bit It is important to alert the proper personnel when a switchover occurs One way you can provide such indication is by having your program monitor the run backup bit data table status section file 0 word 3 bit 17 and turn on alarms or lights when the status changes from backup to run This bit is set in the primary processor and reset in the backup processor It is also possible to link a single PLC 3 controller to more than one Data Highway by installing multiple 1775 K A modules in the same PLC 3 In this configuration each 1775 K A module connects to a different Data Highway and each has a unique station number on its associated highway However all the 1775 K A modules in the same PLC 3 controller can have either the same or different station numbers CAUTION If such a PLC 3 station is communicating through a PLC PLC 2 buff
115. essage Characteristics Half duplex protocol places the following restrictions on the network packet that is submitted to the link layer for transfer The size of a valid network packet is 6 bytes minimum and 250 bytes maximum The first byte of a network packet must be the station number of the receiver station see DST in chapter 12 The receiver ignores messages that do not contain the correct station number As part of the duplicate message detection algorithm the transceiver checks the second third fifth and sixth bytes of each network packet At least one of these bytes of the current network packet must differ from the corresponding byte of the previous network packet in order for the transceiver to act upon the current network packet Otherwise the transceiver assumes that the current network packet is a retransmission of the previous network packet so it discards the current network packet Master Polling Responsibilities You may vary the master polling algorithm depending on how much activity you expect on your network 11 8 Chapter 11 Half Duplex Protocol The master should poll each slave repeatedly until that slave has transmitted all of its messages The master should then send any messages it has for that slave Then the master can poll the next slave in the same way If a slave station fails to respond to a poll the master should remove that slave from the list of active slaves To save time the m
116. except that it is prefixed with DLE SOH and an address code to specify a slave station number At the end of each polling packet is a BCC byte At the end of each message packet is a one byte BCC field Figure 11 1 Formats for Half Duplex Protocol DLE ENQ STN a Polling Packet Chapter 11 Half Duplex Protocol From CMD STS FNC ADDR DATA Application Layer N N X N N Data From SRC STS Tm From Application Layer ieee S 27 P d Data DLE STX From Network Layer DLE b Slave Message Link Packet m ication CMD STS FNC ADDR DATA Laver X N Data From DST SRC CMD STS TNS From Application Layer ieee DLE SOH STN DLE STX From Layer DLE BCC Master Message Link Packet 10051 1 11 5 Chapter 11 Half Duplex Protocol 11 6 Block Check The block check character BCC is a means of checking the accuracy of each packet transmission It is the 2 s complement of the 8 bit sum modulo 256 arithmetic sum of the slave station number STN and all the data bytes in the packet For polling packets the BCC is simply the 2 s complement of STN The BCC does not include any other message packets codes or response code
117. ext command line after the one in which the error occurred For example a message procedure can contain the command ON ERROR RECOVER When an error occurs in the procedure the above command will cause the 1775 module to execute the procedure named RECOVER The procedure RECOVER might be a routine for monitoring error codes After executing RECOVER the module will resume executing the original procedure at the next command line following the one in which the error occurred 7 1 Chapter 7 Error Reporting Error Monitoring To aid in error monitoring the 1775 module maintains a 6 word error block in the module status area of PLC 3 memory This error block contains the following information Word 0 error code for the last error that occurred in the current message procedure Word 1 total number of errors that occurred in the current message procedure Word 2 always contains the value 1 Word 3 line number where the error occurred in the highest level nest level 1 message procedure Word 4 line number where the error occurred in the next highest level nest level 2 message procedure Word 5 line number where the error occurred in the lowest level nest level 3 message procedure The error codes reported are those listed in Appendix B The line number is the relative location of a command line from the beginning of the message procedure containing the line The first line of each pro
118. f PC controller at the station In some cases switch settings on the station interface module can disable execution of a particular type of command at that station For more details refer to the user s manual for the station interface module The basic commands are protected bit write protected write unprotected bit write unprotected read unprotected write Protected Bit Write Use this command to set or reset individual bits within limited areas of the PC data table memory Your access can be limited by memory access rungs in the communication zone of the PC s ladder diagram program The data field in this packet consists of 4 byte blocks each of which contains 16 bit address field a set mask and a reset mask Use the ADDR field to specify the address of the byte to be modified in the PC Message Formats data table memory Put the low byte lest significant bits of the PC address value into the first byte of the ADDr field Use the SET mask to specify which bits to set to 1 in the addressed PC byte Al ina bit position of the SET mask means to set the corresponding bit in the addressed PC byte to 1 a 0 in a bit position of the SET mask means to leave the corresponding bit in the PC byte unchanged Use the RESET mask to specify which bits to reset to O in the addressed PC byte Al ina bit position of the RESET mask means to reset the corresponding bit in the addressed PC byte to 0
119. f data from the link interface hardware Full Duplex Protocol Diagrams The following figures show some events that can occur on the various interfaces Control characters are shown in bold type Link level data is represented by xxxx Line noise is represented by BCC is shown at the end of each message packet Time is represented as increasing from the top of the figure to the bottom Figure 10 9 shows normal message transfer Figure 10 9 Normal Message Transfer SOURCE XMTR LINK RCVR SINK DLE STX xxx DLE ETX BCC Full XXXX gt DLE ACK OK 110046 1 10 17 Chapter 10 Full Duplex Protocol Figure 10 10 shows a DLE NAK response to the initial message transmission After the message is retransmitted a DLE ACK response is given Figure 10 10 Message Transfer with NAK SOURCE XMTR LINK RCVR SINK XXXX DLE STX x x DLE EXTBCC DLE DLE STX xxxx DLE ETXBCC Not Full gt DLE ACK OK 10047 1 Figure 10 11 shows the transmitting station sending a DLE ENQ sequence after a timeout because it did not receive the initial DLE ACK response 10 18 Chapter 10 Full Duplex Protocol Figure 10 11 Message Transfer with Timeout and ENQ SOURCE XMTR LINK RCVR SINK XXXX gt DLE STX DLE EXT BCC
120. f duplex protocol block check 11 6 link layer packets 11 4 multidrop link 11 1 transmission codes 11 2 Hardware Installation 2 1 IF Command 6 7 Indicators 2 5 Installation 2 1 RS 232 C cable 2 6 L Line monitor building one _ 2 LIST 2 19 2 20 2 21 2 22 2 24 2 25 2 26 2 28 2 29 Local error codes B 1 Local error codes B 4 Message Formats 1 Message formats basic command set _A 1 PLC 3 commands 1 Privileged commands _ 1 Message procedure commands 6 1 assignment command 6 2 CREATE command 6 5 DELETE command 6 5 execute command 6 6 EXIT command 6 6 GOTO command 6 7 IF command 6 7 ON_ERROR command 6 9 STOP Command 6 9 Messge procedure commands ON_ERROR command 6 8 Network layer protocol 12 1 CMD High Nibble 12 4 DST and STC 12 network model 12 2 network packet fields 12 3 program and message types 12 1 STS Low Nibble 12 4 TNS 12 5 Number system 4 2 0 ON ERROR Command 6 8 6 9 P PLC 3 Address Specifications 4 7 PLC 3 commands 13 PLC PLC 2 address specifications 4 1 Privileged commands 20 Programming examples 8 1 R Remote error codes 3 Remote station address specifications 4 12 Reply error codes reply error codes B 1 Software features 1 5 Specifications 1 6 STOP Command 6 9 Switches 2 1 T Terminology 1 3 3 1 Oe Rockwell Automation Allen Bradley a Rockwell Aut
121. f the expression following the NOT is a value of 0 zero Otherwise the result is O false For example consider the command 112 242 NOT SYMBOL If the value of SYMBOL A is 0 zero then a 1 is stored in word 24 of input file 12 If the value of SYMBOL A IS anything other than then a 0 zero is stored in word 24 of input file 12 The result of a logical AND is 1 true if the expression preceding the AND and the expression following the AND are both non zero Otherwise the result is O false The result of a logical OR is 1 true if either the expression preceding the OR the expression following the OR or both expressions are non zero Otherwise the result is O false Bitwise 32 Bit Operators Bitwise 32 bit operators manipulate the individual bits in 32 bit operand The bitwise 32 bit complement BNOT inverts the state of each bit in the 32 bit expression That is bits set to 1 are inverted to 0 and bits set to O are inverted to 1 The bitwise 32 bit AND BAND forms a bit by bit logical AND of two 32 bit operands There is no carry from one bit position to the next within the operand For example if A contains the bit pattern 10101010010011110010101010101011 B contains the bit pattern 01110101011100100010101110001010 then the assignment C A BAND B yields C contains the bit pattern 00100000010000100010101010001010 4 16 Chapter 4 Addressing Rules and Examples The b
122. ffset 1s the difference in 2 byte words between the starting address for the current packet and the starting address for the first packet in the message The packet offset for the first packet in the message is always 0 zero Thus adding the packet offset to the address field specified in the message gives the destination address where the current packet begins in the destination station 12 15 Introduction Message Formats This appendix presents the detailed message formats for each type of command and reply message that the PLC 3 can send and ore receive We discuss the message format in the following order Basic Command Set Protected bit write Protected write Unprotected bit write Unprotected read Unprotected write PLC 3 Commands Bit write Word range read Word range write File read File write Privileged Commands Privileged read Privileged write Shutdown request Download request Upload request Restart request Diagnostic counters reset Diagnostic loop Diagnostic read Diagnostic status Set ENQs Set NAKs Set timeout Set variables 1 Appendix A Message Formats A 2 Use these commands to affect only the RS 232 C port of the 1775 KA module Important In the formats shown in this section CMD and FNC values are expressed in hexadecimal notation All other values are given in decimal form Network layer fields are shaded in blue data link layer fields are
123. he PLC 3 with concurrent access to several independent Data Highways The 1775 module can also serve as an interface between the PLC 3 programmable controller and an intelligent RS 232 C compatible device or any Allen Bradley PC and its Data Highway module Some examples of this application of the module are the following Interfacing two PLC 3 controllers through a modem link Interfacing a PLC 3 controller with a computer either directly or through modems Interfacing a PLC 3 controller with a remote Data Highway through a modem link Interfacing a PLC 3 controller as a slave station on a multipoint modem link Interfacing a PLC 3 controller on a point to point link with PLC 2 Family processor through a 1771 KG module The 1772 LR processor is not supported in this configuration Figure 1 3 shows the 1775 K A module in a typical modem application Figure 1 3 Typical Modem Application PLC 3 Controller EHE Modem RENE mm ems Beem g gt Computer NOTE Modems required only 1775 KA Module Modem for distances greater 10002 1 than 50 feet General Hardware Installation Installation This chapter describes installation of the 1775 KA modul
124. hen slave stations on the multidrop link can engage in peer to peer communication Your multidrop link may be either a two circuit system master sends and slaves receive on one circuit slaves send and master receives on the other or a one circuit system master and slaves send and receive on the same circuit You may use a half duplex dial up modem to connect the 1775 K A module to the multidrop link The modem must signal data carrier detect at least once every 8 seconds If it does not the module will hang up On a dedicated line you can jumper lines 6 8 and 11 at the 1775 K A module to prevent the module from hanging up You cannot use multiple masters unless one master is limited to acting as a backup to the other and does not communicate until the primary is shut down Half duplex protocol is a character oriented protocol that uses the following ASCII control characters Control character Hexdecimal Code SOH Start of Header STX Start of Text ETX End of Text EOT End of Transmission ENQ Enquiry ACK Acknowledge DLE Data Link Escape NAK Negative Acknowledge Chapter 11 Half Duplex Protocol These ASCII control characters are extended to 8 bits by adding a zero for bit 7 See ANSI X3 4 CCITT V 3 or ISO 646 for the standard definition of these characters Additionally a block check character BCC is used at the end of each transmission packet for error checking This byte can be any v
125. hing on a line Do not use comments on the same line as label Doing so will cause errors in the message procedure 6 11 General Reporting Error Codes Recovery from Errors Error Reporting The 1775 module detects and reports various types of errors Appendix B lists all the errors reported by the module As you can see from the appendix some of the error codes relate to communications over the Data Highway while others relate to programming errors in the message procedures The 1775 KA module reports errors by their code numbers The module stores the error code in the interprocedural user symbol ERROR The symbol ERROR should be reserved exclusively for error reporting by the module so do not use this symbol for any other purpose ERROR contains only the last error encountered during execution of a command or message procedure If you want to save the error code or manipulate it in any way use an assignment command to copy the code into a more permanent storage word Unless you specify differently the 1775 K A module will stop executing the current message procedure as soon as the module detects an error To specify a different action use the ON ERROR command in the message procedure Then when the module encounters an error it will perform the action specified in the nearest preceding ON ERROR command After the module is done performing ON ERROR action it will resume executing the message procedure at the n
126. ical AND 9 OR Logical OR 10 The result of an expression depends on the order in which the operators are executed The order of execution depends on the type of operator and on left to right placement within the expression Table 4 B gives the order of execution for the different operators For example the command B67 45 643 2 would store the value 12 in word 45 of binary file 67 This is because multiplication is performed before addition If an expression contains several operators with the same order of execution those operators will be executed in the left to right order in which they appear within the expression Extra set of parentheses can be nested within each other to change the order of execution In such cases the expression within the inner most set of parentheses is evaluated first For example the command 67 45 36 6 3 2 would store the value 2 in word 45 of binary file 67 96 is the operator for division Expressions can be used anywhere that direct numeric values can be used within a message procedure including within an address field For example in the statement B67 WORD43 5 the expression WORD 3 specifies the address of a word within binary file 67 Note that the parentheses are necessary to indicate that 3 is part of the word address in this case Chapter 4 Addressing Rules and Examples Number Systems Within an expression direct values are always interpreted as decimal
127. iled Flowcharts Figure D 6 STARTTIME Subroutine STARTTIME d An Implementation Dependant Routine that Schedules TIMEOUT to Be Executed at the Expiration of an Internal of Time Typically 12 Character Times RETURN WK 10076 1 Figure D 7 STOPTIME Subroutine STOPTIME 1 An Implementation Dependant Routine to Cancel TIMEOUT RETURN Um 10077 1 D 6 Figure D 8 TIMEOUT Subroutine TIMEOUT WAKEUP Wake Up the Process Sleeping at WTRESP If Any RETURN Appendix D Detailed Flowcharts Scheduled By e STARTTIME Aborted By e STOPTIME 10078 1 D 7 Appendix D Detailed Flowcharts Figure D 9 GETMSG Subroutine z GETMSG b SLEEP Go to Sleep At WTMSG UNLINK Common e WTMSG Remove a Message From Output Queue Queue Output e Message Boxed area above must be executed indivisibly i e with the scheduler or RETURN interrupts disabled depending on implementation 10079 1 D 8 Appendix D Detailed Flowcharts Figure D 10 SIGOK SIGFAIL Subroutine SIGOK SIGFAIL Place Success Place Failed Code in Message Code in Message Control Block Control Block LINK Place Message on RETURN Queue WAKEUP NET Implementation Dependent Procedure to Tell Network Layer that RETURN Queue Entry Has
128. ilk e IE y LER _ 1 Local Error Codes _ 1 Reply Error Codes _ 1 Remote Error Codes B 3 Local and Reply Error Codes B4 Remote Error codes received from the 1771 KE KF 1771 KG 1771 KA and 1774 KA B 14 Remote Error Codes Received from the 1773 KA Module B 1 Diagnostic Counter Block C 1 Data Highway Port Counters _ 1 Modem Port Counters C2 Detailed Flowcharts D 1 OVerVIew gt iui s peer vie ere P nee do hoe ae D 1 VART SHADE bas ERE Gene X EE yee D 1 SLEEP and WAKEUP D 17 POWERUP 1 General About This Manual Introduction The PLC 3 Communication Adapter Module cat no 1775 KA is an optional module used in the PLC 3 main chassis or expander chassis It serves two purposes 1 Interfacing the PLC 3 processor with the Allen Bradley Data Highway 2 Interfacing the PLC 3 processor with an intelligent RS 232 C device This manual describes the installation programming and operation of the 1775 KA module This manual assumes that you are already thoroughly familiar with the programming and operation of the PLC
129. information on protected and unprotected commands see section titled Access Privileges chapter 3 If you do not select enable this option the module will be able to transmit only protected commands At initial power up the module enables the SEND UNPROTECTED option by default Accept Upload Download This option determines whether or not the 1775 K A module will be able to execute upload and download commands sent to it by a computer If option 3 ACCEPT UPLOAD DOWNLOAD is selected the module will be able to execute both upload and download commands You send a sequence of upload and download commands when you want to transfer the memory of the PLC 3 to another station or to transfer the memory of another station to a PLC 3 If this option is not selected enabled the module will not be able to execute either of these two types of commands For a description of upload and download commands refer to Appendix At initial power up the module enables the ACCEPT UPLOAD DOWNLOAD option by default Accept Writes This option determines whether or not the 1775 K A module will accept write type command messages from a remote Data Highway station when the local PLC 3 processor s memory protect keyswitch is on If option 4 ACCEPT WRITES is selected the module will accept write commands regardless of the setting of PLC 3 s memory protect keyswitch If this option is not selected enabled the module will accept write commands when
130. iod will be 10 seconds and will be displayed as 100 10 SEC The same timeout setting applies to both the Data Highway and the modem ports The default timeout setting is 5 seconds displayed as 50 10 SEC The timeout period applies to each individual transmission Because of their size some messages consist of several packets of data Each message packet requires a separate transmission Therefore the timeout is restarted for each packet If the 1775 K A module waits longer than the timeout period for a reply to one of its messages it generates an error code of 37 Appendix B The module then resumes executing the current message procedure at the line following the one in which the timeout occurred LIST keeps you at this timeout level and allows you to make repeated changes to the timeout value To return to the preceding next highest level of LIST press the ENTER key again without entering a new timeout value Chapter 2 Installation Send Unprotected This option determines whether or not the 1775 K A module will be able to send unprotected command messages to other stations If you select option 2 SEND UNPROTECTED the 1775 KA module will be able to send both protected and unprotected commands You can use an unprotected command to read or write to any area of a PC data table You can use a protected command however to write only to those areas of a PC data table specified by the PC that receives the command For more
131. iplexer Which H B Row Output ave Been Sent Bytes SENDCTL Messages SENDDATA XMIT Messages SENDETX DLE to be sent ENQ Network Layer DLE ACK DLE ACK DLE Separa ingly Row Input Buffers Bytes Messages GETCODE RCVE Received DLE Messages ENQ lt 10071 1 0 1 Appendix D Detailed Flowcharts Figure D 2 Transmitter Routine for Full Duplex Protocol Internal Storage XMIT Counter e Timeout Counter GETMSG Get Message Default value used by the mod y ule Reset and Timeout Counters Legend SENDCTL Wait for ACK Send NAK or Timeout DLE ENQ Received DLE NAK 3 Timeouts for this Message Received DLE ACK No 3 NAKs Received for this Message Y SIGFAIL SIGOK SIGFAIL Tell Net Tell Network Tell Net Work Layer Mesage work Layer of Was Sent Layer of ie D 2 10072 1 Figure D 3 Appendix D Detailed Flowcharts Receiver Routine for Full Duplex Protocol C RCVE gt Reset Buffer Flag Set Header to Illegal Value GET BUFFER Get a Buffer gt LAST Variables e LAST Value of Last Response e HEAD
132. is disabled by default The revision D or earlier version of the module does not have the PLC 2 MASK option Data Highway Port Selecting option 2 DATA HIGHWAY PORT from the above menu section titled Programmable Configuration Parameters causes LIST to present the following menu KA nn DATA HIGHWAY PORT ENABLE DISABLE PORT 2 STATION NUMBER 3 BAUD RATE ENTER NEXT Chapter 2 Installation This menu allows you to select options that apply to only the Data Highway port of the 1775 module These options are described below Enable Disable Port This option determines whether or not the 1775 K A module can communicate over the Data Highway you must select the ENABLE option in order to allow communication to take place If you make no selection the PLC 3 disables this port by default Note however that you cannot use LIST to change any other parameters of the Data Highway port unless you first DISABLE the port After you are done entering parameters through LIST don t forget to ENABLE the Data Highway port again Station Number This option selects the number by which the PLC 3 station is identified on the Data Highway Allowable station numbers are 1 to 376 octal In particular note that the number 377 is illegal Entering 377 as the station number will automatically disable the 1775 module and you will not be able to ENABLE it again through LIST until you select a different station number If you mak
133. itwise 32 bit EXCLUSIVE OR BXOR forms a bit by bit logical EXCLUSIVE OR of two 32 bit operands There is not carry from one bit position to the next within the operand The bitwise 32 bit OR BOR forms the bit by bit logical OR of two 32 bit operands There is not carry from one bit position to the next within the operand Arithmetic Operators The arithmetic operations are addition subtracting multiplication and division These are binary not BCD operations that produce 32 bit signed integer results A result from these arithmetic operations should normally be assigned to a 32 bit destination The result can be assigned to a 16 61 destination only if the result is small enough in absolute value less than 65 535 to fit into 16 bits If the result is assigned to a 16 bit destination but is too large to fit into 16 bits then an error code of 215 results There is no indication of overflow or underflow conditions with arithmetic operations Shift Operators When a left arithmetic shift is executed zeros are shifted into the rightmost bits of the expression The leftmost bit are shifted out of the expression and are lost When a right arithmetic shift gt gt is executed the leftmost bit of the expression does not change If the leftmost bits is a 1 then 1 s are shifted in from the left If the leftmost bit is 0 zero then O s are shifted in from the left Since the leftmost bit of an expression is th
134. k level data for purposes of duplicate message detection Sends a DLE ACK While waiting to receive a message a slave station could receive a polling packet that begins with a DLE ENQ sequence The slave will ignore the poll if the polling packet does not contain the slave s station number or if the BCC is the polling block is incorrect If the poll is valid then one of three conditions can exist The slave is still holding a message that it had transmitted previously but had not been acknowledged by the master station There is a limit on the number of times the slave will attempt to transmit a message If this limit has been exceeded the slave responds to this by writing an error code into its error word in the PC data table and then tries to transmit the next message from the message source If the NAK limit is not exceeded the slave tries to retransmit the current message Ifthe slave does not currently have a message to send it tries to get one from the message source If a message is available the transceiver initializes its retry counter and transmits the message in response to the poll If not message is available the transceiver responds to a poll by transmitting a DLE EOT To transmit a message the slave transceiver uses the same message block format as the full duplex format section 10 3 2 After sending a message the transceiver keeps a copy of that message until it receives a DLE ACK from the master station
135. l Duplex Protocol RECEIVER is defined as variables LAST HEADER is 4 bytes copied out of the last good message RESPONSE is the value of the last ACK or NAK sent BCC is an 8 bit block check accumulator LAST HEADER invalid LAST RESPONSE NAK loop reset parity error flag GET CODE if DLE STX then begin BCC 0 GET CODE while it is a data code begin if buffer is not overflowed put data in buffer GET CODE end if the control code is not a DLE ETX then send DLE NAK else if error flag is set then send DLE NAK else if BCC is not zero then send DLE NAK else if message is too small then send DLE NAK else if message is too large then send DLE NAK else if header is same as last message send a DLE ACK else if message sink is full send DLE NAK else begin send message to message sink send a DLE ACK save last header end end else if DLE ENQ then send LAST RESPONSE else LAST RESPONSE NAK end GET CODE is defined as loop variable GET CHAR if char is not a DLE begin add char to BCC return the char and data flag end else 10 16 Chapter 10 Full Duplex Protocol begin GET CHAR if char is a DLE begin add char to BCC return a DLE and a data flag end else if char is an ACK or NAK send it to the transmitter else if char is an ETX begin GET CHAR add char to BCC return ETX with a control flag end else return character with a control flag end end end GET CHAR is defined as an implementation dependent function that returns one byte o
136. l is used as either a procedure name or a symbolic address The characters in a system symbol must conform to the general rules given above for all symbols System symbols are delimited by the character which distinguishes them from user symbols Procedure Names A procedure name is a way of referring to a message procedure You assign a procedure name at the time you generate or edit the message procedure Chapter 6 One procedure can execute a second procedure simply by stating the name of that second procedure This allows for nesting of procedures up to three levels deep Symbolic Addresses 4 5 4 Addressing Rules and Examples 4 6 A symbolic address is another way of representing the logical address of data section titled Addresses You can generate a symbolic address by using the CREATE command Chapter 8 A symbolic address can be used anywhere that a logical address can be used in a message procedure The symbolic address is stored in the system symbols area of the PLC 3 memory Scope of System Symbols System symbols can be either local or global in scope A global system symbol is known in any context A local system symbol is known only in the context in operation at the time the symbol was generated Context is explained in the PLC 3 Programming Manual publication 1775 801 At the time you generate the system symbol you can specify whether it is to be local or global If you do not
137. le Note however that the PLC PLC 2 station cannot access its assigned file until that file is created and allocated at the PLC 3 To create a PLC 3 file use the CREATE command described in the PLC 3 Programming Manual publication 1775 801 Note that it is possible to have two PLC 3 stations communicate with each other as if they were PLC PLC 2 stations To do this simply allocate the appropriate PLC PLC 2 buffer files in the PLC 3 stations and uses the PLC PLC 2 addressing format section titled PLC PLC 2 Address Specifications chapter 4 in the assignment commands Similarly a computer can sent PLC PLC 2 commands to a PLC 3 station by using the appropriate message packet formats Appendix A To allow as many as 4 remote stations to access the same PLC 3 input file 1 Enable the PLC 2 MASK option in the LIST function PLC 2 MASK is option 6 on the Module Options menu 2 Select station numbers 100g apart For example you could use stations 010 110 210 and 310 The stations will have access to the input file which matches the lower two digits of these station numbers input file 10 in this example When the 1775 KA module receives a PLC 2 type command it masks the upper octal digit in order to determine which input file to access So commands sent from stations 010 110 210 and 310 would all access input file 10 Chapter 3 Data Highway Communication PLC 4 Stations To read or write to a PLC 4 station
138. le exists but the action specified refers to addresses beyond the end of the file Possible causes include 1 In a word assignment statement the offset is greater than the file size 2 In a word range assignment statement the sum of the base address and the offset is greater than the total file size 3 In a file assignment statement the destination file is smaller than the source file If the source file is remote a single packet will be fetched from the remote station s file 214 local Local source and destination files differ in size 215 local The value resulting from operations specified on the left side of an assignment statement will not fit into the destination specified on the right side 1 The source is in the H section and the destination is in the N section but the number is too large i e outside the range 32768 to 32767 2 A word is transferred from a binary section I or B section to the N or C section and the high order bit is a 1 3 The destination is in the D section but the number is not a valid BCD bit pattern 217 local More than 8 levels specified in file address 218 local File size changed between packets of a multi packet transaction 230 local Reply packet too small 11 Remote Error Codes Received from the 1773 Module Error Error Code Type 231 reply For all PLC 3 read and write commands There is an error in converting the block address major
139. module begins operation the busy bit 14 is set the operation is complete the busy bit 14 is set either the done bit 15 or the error bit 13 is set the rung becomes false the request bit 17 is reset the busy bit 14 is reset the enable bit 16 is reset the latched enable bit 12 is reset the rung becomes true a second time either the done bit 15 or the error bit 13 is reset 5 Enter an extended address for the channel In our Figure 3 1 we address the module status area of memory specify the 1775 module and a thumbwheel setting of 1 6 Enter either a command or a command procedure In Figure 3 1 we entered the command procedure PROC A Data Highway Message Procedure As already stated the 1775 K A module has its own programming language that consists of commands Chapter 8 A group of related commands make up a Data Highway message procedure These commands and message procedures determine what messages are transmitted over the Data Highway 3 5 Chapter 3 Data Highway Communication Data Transfers The whole purpose of Data Highway communication is to transfer data from one station processor memory location to another To accomplish these data transfers you can program the assignment command into the 1775 module Chapter 6 gives the details of the assignment command For now let s just look at the simple example in Figure 3 2 In this example the assignment command copies a wo
140. n the 1775 K A module it may be that the message sink full indication results from an abundance of messages in the message source which uses up all free pool memory In this case the memory can be freed up by receiving messages from that slave station Waiting for the memory to clear by the action of the slave station alone may not work since it could be that the only way to fee up space is for the slave to send a message to the master This situation is illustrated in Figure 11 11 Figure 11 11 Message Sink Full Case 2 SOURCE SOURCE SINK MASTER LINK SLAVE SINK DLE SOH STN DLE STXxxxx DLE ETX BCC Full Timeout Not Full DLE ENQ STN gt XXXX lt DLE STX DLE ETX BCC DLE ACK co XXXX DLE SOH STN DLE STXxxxx DLE ETXBCC Not Full XXXX OK 10061 1 11 19 Chapter 11 Half Duplex Protocol Line Monitoring 11 20 When monitoring half duplex protocol on a two wire link you need to monitor only one line the example below shows a message sent by the master and a reply sent by the slave in answer to a poll Slave responses are in bold Message from master to slave DLE SOH STN DLE STX xxxx DLE ETX BCC DLE ACK Message sent from slave to master in answer to poll DLE ENQ STN BCC DLE STX xxxx DLE ETX BCC DLE ACK Poll with a DLE EOT answer DLE ENQ STN BCC
141. nd is treated just like a nesting level Figure 7 2 illustrates this point for an ON ERROR command In this figure an addressing error in line 10 of procedure MAIN causes activation of the ON ERROR command which calls for execution of procedure SAM But SAM also contains an error The error in SAM is the last one detected so it is the one finally reported in the error block Since procedure SAM is called by the ON ERROR command in procedure MAIN the nesting for SAM is 2 levels deep Figure 7 2 Examples of ON ERROR Nesting Error Block Procedure Word Contents decimal MAIN ON ERROR SAM 0 160 7 2 1000 1 2 e e 2 1 SAM 3 1 e e e M 4 8 e 25 0 5 0 e 10031 1 Chapter 7 Error Reporting Access to Error Block The error block retains its data even after the message procedures are done executing It is re initialized with each execution of a MSG instruction in the PLC 3 ladder diagram program The extended address for the beginning of the error block file is E2 5 nn 4 0 where nn is the thumbwheel number of the 1775 K A module You can access this error block by any one of the following means Displaying it through the front panel of the PLC 3 controller Using the data monitor mode of the Industrial Terminal cat no 1770 T4 Using the move status MVS command in the PLC 3 ladder diagram program Using
142. nes what action the command executor at the destination station will perform The hexidecimal values of the CMD and FND bytes are listed in Table 12 A for each of the types of messages that can be transmitted across this link Bits 0 through 3 of the CMD byte must be the same in the reply message as it is in the corresponding command message In current implementations this is either a command code or a command executor selector The application program must always copy this field from the command to the reply message Chapter 12 Network and Application Layer Protocols Table 12 A The commands that the PLC 3 can send and or receive and the hexadecimal values for the CMD and FNC bytes Command Reply Devices that Command Command Name Message Message can send the Type Hex Hex command CMD PLC 3 or 2 Protected Bit Write RS 232 CI I Protected Block Write device Unprotected Bit Write Unprotected Block Read Unprotected Block Write PLC 3 or PLC 3 Bit Writes RS 232 C commands File Read device File Write Word Range Read Word Range Write RS 232 C PLC 3 Download Request device Upload Restart Request Download Shutdown Request Commands Upload Request RS 232 C Privilegedl3l Physical Read OF 09 4F device Physical Write OF 08 4F RS 232 C Diagnostic Counter Reset device Loop Read Status Set ENQs Set NAKs Set Timeout Set Variables 1 RS 232 C device means a computer or intelligent terminal 2
143. ng for the KE KF module is 128 cycles or about 3 seconds Command Format 06 04 Reply Format 46 Appendix A Message Formats Set Variables Use this command to set the timeout and maximum NAKs and ENQs all at once Put the timeout in the first byte of the DATA field the NAK setting in the second byte and the ENQ setting in the third byte If you do not specify a data value for any one the variables in this command that variable is automatically reset to zero Command Format 06 02 Reply Format Ea aco Sea co 46 A 30 General Local Error Codes Reply Error Codes Error Codes This appendix describes the error codes that the 1775 module will report Errors are of three types local reply remote The 1775 module generates local errors while trying to execute one of its own message procedures The module stores local error codes under the user symbol ERROR Possible local errors are listed in section titled Local and Reply Error Codes The 1775 KA module generates reply errors while trying to respond to a command message received from a remote Data Highway station The 1775 module inserts the reply error code in the STS or EXT STS bytes Appendix A of any reply message packet it transmits to a remote station For reply errors there is a direct correlation between the error codes in the STS and EXT STS bytes of reply messages and the error codes
144. nnector RS 232 C Connector RS 232 C Connector of 1775 KA P d N 2 4 5 1775 gt RS 232 C Device 6 7 e 8 20 25 2 Transmit Data 3 Receive Data 7 Ground 18 Received Data Return 25 Transmitted Data Return 10006 P ii Connect these lines according to the specifications for your modem or RS 232 C device Channel B Industrial Terminal Cat No 1770 T4 3 7 18 25 10069 1 3 Appendix A Message Formats 25 Pin Male RS 232 C Connector Figure A 2 A RS 232 C Link Configuration that includes a line monitor 25 Pin Male RS 232 C Connector 25 Pin Female d RS 232 C Connector RS 232 Device 1775 KA PLC 3 Communication Adapter Module A4 Toggle Switch Industrial Terminal System 4 70 14 5 Cat No 17 Ke 000 00 User supplied 25 Pin Male Connector with Straight Hood Cat No 1770 XXP 10069 1 To program the industrial terminal to act as a line monitor complete the following steps 1 Attach the 1770 KDA programming keyboard to the industrial terminal 2 Press SHIFT MODE and type 2 to select the alphanumeric mode In the steps th
145. o main purposes Interfacing the PLC 3 processor with the Allen Bradley Data Highway Interfacing the PLC 3 processor with an intelligent RS 232 C device You can use the module for both of these purposes simultaneously In Data Highway applications the module serves as an interface between the PLC 3 programmable controller and the Allen Bradley Data Highway The Data Highway is an industrial communication network that links together as many as 64 distinct stations Each station can consist of a programmable controller such as the PLC 3 a computer or intelligent RS 232 C device The central trunkline of the Data Highway may be up to 10 000 feet long and each station may be as far as 100 feet from the trunkline Figure 1 2 gives an example of a Data Highway configuration Chapter 1 Introduction Figure 1 2 Example Data Highway Configuration PLC 3 Controller Cry i b l d x Allen Bradley P zx Ex IER Data Highway Pl ge Ji EAR 1 mi Il PC 1775 KA Module PC PC PC PC NOTE All PCs are Allen Bradley Y Up to 64 Stations 10001 1 Chapter 1 Introduction The PLC 3 can support multiple 1775 K A modules in the same PLC 3 chassis This provides t
146. odem and Data Highway ports 3 Use the LIST function to select BACKUP OPERATION for both the primary and backup 1775 modules For more information see the PLC 3 Installation and Operation manual publication 1775 6 7 1 Thus when you select BACKUP OPERATION the condition appears like this 5 BACKUP OPERATION 4 Use the LIST function to assign the same station address to the modules for the primary PLC 3 and the backup PLC 3 processor You can never give the 1775 K A module a station address of 3778 and when you select the BACKUP OPERATION you can not give the module an address of 2778 Because you have chosen BACKUP OPERATION the module in the backup PLC 3 will assume an address other than the address you assign it with the LIST function Figure 2 12 You assign both modules an identical address If the address The backup module assumes is between an address that is 001g and 2768 100g higher than the primary module 300g and 376g 200g lower than the primary module At switchover the address for the backup module returns to the station address you assigned to it with the LIST function 5 Use the LIST function to enable whichever Data Highway or Modem port you are using to connect primary to backup 2 29 Chapter 2 Installation 2 30 Figure 2 12 How addresses of the primary and backup PLC 3 controllers change during switchover Before switchover Primary PCL 3 Backup PLC 3 You set these
147. oes not properly control DCD or if a modem is not being used DCD must be jumpered to at the RS 232 connector TXDRET transmitted data return is the return signal for TXD It is connected to module logic ground through a resistor RXDRET received data return is the return signal for RXD It is connected to the isolated receiver and is isolated from all other circuitry on the module Connections To The RS 232 Port Connection to the RS 232 port of the 1775 can be one of two types Short line 50 feet or less solated long line between 50 and 7 000 feet For short lines the connection may be either direct or through modems You connect an intelligent RS 232 C compatible device to an interface module by attaching a cable to both the device and to the module socket labeled RS 232 C CHANNEL The RS 232 C device may be another Allen Bradley communication interface module or another manufacturer s device For a standard RS 232 C connection the cable should be no longer than 50 feet If your RS 232 C device has an Allen Bradley line driver receiver you may use a cable up to 7 000 feet long If you want to connect the 1775 K A module to a 1771 KG or 1771 KE KF module through the RS 232 C channel use the cabling pinout diagram Figure 2 8 to construct your own cable Chapter 2 Installation Figure 2 8 Connection to Allen Bradley 1771 KG or 1771 KE KF Module Connect the Shield at One End Only
148. ogether with the current one The format of the STOP command is simply the single letter S without any modifiers or parameters The STOP command is a drastic means of terminating a message procedure so it should be used only when no other action is possible The normal means of terminating a procedure is the EXIT command section titled EXIT Command When the STOP command is used it results in an error code of 179 Appendix B In addition to containing commands and nested procedures a message procedure can also contain functions Functions can be used anywhere expressions can be used 6 9 Chapter 6 Message Procedure Commands There are two functions TO_BCD FROM_BCD Figure 6 2 illustrates the format of these functions as they might appear in an assignment command Figure 6 2 Examples of TO BCD and FROM BCD Functions D 12 TO BCD 27 COUNT FROM BCD D 12 es N NI 6 10 Function Parameter Function Assignment Command Destination of Resulting Value 10028 1 The parameter of the function must be enclosed in parentheses The parameter may be any one of the following direct numeric value either decimal or octal Anexpression user symbol A logical address A symbolic address TO BCD Function The TO BCD function converts its parameter into a binary coded decimal value that is 32 bits long For example the TO BCD function in Figure 6 2 stores the number 27 in binary
149. ollowing restrictions 4 12 Expression Chapter 4 Addressing Rules and Examples 1 A remote address can be used only with the single equals sign type of assignment command 2 Inthe assignment command either the source or the destination but not both may be a remote address 3 A remote address may contain an embedded expression but a remote address may not be embedded in an expression Expressions use operators to combine two or more numeric values into a single value Table 4 B lists the operators that can be used in an expression These operators are listed from highest priority 1 to lowest priority 10 Expressions may be nested within other expressions by enclosing the inner expression within parentheses Table 4 B Expression Operators Order of Operator Operation Execution Bit operator 1 NOT Logical complement 1 or BNOT Bitwise 32 bit complement 1 Multiplication of 32 bits 2 96 Division of 32 bits 2 Addition of 32 bits 3 Subtraction of 32 bits 3 Left arithmetic shift 4 gt gt Right arithmetic shift 4 amp or BAND Bitwise 32 bit AND 5 or BXOR Bitwise 32 bit EXCLUSIVE OR 6 or BOR Bitwise 32 bit OR 7 EQ Compare equals 8 GT Compare greater than 8 GE Compare greater or equal 8 4 13 4 Addressing Rules and Examples Order of Operator Operation Execution LT Compare less than 8 LE Compare less or equal 8 NE Compare not equal 8 AND Log
150. omation Business has been helping its customers improve pro ductivity and quality for more than 90 years We design manufacture and support a broad range Allen Bradley of automation products worldwide They include logic processors power and motion control devices operator interfaces sensors and a variety of software Rockwell is one of the worlds leading technology companies Worldwide representation Argentina e Australia e Austria e Bahrain e Belgium Brazil e Bulgaria e Canada Chile e China Colombia Costa Rica Croatia e Cyprus e Czech Republic e Denmark Ecuador e Egypt El Salvador Finland France Germany Greece e Guatemala e Honduras e Hong Kong Hungary Iceland e India Indonesia e Ireland e Israel Italy e Jamaica Japan e Jordan Korea Kuwait e Lebanon e Malaysia Mexico e Netherlands New Zealand e Norway Pakistan e Peru e Philippines e Poland e Portugal Puerto Rico Qatar e Romania Russia CIS e Saudi Arabia e Singapore Slovakia Slovenia e South Africa Republic e Spain e Sweden Switzerland Taiwan e Thailand Turkey e United Arab Emirates e United Kingdom United States Uruguay Venezuela e Yugoslavia Allen Bradley Headquarters 1201 South Second Street Milwaukee WI 53204 USA Tel 1 414 382 2000 Fax 1 414 382 4444 Publication 1775 6 5 1 October 1992 PN 404639601 Supersedes 177
151. ommand Illegal use of label eg not in a procedure Label not found Duplicate label User symbols must be distinct from labels Too many nested procedures Insufficient privilege for the specified operation This error can occur when an attempt is made via the assignment command to write into a major section of memory in which the 1775 KA module Remote Error Codes Received from the 1773 KA Module Error Error Code Type 148 local 149 local 150 local a 154 local 156 local 159 local 160 local 161 local 163 local 164 local 165 local 166 local does not have access privileges namely major section 0 1 or 2 Unbalanced parenthesis in expression procedure name was used in a field that required symbolic address or a user symbol variable A label was used in a field that required symbolic address or a user symbol variable Error in reading address for symbol entry Illegal symbol in expression Bad level specified in extended address 1 More than 9 levels were specified in an extended address 2 Something other than a or a number followed a in an extended address Unrecognized section specifier An illegal character Bad timer or counter specification 1 The first letter of the data table address is a T C or P but there are not 4 characters in the specification Incorrect addresses that would cause this error include C 15
152. ommand only after the source station has successfully transmitted a shutdown request The function code for this command is 8 Command Format DLE STX DST SRC CMD STS TNS FNC PLC 3 OF 08 physical address DATA Max of 238 bytes or 119 words Reply Format This is the same as the reply packet format for all writes A Format when the command was successfully executed epp Te ppp B Format when reporting an error DLE STX DST SRC CMD STS TNs ETX DLE ETX BCC 4F STS Where the extended status byte is optional From a computer you use this command to ask the 1775 K A module to initiate either a PLC 3 shutdown if the computer has download privileges or a freeze on file allocations if the computer has upload privileges This command halts program and I O scanning You cannot issue this command until you have successfully transmitted an upload or download request to the 1775 K A module This command has a function code of 7 A 21 Appendix A Message Formats A 22 Command Format OF 07 Reply Format A Format when the command was successfully executed Ea Ka od 4F B Format when reporting an error DLE STX DST SRC CMD 575 TNS ETX DLE ETX BCC 4 STS Where the extended status byte is optional Download Request A computer can use this command to inform the 1775 module that it wants to do a download If the 1775 K A module grants the downloa
153. ommands A PLC 3 receives privileged commands from an RS 232 C device such as a computer the PLC 3 does not send these commands The privileged commands are privileged read download request privileged write upload request diagnostic counters reset restart request diagnostic loop set ENQs diagnostic read set NAKs diagnostic status set timeout Privileged Read Use this read command with a PLC 3 physical address as a starting address You use this command to upload from a PLC 3 to a computer The destination 1775 K A module will accept this command only after the source station has successfully transmitted a shutdown request The function code for this command is 9 Command Format DLE STX DST SRC CMD STS TNS FNC PLC 3 SIZE DLE ETX BCC 0 09 physical address Reply Format TDATA Max of 238 bytes or 119 words DLE ETX BCChis is the same as the reply packet format for all reads A Format when the command was successfully executed E DATA Max of 244 bytes or 122 words B Format when reporting an error DLE STX DST SRC CMD 575 TNS ETX DLE ETX Bcc 4F STS Where the extended status byte is optional A 20 Message Formats Privileged Write Use this write command with a PLC 3 physical address as a starting address You use this command to download to a PLC 3 from a computer The destination 1775 KA module will accept this c
154. one of the error codes listed in section titled Local and Reply Error Codes Error codes 81 to 87 appear in the STS byte of the reply message and codes 231 to 241 appear in the EXT STS byte Appendix A Remote Error Codes The local PLC 3 station receives remote error codes in a reply to a command it has sent to a remote station These error codes are stored under user symbol ERROR in the local PLC 3 station The extended address for the beginning of the error block file is E2 5 nn 4 0 where nn is the thumbwheel number of the 1775 K A module You can access this error block by any one of the following means displaying it through the front panel of the PLC 3 controller using the data monitor mode of the Industrial Terminal cat no 1770 4 using the move status MVS command in PLC 3 ladder diagram program using the I O Scanner Message Handling Module cat no 1775 S4B using the 1775 module The meaning of a particular remote error code will vary depending on the type of communication interface module at the remote station For example if the remote station is a PLC 3 processor with a 1775 KA interface module the remote error codes will have the meanings listed in section tilted Local and Reply Error Codes For the meanings of other remote error codes refer to the appropriate user s manual for the communication interface module at the remote station B 3 Remote Error Codes
155. ordaddr gt lt bit gt lt filesym gt lt offset gt lt bit gt lt wordsym gt lt bit gt Figure 4 6 gives some examples of addressing individual bits in PLC 3 memory 4 9 4 Addressing Rules and Examples Figure 4 6 Example of Addressing Specific Bits in PLC 3 Memory FILE A 16 N _ J Bit number 8 decimal Delimiter Word offset from bewginning of file Delimiter Symbolic address of file Bit number 8 decimal Delimiter Logical word address PLC PLC 2 Address The PLC and PLC 2 processors use logical data addresses These Specifications addresses are usually specified as octal numbers However the 1775 module interprets these addresses as decimal numbers unless they contain leading zeros section titled Number Systems Therefore if you want to specify a PLC or PLC 2 word address as an octal number begin the number with a O zero 10023 1 Addressing a Word Range To address a range of words in PLC or PLC 2 memory use this format lt offset gt lt size gt Figure 4 7 illustrates this addressing format You may use a word range only as the source field in an assignment command 4 10 Chapter 4 Addressing Rules and Examples Figure 4 7 Example of Addressing a Range of PLC PLC 2 Words H024 015 4 nt SH aT Number of words to transferred decimal Delimiter Word offset from beginning of memory octal Address delimiter
156. otifies the message source that the transmission has failed The transmitter can then proceed with the next message DLE ACK and DLE NAK are the only response codes defined If the receiver gets an invalid response code it ignores it Note that the transmitter must encode a text value of 10 hex as two consecutive indivisible bytes each of value 10 hex This is necessary to distinguish the text value of 10 hex from the DLE control code of 10 hex This technique is known as DLE stuffing The receiver must be able to reverse this process and extract the original text value of 10 hex Figure 10 7 is a flowchart which gives a simplified view of an example of software logic for implementing the transmitter Table 6 A gives a detailed description of an example of software logic for implementing the transmitter in structured English procedures In appendix D are flowcharts which give a detailed view of an example of software logic for implementing the transmitter Figure 10 7 Transmitter for Full Duplex Protocol Chapter 10 Full Duplex Protocol Retransmit Same Message Message Packet DLE STX Data DLE ETX BCC Timeout Loop Received DLE NAK Received DLE ACK 3 3 NAKs Timeouts Received for this for this Message Message Legend No Recovery Procedure ne DLE ENQ Ready to Transmit Next Message Default Values Used by the
157. owledgement to its first message transmission it retransmits the same message in answer to the second poll The master receives the second transmission of the message with no error and responds with DLE ACK Figure 11 8 Poll with Message Returned SOURCE SOURCE SINK MASTER LINK SLAVE SINK Not Full gt DLE ENQ STN 7 lt XXXX DLE STX xx xx DLE EXTBCC DLE ENQ STN BCC lt DLE STX xxx DLE EXTBCC Same Message lt XXXX DLE ACK gt 10058 1 Figure 11 9 shows a slave unable to receive the acknowledgement from the master after the master successfully received the message from the slave Sometime later when the master polls that same slave again the slave sends the same message again The master responds with DLE ACK but discards the received transmission block because it detects it to be a duplicate message received from that slave With multiple slaves to implement this duplicate message detection the master must do either of the following Polla station repeatedly without polling any other station until it receives a DLE EOT to be sure it has detected any retransmissions 11 16 Chapter 11 Half Duplex Protocol If each station is polled only once per cycle the master must keep a record of the first 6 link level data bytes of the last transmission from each station since other stations may transfer messag
158. ows detailed message formats Appendix B lists error codes reported by the 1775 1771 1771 KG 1771 KE KF 1773 and 1774 K A modules Appendix C lists diagnostic counters stored at 1775 K A 1771 1771 KG 1771 1773 and 1774 modules Appendix D gives detailed flow charts of an example of software logic for implementing a full duplex protocol Related Documentation Read this manual in conjunction with the documentation listed in Table and Table 1 B Table lists related PLC 3 documentation and Table 1 B lists related Data Highway documentation Table 1 A Related PLC 3 Documentation Publication Number Title Old New No 1775 800 1775 6 7 1 PLC 3 Installation and Operations Manual 1775 801 1775 6 4 1 PLC 3 Programming Manual 1775 806 1775 6 5 3 I O Scanner Message Handling Module User s Manual 1775 900 1775 2 1 PLC 3 Controller Data Sheet 1775 901 1775 2 2 PLC 3 Processor Module Data Sheet 1775 902 PLC 3 Memory Organization Data Sheet 1775 904 1775 2 4 Power Supply Data Sheet 1775 908 1775 2 6 PLC 3 Memory Modules Data Sheet 1775 910 1775 2 8 PLC 3 Main Chassis Data Sheet Chapter 1 Introduction Table 1 B Related Data Highway Documentation Publication Number Title Old New No 1770 810 1770 6 2 1 Data Highway Cable Assembly and Installation Manual 1771 801 1771 6 5 1
159. r 10 Full Duplex Protocol Receiver Actions Since the receiver gets dirty input from the physical world it is more complex and must be capable of responding to many adverse situations Some of the things that can conceivably happen are listed here The message sink can be full leaving the receiver with nowhere to put a message A message can contain a parity error The BCC can be invalid The DLE STX or DLE ETX BCC may be missing The message can be too long or too short A spurious control or text code can occur outside a message spurious control code can occur inside a message Any combination of the above can occur The DLE ACK response can be lost causing the transmitter to send a duplicate copy of a message that has already passed to the message sink Receiver B must keep a record of the last response code DLE ACK or DLE sent on path 2 Figure 10 5 If it receives a DLE ENQ the receiver sends this recorded response code again The receiver also keeps a record of the first six link level data bytes of the last message received If the SRC CMD and both TSN bytes of a new message are identical to the corresponding bytes of this record the receiver responds with a DLE ACK but ignores the new message This process is known as duplicate message detection and is part of the link level data security It guards against re execution of a message that has already been received successf
160. rd 16 bits of data from the source to the destination location The source of the data is always specified on the right of the equals sign and the destination is always on the left Figure 3 2 Example Assignment Command B45 21 112 3 3 6 Source Address Address Delimiter Asignment Command Destination Address Address Delimiter 10015 1 Note that an assignment command does not destroy the data at the source location rather it just makes a copy of the source data at the destination location When the assignment is executed both source and destination will contain the same data There are two ways to use a data transfer command with the 1775 KA module as a single command within a PLC 3 message instruction as one of multiple commands within a message procedure Figure 3 3 illustrates both of these methods for the same assignment command Note that a message instruction in the PLC 3 ladder diagram program controls execution of the command in either case Chapter 3 Data Highway Communication Figure 3 3 Two Ways to Use 1775 KA Commands 1 as a single command 2 as part of a message procedure in a PLC 3 message instruction Message Procedure PROC A STAT MSG EN other commands 12 10012 MESSAGE TYPE 1 STAT L FB200 0000 200 iis CHANNEL E2 5 1 oN B45 21 112 33 B45 21 112 33 STAT other commands PLC 3 Message Instruction to Control E
161. received by a station This layer is not visible to the person placing Data Highway commands in a program physical link sets up maintains and disconnects a physical link between two stations This layer consists largely of hardware Data Highway modules and cable Like the data link layer this layer is not visible to the person placing Data Highway commands in a program A Data Highway command consists of many fields each of which originates from one of the above layers at the sending station When a station receives a Data Highway command it separates these fields so that a single layer uses only those fields it needs to perform its specific function The application layer uses these fields of a Data Highway command a command CMD field and function FNC field identify the type of command that is sent status field STS contains a code that indicates if the command was successfully sent from one station to another address ADDR field specifies the address in the remote station s memory a data DATA field contains the data that is sent from one station to the other These bytes and fields are discussed in greater detail later For now notice Figure 9 1 that the FNC ADDR and DATA fields from the application layer are treated as data by the network layer We say that the data is framed by the fields of the network layer Chapter 9 Computer to PC Communication
162. rom the backup processor switchover has not yet occurred 2 31 Chapter 2 Installation 2 32 Example o a Rung that Sends a Message during switchover from primary PLC 3 to backup E0000 MSG STAT MESSAGE TYPE 1 00 CTL FB200 00001 0 12 CHANNEL E2 5 STAT 045 4 17 B3 5 a STAT ER 13 E0000 50003 E0000 01 17 00 E0000 E0000 00 01 0003 E0000 99 HY 17 NOTE Bits E0000 00 and E0000 01 are internal storage bits You can use any unused data 01 table section to reference these bits Bit S0003 17 is the run backup bit Using Automatic Switchover After you select the BACKUP OPERATION for a rev D or later 1775 module you may want to use automatic switchover for your PLC 3 backup system During automatic switchover the 1775 KA module for the primary PLC 3 processor disables its Data Highway port the 1775 K A module for the backup 3 processor becomes the address that you selected with the LIST function rather than the corresponding address it received during the BACKUP OPERATION NOTE You cannot select the BACKUP OPERATION for a multidrop modem applications because the modem port will not become disabled after a PLC 3 processor fault regardless of the switch settings on the module Multiple 1775 Modules PLC 3 Chapter 2 Installation If an automatic switchover occurs the PLC 3 processor is waiting for a the response is ignored r
163. ry Use the SIZE field to specify the number of bytes to be read To specify a number of PC words SIZE should be an even value because PC words are two bytes long Command Format Ee ce 01 Reply Format 41 Unprotected Write Use this command to write words of data into any area of PC data table memory Command Format 0 8 X Reply Format 01 12 PLC 3 Commands DLE STX SRC CMD sTS TNS FNC ASCII sumbol OF 02 8 characters max Appendix A Message Formats PLC 3 stations can receive any of the commands in the basic command set and execute them within a specified file in the PLC 3 memory They can also execute the following commands which apply only to PLC 3 controllers bit write word range read Word range write file read file write Only a computer can send privileged commands Their primary use is for uploading and downloading PLC 3 memory Only a computer or another PLC 3 station can initiate the non privileged PLC 3 commands listed above Their primary use is for transferring data between two PLC 3 files Those files may be located in the same PLC 3 processor or in two different PLC 3 s Bit Write Use this bit write command to modify the bits at the address specified by either a word symbol a file symbol plus a word offset or a logical address This write command can write a block of data This address must point to a word within a file The f
164. s For example if the master station wanted to send the data codes 8 9 6 0 2 4 and 3 to slave station 20 hex 40 octal the master message codes would be in hex 10 01 20 1001 08 09 06 0002 04 03 10 03 ps DLE SOH STN DLE STX Data DLE ETX BCC The sum of the STN and data bytes in this message packet is 40 hex The BCC is the 2 s complement of this sum or CO hex This is shown in the following binary calculation 0100 0000 40 hex 1011 1011 1 complement 1 1010 0000 2s complement EO hex To transmit the STN or data value 10 hex you must use the data code DLE DLE However only one of these DLE text characters is included in the BCC sum For example to transmit the values 8 9 6 0 10 4 and 3 hex a slave station would use the following message codes Represents single text value of 10 10 02 08 09 06 00 10 10 04 10 03 D2 pu DLE STX Data DLE ETX BCC In this case the sum of the data bytes is 2E hex because only one DLE text code is included in the BCC So the BCC is D2 hex Protocol Environment Definition Chapter 11 Half Duplex Protocol Each station on the multidrop link must contain a software routine known as a transceiver that can both transmit and receive message packets The 1775 module already contains a slave transceiver routine so it will function as a slave station if you select Polled Subscriber Mode with LIST chapter 2 To establish master station you have to program a tran
165. s Whenever you power up the processor the module will receive power also 24 Chapter 2 Installation Indicators There are three sets of LED indicators on the front of the 1775 module Figure 2 1 The first group labeled SELF TEST indicates the result of internal diagnostic tests that the module continuously performs on its own hardware and firmware The second group labeled MODEM INTERFACE indicates the status of communication through the module s RS 232 C port The last group labeled DATA HWY indicates the status of communication through the module s Data Highway port Table 2 B tells what each indicator means Table 2 B LED Indicators Indicator Indicator Normal Group Label State Meaning When ON Self Test Module has passed its own internal diagnostic test Module has failed its own internal diagnostic tests Modem Module is transmitting a message over the modem interface port Interface Module is receiving a message over the modem interface port User programming error Module is disabled due to a fault in the PLC 3 processor or modem interface port is disabled through the LIST function Data OFF Module is transmitting a message over the Data Highway port Highway OFF Module is receiving a message over the Data Highway port ON or It Module is ready to transmit a message over the Data Highway port and is OFF waiting to acquire mastership of the highway OFF User programming error or communication error on
166. s GETBUF Try to Get No 10095 1 D 21 Appendix D Detailed Flowcharts Figure D 26 GETCODE Subroutine GETRAW Get Byte From UART BCC No Add Data Byte to BCC Yes GETRAW Return Byte and Data Flag Get Byte From UART Save ACK or NAK in RESP Output WAKEUP e BYTE What Was Received Resume XMIT e Control Data Flag Set if BYTE is if Sleeping a control character which was at WTRESP preceded by a DLE NOTE CRC Should Now Equal Zero Return Byte BEG _ and Control Flag Include ETX GETRAW Get Low Byte of BCC BCC i Include in Check BCC Y Include in Check GETRAW m Return EXT and Control Flag 10096 1 D 22 Figure 0 27 GETRAW Subroutine G ETRAW Es Disable Processor Interrupts Set Receiver Error Flag Discard Bad Data Reset UART Error Flag 1 Enable UART Receive Interrupt Byte in UART Appendix D Detailed Flowcharts SLEEP Wait For RXD Interrupt at RXDWAIT Disable UART Received Interrupt Check Parity Framing and No Get Byte From UART Enable Processor Interrupts i RETURN NOTE This figure assumes the use
167. s RS 232 C port in the unpolled mode while the last application uses the polled mode You can select the mode of operation and other characteristics of the RS 232 C port through the LIST function 2 10 Chapter 2 Installation Each mode of operation requires a different communication protocol The unpolled mode uses full duplex protocol chapter 10 while the polled mode uses half duplex protocol chapter 11 In general full duplex protocol gives faster data throughput but is more difficult to implement half duplex protocol is easier to implement but gives slow data throughput NOTE In other Data Highway documentation full duplex protocol might be referred to as DFI protocol and half duplex protocol might be referred to as polled mode protocol Hardware Interface The modem interface is based on EIA RS 232 C and related standards This interface should be compatible with most dedicated and dial up network RS 232 modems Mechanical The RS 232 connector on the 1775 K A module is a 25 pin male connector Electrical Input and output levels the RS 232 connector conform to the RS 232 C standard The transmitter has increased capability to drive a 7 000 foot isolated lines This number depends on baud rate and refers to only direct wire connections Refer to Table 2 C 2 11 Chapter 2 Installation 2 12 Table 2 C Distance Rate Variations Distance Maximum in feet Baud Rate 1 000 2 000
168. s as a decimal value enclose the word address within parentheses and eliminate leading zeros In addressing individual bits parentheses have no affect on the address interpretation The bit address bit is interpreted as an octal number if it starts with a leading zero and as a decimal number if it does not start with a Zero Figure 4 1 illustrates these addressing conventions Figure 4 1 Examples of Addressing Conventions Address Specification Interpretation expressed in decimal 12 15 Input file 12 word 13 112 15 15 Input file 12 word 13 bit 15 112 015 015 Input file 12 word 13 bit 13 112 15 Input file 12 word 15 112 015 Input file 12 word 13 N43 15 Integer file 43 word 13 N043 15 Integer file 43 word 13 N 043 15 Integer file 35 word 13 N 43 15 Integer file 43 word 13 10017 1 Chapter 4 Addressing Rules and Examples Addresses Data is referenced by its address in memory In a message procedure you must precede an address with a dollar sign The dollar sign acts as a delimiter to tell the 1775 module that it has encountered a data address Figure 4 2 illustrates this addressing format in a simple assignment command Figure 4 2 Example Assignment Command Showing Addressing Format V Destination Source Address Address Assignment Command 10018 1 For data locations at remote stations the remote station number must precede the data address Figure 4 3 illustrates this addressing format For comm
169. s at CI RETURN duced anie 10087 1 D 15 pendix D Detailed Flowcharts D 16 SLEEP Figure D 18 TRANSMIT INTERRUPT Subroutine TRANSMIT INTERRUPT WAKEUP Resume Process Sleeping At TXWAIT INTERRUPT RETURN Figure D 19 SLEEP and WAKEUP Subroutines Routine to Suspend Process at a Until Another Higeess An pimplement tion Dep Sleep Variable B Wakes RETURN Input The Address of a Sleep Variable Sleep Variables e Typically an address of a stack or a process or context save area AProcess can suspend itself and place its address in a sleep variable e Subsequently another process can wake up the sleeping process by referring to sleep variable When no process is sleeping at a sleep variable a WAKEUP has no effect NOTE This figure assumes the use of 780 10 NOTE UART transmit interrupt must be enabled and disabled without affecting the current state of the status interrup nable ags 10088 1 VE _ WAKEUP An Implementation Dependent outine to Wake Up the Process at a Sleep Variable if Any is Sleeping There RETURN Input The Address of a Sleep Variable 10089 1 PROCESS SLEEP Appendix D Detailed Flowcharts Figure D 20 SLEEP and WAKEUP Interaction PROCESS B PROCESS C A Previous Wakeup 7 4 Later 5
170. s notified via the operating system when a message arrives on the queue Messages do not necessarily have to be removed from the queue in order of arrival 12 2 Chapter 12 Network and Application Layer Protocols Network Packet Fields As we discussed the communication protocol used on the data link we described control characters framing the network packet Here at the network level you must generate the network packet In this protocol the network packet characters are generated directly from binary coded bytes of data This provides faster throughput on the link than if this data were coded into ASCII characters Figure 12 2 shows the general format of the network packet for a command message Figure 12 3 shows the general format of the network packet for a reply message Note that bytes are shown from left to right in the order in which they are transmitted on the link Note that the only difference between the network packet for a command message and the network packet for a reply message is in the high nibble of the CMD byte Figure 12 2 Command Message Packet Format From CMD STS FNC ADDR DATA Application x Layer DST SRC CMD 0 Network Data TNS From Application Layer Layer Yen Packet STS 10063 1 12 3 Chapter 12 Network and Application Layer Protocols 12 4 Figure 12 3 Reply Message Packet Format
171. same as the reply packet format for all reads A Format when the command was successfully executed E DATA Max of 244 bytes or 122 words B Format when reporting an error 4 STS Where the extended status byte is optional A 18 Message Formats File Write Use this write command with either a file symbol or a block address as a starting address This starting address points to a file of words This write command can write a block of data You must read the entire file The file size must equal the exact size of the file or an error will be returned The function code is 3 Command Packet Format A File symbol address DLE STX DST SRC CMD STS TNS FNC PACKET TOTAL OF 03 OFFSET TRANS ASCII symbol DATA Max of 244 bytes or 114 words 8 characters max B Logical address DLE STX DST CMD srs TNS FNC PACKET TOTAL OF 03 OFFSET TRANS X _ Ini DATA Max length is 239 bytes minus length of the PLC 3 logical address DLE ETX BCC 2 51 bytes must be an even number of bytes Reply Format This is the same as the reply packet format for all writes A Format when the command was successfully executed Ier re B Format when reporting an error DLE STX DST SRC CMD TNS ETX DLE ETX BCC 4 STS A 19 Appendix A Message Formats Where the extended status byte is optional Privileged C
172. sceiver routine at a computer In addition to transmitting and receiving message packets the master transceiver must also be able to transmit polling packets Note that you can program separate transmitter and receiver routines instead of a single transceiver For purposes of the discussion here however we assume that the transceiver is a single software routine Figure 11 2 illustrates the operation of master and slave transceivers To fully define the protocol environment you must tell the master transceiver where to get the messages it sends and how to dispose of messages it receives These are implementation dependent functions that we call the message source and the message sink respectively We assume that the message source supplies one network packet at a time upon request from the transceiver and that the source has to be notified about the success or failure of transfer before supplying the next Whenever the transceiver has received a link packet successfully it attempts to give the network packet portion to the message sink The message sink may be full The message sink must notify the transceiver when it is full Chapter 11 Half Duplex Protocol Figure 11 2 Slave Transceiver Network Network Packet Packet MASTER SLAVE TRANSMITTER RECEIVER SOURCE OK Network Packet SINK Full SOURCE OK Network SINK Packet Full To Other Slaves lt Softwar Hardware 10052 1 M
173. shaded in grey application layer fields are not shaded Building a Line Monitor This appendix presents the formats for each of the Data Highway commands that the 1775 module can send and or receive You can build a line monitor that allows you to see these commands as they are sent or received by the 1775 KA module This can be useful during installation or when you are troubleshooting By viewing these commands on a line monitor you can verify the types of messages the 1775 is sending or receiving and the data that is contained in the messages We do not recommend building a line monitor for Data Highway communication Messages on the Data Highway use a different protocol But you can monitor communication to the RS 232 C link To do this you must create a cable like the one shown in Figure A 1 This cable links the 1775 K A module an RS 232 C device and 1770 T4 Industrial Terminal Figure A 2 The cable you build connects the receiving data transmit data and ground in the RS 232 C link to the receive data and ground of the Industrial Terminal A switch on the cable allows you to choose the monitor either messages received or messages sent by the 1775 KA module Message Formats Figure A 1 Cabling for a RS 232 C Line Monitor 25 Pin Male 25 Pin Male 25 Pin Female RS 232 C Co
174. sion the response is DLE ACK Figure 11 5 Message Transfer with Invalid BCC SOURCE SOURCE SINK MASTER LINK SLAVE SINK DLE SOH STN DLE STX DLE ETX BCC Timeout DLE SOH STN DLE STX xxxx DLE ETX BCC Not Full gt lt DLE ACK OK 1005 1 11 14 Chapter 11 Half Duplex Protocol Figure 11 6 shows a message transfer in which the acknowledgment was destroyed by noise After a timeout the message is retransmitted and the DLE ACK response is detected Figure 11 6 Message Transfer with ACK Destroyed SOURCE SOURCE SINK MASTER LINK SLAVE SINK DLE SOH STN DLE STX xxxx DLE Not Full gt DL CK Timeout DLE SOH STN DLE STX xxxx DLE ETX BCC m DLE ACK OK 10056 1 Figure 11 7 shows a slave being polled and responding with DLE EOT because it has no messages to transfer Figure 11 7 Poll with No Message Available SOURCE SOURCE SINK MASTER LINK SLAVE SINK Not Full gt DLE ENQSTN gt Message DLE EOT 10057 1 11 15 Chapter 11 Half Duplex Protocol Figure 11 8 shows a slave being polled and answering with a message Because a block check error is found the master does not acknowledge instead it sends the poll to the slave again Since the slave did not receive an ackn
175. source in an assignment command before it is defined as a symbol For example a statement of the form A A 6 will give this error if user symbol A has not appeared previously 123 local System symbol must be a symbolic address This B 7 Remote Error Codes Received from the 1773 Module Error Error Code Type 142 143 144 145 146 147 125 126 127 129 140 B 8 local local local local local local local local local local local local error will occur if a procedure name is used in place of a symbolic address in an assignment statement or if the system symbol referenced in an assignment doesn exist Illegal destination in an assignment command This does not necessarily mean that an assignment command was desired because any command line that doesn t look like anything else is assumed to be an assignment command Lines that will generate this error include 5 4 1 6ASDFGHJ Whereas the line WERTYUI will generate an error 140 unrecognized command Illegal modifier for the CREATE command That is the command was CREATEJ and the was other than LOCAL GLOBAL or a legal abbreviation of one of these The CREATE command was specified but the symbol did not begin with an missing in CREATE system symbol address Attempt to delete nonexistent symbol Unrecognized or ambiguous command cf error 124 Illegal data following GOTO c
176. ssage procedure simply enter the delimiter followed by the procedure s name For example the statement FIRST_PROC causes execution of the procedure named FIRST_PROC Procedure names may be used anywhere that command can be used In this way one procedure can execute call another procedure This allows for nesting of procedures However procedures may not be nested more than 3 layers deep The EXIT command terminates execution of the current message procedure If the current procedure was called executed by another procedure the EXIT command returns control to the calling procedure Control returns to the line following the execute statement GOTO Command IF Command Chapter 6 Message Procedure Commands The format of the EXIT command is simply the single letter E Without any modifiers or parameters Each main procedure and nested procedure must end with either an EXIT command or a STOP command The EXIT command is the preferred means of ending a procedure because the STOP command results in error 179 Appendix B The commands in a message procedure are normally executed sequentially The GOTO command can change the order of execution Table 6 A illustrates the format of the GOTO command Note that the parameter fora GOTO command is a label Labels are signposts or tags that mark a location within the message procedure To generate a label simply enter it on any one of the lines in a message procedure The
177. st end with either an EXIT or a STOP command The EXIT command is normally preferred because the STOP command is a more extreme measure that results in error 179 Appendix B General Message Procedure Commands The 1775 module has its own command language that you can use in programming message procedures This chapter describes the available commands and gives some examples on how to use them Table 6 A summarizes the commands Table 6 A Message Procedure Commands Command Format and Explanation lt destination gt 3 lt source gt assignment Assign a numeric value to a user symbol or copy data from the source to the destination CREATE C lt system symbol gt lt logical address gt Create a symbolic address and equate it to a logical address DELETE D lt system symbol gt Delete a symbolic address or an entire message procedure from PLC 3 memory execute lt system symbol gt Execute the named message procedure EXIT E Terminate execution of the current message procedure G lt label gt Continue executing the current procedure from the point specified by the label expression embedded command Execute the embedded command only if the specified expression is true ON ERROR embedded command 3 Execute the embedded command only if an error occurs after this statement in the procedure STOP S Terminate execution of the message MSG instruction in the PLC 3 ladder diagram program
178. st word of destination location does not exist 237 reply For all PLC 3 read and write commands 1 Any word in the total transaction does not exist in the destination file 2 The source and destination files are not the same size 238 reply For all PLC 3 read and write commands The file size decreased between packets of a multi packet transaction and became too small for the total transaction 239 reply For all PLC 3 read and write commands File is larger than 65 535 words 240 reply For all PLC 3 read and write commands Sum of total transaction size and the word 241 reply For all PLC 3 write commands Remote station does not have access to the destination file B 13 Remote Error Codes Received from the 1773 KA Module Remote Error codes received from the 1771 KE KF 1771 KG 1771 KA and 1774 KA Modules B 14 If the remote station has a 1771 1771 or 1774 K A module the remote error codes will have the meanings listed in the table below 81 This error is sent from the remote station if the command message was incorrect This includes the command code subcommand code and size of the command or the requested reply size This error results in the setting of the remote error bit for the associated rung Some condition exists at the remote PC that requires manual intervention The cable between the module and the PC is unplugged
179. stic status command Series and revision number of the 1775 KA module Bits 0 to 4 0 Revision A 1 Revision B etc Bits 5 to 7 0 Series A 1 Series B etc The physical address of the unused word of PLC 3 system memory This is the physical address corresponding to the logical address E60 0 0 0 The total number of words in PLC 3 system memory both used and unused This is the physical word address corresponding to the logical address E63 0 0 0 Set ENQs Use this command to set the maximum number of that the station interface module will issue per message transmission Put the number in the DATA field The default setting for the KE KF module is 10 ENQs per transmission Command Format 06 06 Reply Format 46 Message Formats Set NAKs Use this command to set the maximum number of NAKs that the station interface module will accept per message transmission Put the number in the DATA field The default setting for the KE KF module is 3 NAKs per transmission Command Format 06 05 Reply Format 5075 5 46 Set Timeout Use this command to set the maximum amount of time that the station interface module will wait for an acknowledgment to its message transmission The setting is expressed as the number of cycles of an internal clock where 40 cycles equals 1 second Put the number of desired cycles in the DATA field The default setti
180. system symbol TOTAL to represent the logical address E0 0 0 7 Note that this CREATE command for generating symbolic addresses should not be confused with the CREATE command for allocating file space in PLC 3 programming Chapter 4 The DELETE command serves three main purposes Deleting message procedures from PLC 3 memory Deleting symbolic addresses Deleting interprocedural user symbols 6 5 Chapter 6 Message Procedure Commands Execute EXIT Command 6 6 Using the DELETE command on a procedure name not only deletes the name but also erases the named procedure from PLC 3 memory Using DELETE on a symbolic address or interprocedural user symbol merely deletes the symbol but the data stored under that symbol remains intact Table 6 A shows the general format of the DELETE command To delete a symbol or a procedure from the current context use the DELETE command by itself the modifier LOCAL is optional To delete a symbol or a procedure from all contexts use the modifier GLOBAL after the DELETE command The modifier GLOBAL can be abbreviated to G and LOCAL can be abbreviated to L For example the statement D G PARTS_PGM deletes the procedure PARTS_PGM from all contexts in PLC 3 memory Note that the LOCAL modifier can be used on global system symbols In such cases the procedure or the symbol is deleted from the current context but can still be used in the other contexts To execute a me
181. t in the B 6 Remote Error Codes Received from the 1773 Module Error Error Code Type destination PLC 3 file 3 The length of the destination file is greater than 65 535 words reply PLC PLC 2 bit write commands Keyswitch setting at local PLC 3 processor prohibits access For PLC PLC 2 word write commands Local keyswitch setting prohibits writing into desired destination file 4 For all 3 write commands Keyswitch setting disallows access to file 87 reply For all PLC PLC 2 read and write commands The local PLC 3 processor is in program mode There may or may not be a major system fault For all PLC 3 read and write commands The local PLC 3 processor is in program mode There may or may not be a major system fault 91 Local Handshaking lines on the RS 232 C link are not connected properly 92 local The remote station specified does not acknowledge ACK the message 94 local Local port is disabled through LIST 112 local 1 Undefined assignment operator in an assignment statement 2 Undefined operator in an expression 114 115 117 local Illegal expression syntax local Illegal unary prefix operator in an expression local Undefined data following a valid address in a CREATE command or undefined data following a valid symbol in a DELETE command 121 local Symbol undefined This will occur if a symbol appears as the
182. tation This command causes the 1775 module to revoke the upload and download privileges for the source computer station and to initialize a PLC 3 restart The function code for this command is Command Format OF 0 Reply Format A Format when the command was successfully executed 4 B Format when reporting an error DLE STX DST SRC CMD STS TNS ETX DLE ETX BCC 4F STS Where the extended status byte is optional 24 Message Formats Diagnostic Counters Reset Use this command to reset to zero all the diagnostic timers and counters in the station interface module The diagnostic status command gives the starting address for this block of counters and timers Command Format 06 07 Reply Format 46 Diagnostic Loop You can use this command to check the integrity of transmissions over the communication link The command message transmits up to 243 bytes of data to a station interface module The receiving module should reply to this command by transmitting the same data back to the originating station Command Format 06 00 Reply Format 46 A 25 Appendix A Message Formats Diagnostic Read You use this command to read up to 244 bytes of data from the PROM or RAM of the station interface module You can use it to read the module s diagnostic timers and counters Use the diagnostic status command to obt
183. tation number it adds the value of that station number to its accumulated BCC If the next characters after the station number are DLE STX then the slave transceiver starts storing the incoming link layer data in a buffer The transceiver stores all data codes in the buffer and adds these code values to the accumulated BCC Even if the storage buffer overflows the transceiver continues summing the BCC while discarding the data The slave also sets an error flag to indicate the occurrence of a parity buffer overrun message framing or MODEM handshaking error When the slave gets a DLE ETX BCC it checks this error flag the BCC and the message size If any of these tests fail the slave ignores the message If the current message packet passes the above tests the slave next begins the duplicate message detection process In this process the slave 11 11 Chapter 11 Half Duplex Protocol 11 12 compares the SRC CMD and both TNS bytes with the corresponding bytes of the previous message received If these bytes are the same the slave discards the current message and sends a DLE ACK If the current message differs from the previous one the slave next tests the state of the message sink If the message sink is full the transceiver discards the current message and does not respond Otherwise the transceiver Forwards the current link level data to the message sink Keeps copy of the first six bytes of the current lin
184. ter to PC Communication Introduction to Layered Communication Full Duplex vs Half Duplex Protocol for the Data Link Layer Full Duplex General s cue eee ce ee ee KENE Ruine Pa Definition of Link and Full Duplex Protocol Half Duplex Half Duplex Protocol Multidrop Link Transmission Link Layer Packets Protocol Environment Half Duplex Protocol Diagrams Line Monitoring Table of Contents iii The Network and Application Layer Protocol 12 1 Network 12 1 Application Layer 12 6 Message Formats 1 Introduction _ 1 Basic Command _ 8 PLC 3 Commands 13 Privileged Commands A 20 ici oues Rd edam dux E dare aa Re B 1 General cic oe
185. the address fields can be specified in one byte each then you can code the values directly If it takes two bytes to specify an address field then you must use a delimiter byte of value FF hex before each 2 byte field Any 2 byte fields should be coded low byte first In Figure 12 5 the first byte contains the bit flags to indicate which addressing levels are specified In this example only levels 3 4 and 6 are specified default values are used for the other levels This format reduces the total number of bytes needed to specify a PLC 3 logical address in a command message In Figure 12 5 the level 4 address is 260 decimal which is too large to fit in one byte Therefore a byte of all 1 is used to delimit the 2 byte address field for this level The value 260 is then coded low byte first Note that the last level level 6 in this case must be specified in the address field even though it is equal to the default value of zero Chapter 12 Network and Application Layer Protocols Figure 12 5 Example of PLC 3 Logical Addressing Format PLC 3 Extended Address E3 1 2 260 0 0 Data Table Area Level 1 Context Level 2 Section Level 3 File Level 4 Offset Level 5 Word Level 6 Logical Addressing Format Flag bit for level Al dmm Level 1 Default 3 for date table Byte 1 0220 Level 2 Default 1 for current conte
186. tions The second configuration provides system backup for the PLC 3 controller If the 1775 K A modules are Rev C or earlier you 1 Assign different station addresses to each communication adapter module 2 Ifthe programs in the primary and backup processors are identical you must be sure that all information sent to the primary processor is also sent to the backup processor you must examine the run backup bit data table status section file 0 word 3 bit 17 on every rung used to transmit data This bit is set in the primary processor and reset in the backup processor Examining it helps to prevent sending duplicate messages over the Data Highway If the 1775 K A modules are Rev D or later you can follow the two steps described above select BACKUP OPERATION with the PLC 3 LIST function To implement backup operation follow these steps 1 Using the option switches on both 1775 K A modules set switch 2 to the OPEN position Recall section titled Option Switches that this causes the module to disable its Data Highway port if the PLC 3 becomes deactivated WARNING If you do not set these switches OPEN on both 1775 modules these modules will assume the same station address when the primary PLC 3 becomes deactive This may shut down communication on the Data Highway and unexpected machine motion may result 2 28 Chapter 2 Installation 2 Use the LIST function to disable the m
187. tly because ETX BCC are indivisible 10 22 Chapter 10 Full Duplex Protocol Embedded Response Option To simplify the design of the receiver in some cases you can disable transmission of embedded responses by turning off the embedded response switch If you turn this switch off the 1775 module s multiplexer cannot embed response codes while sending a message Instead it delays sending response codes until after it sends the next DLE ETX BCC sequence 10 23 Half Duplex Protocol Multidrop Link Half Duplex Protocol Half duplex protocol serves as an alternate to full duplex protocol Half duplex is synonymous with polled subscriber mode To select the half duplex mode you select the polled subscriber mode with LIST chapter 2 Half duplex protocol differs from the full duplex mode in two ways Half duplex protocol provides for polling of slave stations Half duplex protocol does not allow embedded responses Half duplex protocol is for one master and one or more slaves You must use MODEMS for this type of link unless there is only one slave The 1775 module has slave mode capability only you must provide the master function through a computer For peer to peer communication half duplex protocol provides a less effective use of resources than full duplex but it is easier to implement You should use half duplex protocol if You are using multidrop baseband MODEMS to conn
188. ts the message A station that transmits a command message is called a command station and a station that transmits a reply message is called a reply station You can send either single message procedure command Chapter 6 that may be up to 76 characters long the name of a Data Highway message procedure which contains group of commands and is stored in the 1775 K A module You specify the station that will receive the command with a PLC 3 extended address This address always takes the form E2 5 nn where E2 specifies that this command addresses the module status area of PLC 3 memory 5 specifies that you are sending the message instruction through the 1775 module nn is replaced with the thumbwheel setting on your particular 1775 Ka module Chapter 3 Data Highway Communication To enter a message instruction complete the steps below 1 Enter a condition that when true will activate the message instruction In Figure 3 1 we used an examine on for input word 00128 bit 01 Figure 3 1 Levels of Programming in Data Highway Communication 1 PLC 3 Processor 2 1775 KA Module Ladder Diagram Program Data Highway Message Procedure PROC STAT MSG EN 12 MESE BN 2 01 CHANNEL E2 5 1 024 1 2 37 15 PROC A STAT ER 13 Message procedure command to transmit a message to data highway station number 24 Message instruction to execute message proc
189. u have selected enough options to define a single parameter in full detail Figure 2 11 illustrates the menu structure of LIST return to the preceding next highest level of LIST press the ENTER key without making a new entry 2 19 Chapter 2 Installation Figure 2 11 LIST Menu for 1775 KA Module System Mode 1 Test Monitor 2 Run Monitor 3 Program Load 4 Remote Enable 5 System Status 6 Module Status Enter Next Modules 01 1775 A A 1775 ME8 1775 L3 1775 S4A B A 1775 KA A E 1775 LX A A 1775 LX A A 1775 84B B A 1775 84B B A NTER NEXT Data Hwy Comm Adapter 01 Chassis 0 Slot 0 1 Module Options 2 3 4 5 6 06 7 8 9 E 2 Data Highway Port 01 Data Highway Port 3 Modem Port 4 Enter Next gt KA 01 Module Options 1 Timeout Send Unprotectdd Accept Upload Downlodil Accept Write 2 3 4 5 Backup Operatii 6 PLC 2 ENTER NEXT gt 1 Enable Disable Port 2 Station Number gt KA 01 Module Options 50 10 sec Enter Timeout gt KA 01 Data Highway Port Enable 1 Enable 2 Disable Enter Next gt 3 Baud Rate Enter Next gt KA 01 Modem Port 1 Enable Disable Port gt 2 Station Number 3 Baud Rte 4 4 Communication Mode 5 Even 6 Send Embedded gt El Toggle selection s
190. ully but for which the response code DLE ACK has been lost Until it receives a DLE STX or a DLE ENQ the receiver ignores all input from path 1 except to set the last response variable to NAK With the last response variable set to the receiver responds with DLE to a DLE ENQ input Otherwise the receiver responds to a DLE ENQ input by sending it last response on path 2 and continues waiting for input If the receiver gets a DLE STX it resets its BCC accumulator and data buffer to zero and starts storing the link level data in the data buffer so that it can later pass the link level data to the network layer While the receiver stores all link level data codes in the data buffer it adds the link level data code values to the BCC If the data buffer 10 13 Chapter 10 Full Duplex Protocol 10 14 overflows the receiver continues summing the BCC but it discards the data The receiver also sets an error flag to indicate the occurrence of a parity buffer overrun message framing or modem handshaking error If the receiver receives any control code other than DLE ETX during this time it aborts the message and sends a DLE NAK on path 2 When the receiver gets a DLE ETX BCC it checks the error flag the BCC the message size and the destination station number If any of the tests fail the receiver sends a DLE NAK on path 2 If the current message packet passes the above tests the receiver next begins the duplic
191. unction code is 2 Unlike the unprotected and protected bit writes in the basic command set this command can be used to change the bits in a single word only Command Format A Word symbol address WIF SET RESET DLE ETX BCC 00 Mask Mask 13 Appendix A Message Formats B File symbol address plus word offset DLE STX SRC 575 TNS FNC ASCII sumbol 0F 02 8 characters max WIF SET RESET DLE ETX BCC 01 Mask Mask C Logical address DLE STX SRC CMD srS TNS FNC PLC 3 logical address OF 02 2 51 byte SET DLE ETX BCC Mask Mask Reply Format This the same as the reply packet format for all bit writes A Format when successful execution aco Be a 4F B Format when reporting an error DLE STX DST SRC CMD STS TNS ETX DLE ETX BCC 4F STS TNS Where the extended status byte is optional A 14 Message Formats Word Range Read Use this read command with a word symbol a file symbol plus a word offset or a block address as a starting address This starting address must point to a word file This read command can read a block of data The function code is 1 A special case of this command is the single word read where the number of bytes to read is only two bytes one word Command Format A Word symbol address DLE STX DST SRC CMD Srs TNS FNC PACKET TOTAL OF 01 OFFSET TRANS
192. unication on the Data Highway the characters are required to delimit the remote station number For RS 232 C communication through the 1775 K A module s modem port the characters M delimit the remote station number Figure 4 3 Example of Remote Station Addressing in an Assignment Command 024 B45 21 112 33 Source Address Address Delimiter Assignment Command Destination Address Address Delimiter Remote Station Number octal Data Highway Port Identifier Remote Station Delimiter 10019 1 4 3 4 Addressing Rules and Examples Symbols 4 4 You can also use symbols to represent data and data addresses in message procedures symbol can consist of numeric digits alphabetic characters and the underline character _ No other special characters are allowed The first character in a symbol must be a letter of the alphabet Both upper case and lower case letters are acceptable in a symbol but they are distinguished For example ASYMBOL and Asymbol are two different symbols A symbol can be any length but it must be unique in its first 8 characters For example SYMBOL and SYMBOL are distinguishable in a message procedure but NEW SYMBOL A AND NEW SYMBOL B are not Note that indistinguishable symbols are not flagged as programming errors Rather indistinguishable symbols are treated as equivalents Certain words and character combinations cannot be used as symbols beca
193. up A context switching would be deferred until B itself has executed a SLEEP A third alternative would cause a context switch if a process performed a WAKEUP on a higher priority process If a WAKEUP had been performed on a lower priority process the context switch would be deferred until the first process has gone to sleep The first alternative is the result of implementing the driver totally at the interrupt level where scheduling is dictated by the interrupt daisy chain hardware The third alternative would be used if the driver were implemented as tasks under a multitasking operating system Such an implementation might be easier but would probably be limited to lower communication rates POWERUP At powerup the Z80 processor starts executing code at location 0 The POWERUP subroutine starts at XMIT and RCVE processes by executing a SPAWN A SPAWN is very similar to a WAKEUP except that the corresponding SLEEP is imaginary and is located prior to the first instruction of the spawned process Figure D 21 POWERUP Routine POWERU Be Continu Rain fon 10091 1 D 18 endix D Detailed Flowcharts Figure D 22 Message Queue MESSAGE ROOT CONTROL BLOCKS The Address of a Queue is the FIRST MESSAGE Address of its Root LAST SIZE STATUS NOTE Messages are added to the end of the queue and remove
194. upply a packet and the transmitter is not busy transmitter A sends a link packet on path 1 It then starts a 10 9 Chapter 10 Full Duplex Protocol 10 10 timeout and waits for a response on path 2 You can use the diagnostic set timeout command to set this timeout period for the 1775 K A module The default setting is 3 seconds When transmitter gets a DLE the message transfer is complete After signaling the message source that the message has been sent successfully transmitter A proceeds with the next message If transmitter A gets a DLE NAK it retransmits the same message The transmitter restarts the timeout and waits again for a response By using the diagnostic set NAKs command you can specify how many times the 1775 module will attempt to retransmit a given message The default setting is 3 Once the number of retransmissions exceeds this limit the transmitter should notify the message source that the transmission has failed The transmitter can then proceed with the next message If the timeout expires before transmitter A gets a response it sends a DLE ENQ on path 1 to request a retransmission of the last response sent on path 2 Transmitter A restarts the timeout and waits for a response By using the diagnostic set ENQs command you can specify how many timeout periods the 1775 KA module will allow per message it transmits The default setting is 10 If this ENQ limit is exceeded the transmitter n
195. use they are reserved for special uses in message procedures The reserved words are CREATE IF DELETE ON ERROR ERROR PROT EXIT STOP GOTO UNPRO Any abbreviated form of one of the above words is also invalid as a symbol For example the single letter C should not be used as a symbol because it is an abbreviation of the word CREATE Similarly PRO is an invalid symbol Figure 4 4 illustrates the classification of different types of symbols The two major classifications are system symbols user symbols Chapter 4 Addressing Rules and Examples Figure 4 4 Symbol Types System Symbol Generate this symbol with the Edit command for a procedure name or a Create command for a symbolic address User Symbol Generate this symbolic Symbol value through the assignment command Interprocedural Procedural Procedure Name Symbolic Address Applies to the procedure Applies only to the Applies to a single Can be used anywhere in which it is generated procedure in which it is procedure or other in place of a logical plus any other procedure generated procedures nested address nested together with that together within that procedure procedure Le Global Local Applies to any context Applies only to the context in which the symbol is generated 10021 1 System Symbols A system symbo
196. ves and executes the command packet and sends a single reply message to the command initiator In any case the command executor generates only one reply message for each command it receives If the network layer of the command initiator station cannot deliver a command to another station it generates a reply message with an error code in its own application layer If a reply cannot be delivered the network layer destroys it Chapter 12 Network and Application Layer Protocols Network Model To implement your Data Highway network layer software use a routing subroutine and a queue Messages created by the application are sent to the router for transmission over the network Messages that are delivered by the network are placed on an incoming message queue that is unique for each application Figure 12 1 illustrates this model Figure 12 1 Application Model Command Command Initiator Executor Replies Commands Routing Subroutine Entry Incoming Message Queue 10062 1 Reply messages are not necessarily sent in the same order that their corresponding command messages were received It is impossible for the network to guarantee delivery and in some cases it may not be possible to provide notification of non delivery Therefore the command initiator should maintain a timer for each outstanding command message Non deliverable reply messages are not returned to the command executor The application task i
197. xecution of Procedure PROC STAT MSG EN 10012 1 1 BW200 0000 200 __ pn 01 CHANNEL E2 5 01 15 PROC A STAT ER 13 10016 1 3 7 Chapter 3 Data Highway Communication 3 8 Access privileges Not every Data Highway station can read or write to every other station In general read and write access privileges depend on two factors type of processor at the transmitting and receiving stations protections set at the receiving station The rest of this section explains how these access privileges vary according to the above factors PLC 3 Stations A PLC 3 station can always read data from any major area of another PLC 3 s memory However one PLC 3 station can write only to the data table area of another PLC 3 station In addition a local PLC 3 station can prevent remote PLC 3 stations from writing to the local station s data table by setting a memory protection switch At the local station the memory protect switch can be overridden by selecting option 4 in the Module Options Menu section titled Accept Writes chapter 2 at the local station PLC PLC 2 Stations For communication with a PLC or a PLC 2 station read and write access privileges depend on switch settings at that station For an explanation of how to set the switches for read and write access refer to the Communication Adapter Module User s Manu
198. xt Byte 2 1 0 Level 3 Value 2 Level 4 Default 0 Byte 3 11111111 1 1 Byte 4 Level 4 Value 260 Byte 5 Level 5 Default 1 6 010000000 6 Value 0 Byte 1 is the flag byte In this case it indicates that the addresses for levels 3 4 and 6 are specified in the bytes that follow Default values are used for the levels 1 2 and 5 Byte 2 is the value of the level 3 address Byte 3 is a delimeter that says the next two bytes are one address Byte 4 is the low byte of the level 4 address Byte 5 is the high byte of the level 4 address Note that bytes 4 and 5 together give a value of 260 for the level 4 address Byte 6 is the value of the level 6 address Even though it is the default value it must be specified because itis the last level in the desired extended address 10066 1 12 13 Chapter 12 Network and Application Layer Protocols 12 14 The symbolic addressing format applies to PLC 3 type commands Table 12 A appendix A transmitted to the 1775 K A module You can use this addressing format whenever you have defined a system symbol to represent a symbolic address at the PLC 3 station that is to receive the command message Figure 12 6 shows this format for PLC 3 symbolic addresses Always enter zeros for the first and last bytes of the symbolic address field Between these zero delimiter
199. y 7A 1111010 2 7B 1111011 7C 1111100 7D 1111101 Y 7E 1111110 1111111 DEL 1 Will be display when Control Code Display option is set on 8 Type G to select auto linefeed off 9 Type I to select control code display 10 Press ENTER to put these selections into effect Now as you send a command from the 1775 KA or the RS 232 C device ASCII characters will appear on the industrial terminal Use Table to find the command bytes DLE etc that these characters represent You may not care what the actual numeric value is for control characters such as DLE STX on the other hand you will probably want to know the numeric value of DATA sent with a command Figure A 3 shows an example of a command as it might appear on the line monitor and how it is translated 7 Appendix A Message Formats Figure A 3 Typical monitor display and how it is interpreted Monitoring a diagnosticc status command and reply acknowledgement Line monitor displays D S B N A N E D E gt D A L X S U K U X L X L K DLE STX DST SRC CMD STS TNS DLE ETX BCC DLE ACK Examining the ASCII table shows that for the above message CMD 6 STS 0 FNC 3 10070 1 Basic Command Set The basic command set includes those commands that can generally be A 8 executed by any PC station on the communication link regardless of the type o
200. y the phone network Note that this handshaking is necessary to guarantee access to the phone line If this handshaking protocol is defeated by improper selection of modem options or jumpers at the connectors the modem may answer a call but if the connection is lost the modem will not hangup It will be impossible for the remote station to reestablish the connection because it will get a busy signal Character Transmission Data is sent serially over the RS 232 interface one eight bit byte at a time The transmission format conforms to ANSI X3 16 CCITT V 4 and ISO 1177 with the exception that the parity bit is retained while extending the data length to eight bits Programmable Configuration Parameters Chapter 2 Installation The transmission format may be summarized as follows start bit data bit 0 data bit 1 data bit 2 data bit 3 data bit 4 data bit 5 data bit 6 data bit 7 even parity bit optional one stop bit The 1775 module selects baud and parity through the LIST function section titled Programmable Configuration Parameters A number of installation parameters for 1775 K A module can be programmed through the PLC 3 LIST function The LIST function words by presenting you with a series of lists or menus that allows you to select and establish the module s operating parameters Each option in an upper level menu represents a submenu of more detailed options This process continues until yo
201. you can send either protected or unprotected commands Switches 2 and 3 on the second row of switches at the 1773 K A module specify whether the PLC 4 station will accept unprotected and protected commands respectively through the Data Highway port of the 1773 KA module Switches 1 and 3 on the third row of switches at the 1773 Ka module specify whether the PLC 4 station will accept protected and unprotected commands respectively through the RS 232 C port of the 1773 module In all cases if the switch is set to the closed position the module will accept that type of command 3 11 General Chapter Addressing Rules and Examples This chapter presents some general rules for specifying data addresses in message procedures This chapter assumes that you are already familiar with the forms and meanings of addresses in the PLC 3 and other Allen Bradley programmable controllers For details on these subjects refer to the appropriate documentation listed in Table 4 A Table 4 A Memory Organization Documentation Controller Document Publication Number Old New No PLC 3 PLC 3 Programming Manual 1775 801 1775 6 4 1 PLC PLC Programming amp Operations Manuals 1774 800 1774 6 8 1 PLC 2 PLC 2 Memory Organization and Structure 1772 907 PLC 2 30 PLC 2 30 Memory Organization 1772 914 1772 4 4 PLC 2 20 Memory Organization of PLC 2 20 Controller 1772 909 1772 4 3 PLC 2 15 PLC 2 15 Memory Organization 1772 912
202. zero for bit 7 See ANSI X3 4 CCITT or ISO 646 for the standard definition of these characters The particular ASCII control characters used are listed below Control Character Hexadecimal Code STX Start of Text ETX End of Text ENQ Enquiry ACK Acknowledge DLE Data Link Escape Chapter 10 Full Duplex Protocol Additionally a block check character BCC is used at the end of each packet for error checking These bytes can be any value from 00 to FF hex In the following paragraphs we use the term code to mean an indivisible sequence of ASCII characters or values having specific meaning to the protocol Indivisible means that the component bytes of a code must be sent one after another with no other bytes between them It does not refer to the timing of the bytes Full duplex protocol uses these codes Control codes DLE STX DLE ETX BCC DLE DLE NAK DLE ENQ Link layer data codes Data single bytes having values 00 0F and10 FF hex DLE DLE to represent the value 10 hex We can also group codes into two classes according to their use 1 Message codes issued from a station sending a message 2 Response codes issued from a station receiving a message The full duplex codes sent by the station transmitting a message are DLE STX indicates the start of a message packet Link layer data 00 OF and10 FF hex encodes the bytes of the network packet
Download Pdf Manuals
Related Search
Related Contents
scarica la scheda tecnica Linux®搭載産業用コンピュータ DC400i Visualiser Samsung T240 Εγχειρίδιο χρήσης accessories - Aquamaster Instruction Manual Copyright © All rights reserved.
Failed to retrieve file