Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
SYSTEM DESCRIPTION SIOX BUS HARDWARE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Design Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Physical Bus Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cable Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Communication Speed vs Transfer Quality . . . . . . . . . . . . . . . . . . . Bus Lengths over 1 000 m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modems and Half Duplex Echo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Typical Module Dimensions and Connectors . . . . . . . . . . . . . . . . . . 2 2 4 5 6 7 7 8 SIOX - A COMMUNICATION PROTOCOL . . . . . . . . . . . . . . . . . . . . . . . . 9 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Master - Slave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Message Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Data Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 String Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 String Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Global Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 String Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 String End . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Inhibit Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 String Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Slave is Busy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Group Address Expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Meta Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Repeated Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Setup Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Enquiry Help Texts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Selective Type Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Bit Modify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Sequential Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Message Types Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 FAULT TRACING IN A SIOX SYSTEM . . . . . . . . . . . . . . . . . . . . . . . . . . Checking the Supply Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . LED Diagnostic System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bus Listeners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Oscilloscope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TELEFRANG AB S:\Allmänt\Man\SIOXsys4_uk.wpd/2005-05-11\TF 23 23 23 25 25 26 SIOX SYSTEM DESCRIPTION p 2 SIOX BUS HARDWARE SIOX - Serial I/O Xchange - is the name of a system of remote I/O modules that communicate through the standard serial port of a computer. Up to 63 modules may be connected in parallel to a two-wire communication line, the SIOX bus. SIOX modules may be regarded as a range of I/O cards for the computer, including analog and digital inputs and outputs, operator interface terminals, card and bar code readers, serial and parallel ports etc. The difference between SIOX modules and traditional I/O cards is that the backplane bus of the computer with its 50-100 strips carrying multiplexed I/O information has been replaced by a two-wire bus. This may, in a typical application, be up to several kilometres long. Design Criteria The SIOX bus is principally intended for use in industrial environments, requiring high noise immunity, ease of installation and robustness. The following features should be noted in this connection: * The two-wire bus can, via a simple adapter, be connected to the RS232 serial port of any computer capable of transmitting and receiving asynchronous characters at moderate speed. * SIOX I/O modules are typically opto-isolated from the bus, permitting each module to be referred to a local ground. Other communication systems without galvanic isolation are very susceptible to electrical noise caused by differential voltages between various grounding points. * Any type of cable may be used for the SIOX bus, including telephone and intercom wires, signal cables, twisted pairs, screened communication lines and power cables. The few limitations relating to maximum wiring resistance and length are explained on page 6-7. * The SIOX bus needs no terminators at the ends of the cable and may be branched off at will. This is due to the moderate communication speed selected, typically permitting a total wire length of 1 000 m including stubs. * The bus supply voltage may vary between 15 V and 35 V to match typical power supplies already available. Equally flexible, the power supplied to the SIOX modules may generally vary between 12 V and 35 V DC and in many cases also 12 V and 25 V AC. Certain modules even run directly off the bus voltage and therefore need only two connecting wires. SIOX SYSTEM DESCRIPTION p 3 * The bus connection of the modules is tolerant to installation errors, since it may be short-circuited or connected to e.g. 24 V DC or AC without any damage. * The two wires are interchangeable, further simplifying installation and later modifications. * Thanks to the relatively high signal levels and the fact that the bus wires are balanced, the bus can be run near high tension voltage cables. Also, the low-pass filter characteristic of each bus receiver eliminates externally generated spikes. SIOX SYSTEM DESCRIPTION p 4 Physical Bus Signals Essentially, the SIOX bus is a current loop similar to an ordinary point-to-point 20 mA current loop. In such a loop, a "1" is indicated by current flowing into the receiver and a "0" by no current being available. The SIOX bus current, normally generated by the computer adapter, may be anything up to 200 mA depending on the number of modules. Each module's receiver section consumes 1 - 1,5 mA regardless of variations in the supply voltage. Hence, with 62 modules connected to the bus, consumption is approximately 100 mA, which is the standard bus generator current. When the computer or a SIOX module transmits a "0", the bus is effectively short circuited, inhibiting the current flow in all optocoupler receivers. For the duration of each such "0" bit, the bus will carry the maximum generator current (100 mA). Note that such modules that are supplied directly off the bus draw all their current while the bus is transferring a "1", storing current in a reservoir capacitor for "0" transfers. The average supply current for such modules must therefore be increased by a factor of 3 when calculating the total bus current drawn by all modules. SIOX SYSTEM DESCRIPTION p 5 Cable Selection As mentioned above, the current flowing in the bus is typically 100 mA. The wire resistance must therefore be low enough to carry this current without any excessive voltage drop. With a 15 V power supply, the permissible voltage drop from the central current generator to any module is 2 x 2 V, increasing with the supply voltage. At the maximum bus length of 1,000 m, a wire area of 1 mm2 = AWG 17 is required, decreasing to 0,2 mm2 = AWG 24 at the maximum bus voltage of 35 V. In some cases, twisted and shielded wire may be used. Using twisted wires reduces possible magnetic interference from nearby high-current cables, motors etc. Shielding reduces capacitively coupled noise from high-voltage cables running parallel with the SIOX bus, but may for long lines and uncertain grounding create new problems. SIOX SYSTEM DESCRIPTION p 6 Communication Speed vs Transfer Quality Maximum communication speed for a SIOX bus is 19 200 bits/s, which permits software handling of the communication protocol. A SIOX module therefore needs no power-hungry high-speed preprocessing IC's and communication front-ends or bus interfaces with separate, isolated power supplies. The result is increased life expectancy and lower cost. The normal communication speed used with SIOX bus is 4800 bits/second, corresponding to a bit time of 208 µs. As already mentioned, this moderate speed has definite advantages with respect to noise immunity and ease of cabling. In fact, the opto-isolated design yields a rise and fall time of 20 µs, limiting the maximum practical communication speed, but at the same time effectively cancelling high-frequency noise: These rise and fall times also match behaviour of a 1 000 m unterminated communication line. A typical wire pair will exhibit a characteristic impedance of 170 with a wire wire capacitance of 180 pF/m. Termination with 170 at each bus end, and possibly at the end of each branching stub, is impossible due to the excessive driver currents required. Keeping the communication speed low permits, to a degree, rise and fall times of 20 µs and ringing caused by mismatch. Each SIOX module connected to the bus also contributes to the damping of electrical interference and ringing. These effects can best be studied on a 1000 m bus with one single module placed at the remote end. In this extreme case, an extra termination resistor in the 500 - 1000 range across the end of the bus has proved effective in minimizing the number of communication misses and hence the number of time-consuming retransmissions. SIOX SYSTEM DESCRIPTION p 7 Bus Lengths over 1 000 m Communication speeds of lower than 4800 bits/s may be necessary if the bus length is increased above 1 000 m. The general rule is 2 000 m at 2400 bits/s, 4 000 m at 1200 bits/s and so on. However, the limitation caused by the bus resistance will quickly become a problem and must be overcome either by using heavier wires or by reducing the maximum current from the generator. Note that lower currents increase the rise time in the remote end of the bus, necessitating a further decrease in the communication speed. Hence, a 4 000 m bus must in most cases be run at 300 bits/s, using a 50 mA current generator. Shorter buses than 1 000 m or low capacitance cable permit modules to communicate at up to 19 200 bits/second. Modems and Half Duplex Echo In general, the SIOX bus may be extended using a modem, either short-haul or full dial-up. However, the half-duplex nature of the SIOX bus, where information is transferred alternately in both directions, must be borne in mind. If a modem pair is used to interface between two SIOX buses, each with its own current generator, a "0" (short-circuit) on either bus is transferred to the other and then back again, causing both buses to lock up. This situation can be resolved by using an echo cancellation technique or intelligent bus extenders that automatically switch repeating direction. Such repeaters may also be used as routers to expand a serial port to address more that 63 modules through selective repetition: SIOX SYSTEM DESCRIPTION p 8 Typical Module Dimensions and Connectors SIOX modules come in many sizes to suit various installation needs, but one standard housing is suitable for installation in electrical cabinets, using the clip on the bottom to hook onto a 35 mm DIN 50022 mounting rail. It has the dimensions given in the figure below, and conforms with the IP 41 encapsulation class. Alternatively, it can be mounted using the four corner holes. The screw connectors used are plug-in Combicon MSTB 2,5 mm2 from Phoenix Contact, to which several second sources exist. SIOX SYSTEM DESCRIPTION p 9 SIOX - A COMMUNICATION PROTOCOL SIOX is the name of a system for communication that is primarily intended for use in industrial environments. Continued automatisation increases the need for communication with analog and digital sensors and controls, the transmission of data between distributed computers and a better information man - machine. In the SIOX system information is transferred between different units through a standardised link, the SIOX bus, consisting of a two-wire cable. To this bus a broad spectrum of cost-effective hardware modules can be connected with a minimum of work effort. The following description of the communication principles is intended for system designers and service staff. The SIOX system has been optimised to provide ease of installation, flexibility and expansion opportunities, and to ensure high noise immunity and low cost. Efficient message transfers decrease the need for high communication speeds, in turn leading to improved noise immunity and reduction in the cost of computers and modules to be connected to the SIOX bus. Basics All messages are transmitted asynchronously, one character at a time, at a speed of between 300 and 19200 bits/s. This permits nearly all computers to communicate via a SIOX bus through a simple adapter connected to their serial ports. An asynchronous character always consists of 1 start bit, 7 or 8 data bits containing information, 1 optional parity bit and 1 or 2 stop bits. SIOX uses 8 data bits, 1 even parity bit and 1 stop bit. The start bit always has the value 0 to synchronize the character between transmitter and receiver. SIOX SYSTEM DESCRIPTION p 10 The eight bits of information can each be a 1 or 0, together forming one of 256 different characters. The position in the character decides the weight of the bit; the first called D0 has a weight of 1, the second called D1 has a weight of 2, the third D2 a weight of 4 and so on until the last bit, D7 whose weight is 128. Each hexadecimal figure / 0 - 9 or A-F consists of a combination of 4 bits of information as follows: D3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 D2 D1 D0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 represent: = 0+ 0+ 0+ = 0+ 0+ 0+ = 0+ 0+ 2+ = 0+ 0+ 2+ = 0+ 4+ 0+ = 0+ 4+ 0+ = 0+ 4+ 2+ = 0+ 4+ 2+ = 8+ 0+ 0+ = 8+ 0+ 0+ = 8+ 0+ 2+ = 8+ 0+ 2+ = 8+ 4+ 0+ = 8+ 4+ 0+ = 8+ 4+ 2+ = 8+ 4+ 2+ 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 D7 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 D6 D5 D4 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 represent: = 0+ 0+ 0+ 0 = 0+ 0+ 0+16 = 0+ 0+32+ 0 = 0+ 0+32+16 = 0+64+ 0+ 0 = 0+64+ 0+16 = 0+64+32+ 0 = 0+64+32+16 = 128+ 0+ 0+ 0 = 128+ 0+ 0+16 = 128+ 0+32+ 0 = 128+ 0+32+16 = 128+64+ 0+ 0 = 128+64+ 0+16 = 128+64+32+ 0 = 128+64+32+16 Hexadecimal 00 10 20 30 40 50 60 70 80 90 A0 B0 C0 D0 E0 F0 Decimal 0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 The parity bit checks that the other bits in the character have been transferred correctly. The number of bits set at 1, of the eight information bits and the parity bit, must be an even number. The stop bit is always a 1, serving as the shortest pause before the start bit of the next character. SIOX SYSTEM DESCRIPTION p 11 Master - Slave In every SIOX bus one of the units connected must be a master or "central" and any number of units up to 63 are slaves or station modules. Each exchange of information is initiated by the master transmitting a message, comprising a number of characters, via the SIOX bus. One of the slaves recognizes the sequence of characters as a message to itself and sends a response back to the master. All other slaves must remain silent. This exchange of information constitutes one complete communication. If a message should be disrupted by electrical noise so that the slave cannot recognize it, no reply is sent. Alternatively, the master may find a fault in the reply from the slave. In both cases the communication is repeated. After a successful communication the master can communicate with another slave and so on. Slaves cannot send messages to each other without the help of the master. Slaves are singled out through a unique address between 1 - 63 assigned to them at installation time. In large systems it is possible to group up to 63 stations by means of a Router to coexist with other such groups. A single serial port can thereby access nearly 4000 stations. See also page 7. Characters Of the 256 different characters that can be sent, the first 128 (hex 0/0/ - 7F) are data characters. The last information bit (D7) of each such character is cleared to 0. Data characters have different meanings depending on the type of message and type of station receiving or returning a message. For a station with digital I/O (Inputs and Outputs) each one of the bits D0 - D6 may represent one active or passive I/O. For measurement stations, D0 - D6 may represent an analog value, and for stations with a text display they may represent one of 128 letters or figures and so on. The remaining 128 characters (hex 80/ - FF) with D7 set at 1 are special characters. No messages containing two special characters in succession are valid. SIOX SYSTEM DESCRIPTION p 12 Message Types In order to optimally transfer the various types of information, the current SIOX II specification defines two basic types of message; data mode and string mode. A complete two-way communication in data mode includes 4 or 5 characters, while a communication in string mode can vary between 6 and (theoretically) 326 characters. The master (central computer) decides which type of message to use at each new communication. Most slaves (stations) can receive messages in both data mode and string mode. The answer mode from the station must be identical to the mode sent by the central. It is not permitted for a station e.g. to respond in data mode to a message in string mode. Data Mode Because of its compact form, data mode is used mainly for transfer of digital or analog I/O signals. The central first transmits an address character (hex C1 - FE) to alert the station concerned. Since many SIOX buses have fewer than 63 stations connected, certain modules may accept several address characters. The program overhead in the central is minimised if, for example, four analog channels in a SIOX module can be directly identified using four different addresses. The central may treat the module as four separate slaves with unrelated data. The data characters (0/0/ - 7F) following the address are then received by the station. Either 1 or 2 such characters are accepted, depending on station type, which must be known by the central beforehand. Once the correct number of characters has been duly received, the station may, for example, let the 7 or 14 information bits (excluding the D7's = 0) control digital outputs, convert the bits to an analog signal or show a character on a display. As an answer the station immediately transmits two data characters, via the SIOX bus, containing 14 information bits with, for the station, specific meaning. These characters are received by the central for further processing. SIOX SYSTEM DESCRIPTION p 13 The reply from the station is checked by the central for any parity or format errors, in which case the communication is repeated. This is also the case if the station does not answer at all within a timeout period due to the station being disconnected or the central's message being disturbed. Typically, the central makes three attempts to communicate with the module before it gives up and starts with the next station. Hence a complete data mode communication consists of 1 address character and either 1 or 2 data characters from the central with 2 data characters in reply from the station. At the normal speed of 4800 bits/s a communication of this type takes 10 - 13 ms. Typical communication sequence between a central and three modules (data mode): Call Reply C1 Address of slave 1 (a digital I/O module). 0/3 Description Data which activates two of seven possible outputs in the slave. 0/0/ Data from the module showing that seven inputs are passive. 0/8 Data from the module showing that one out of seven further inputs is active. C3 Address of slave 3 (here part of an analog module with four inputs and four outputs). 0/0/?? Electrical noise on the wire causing slave 3 to reject the message from the central. C3 The central retransmits the message after a timeout. 0/0/ Seven data bits of a D/A value. 0/0/ Another seven bits of D/A value 0/0/0/0/ which sets the analogue output of the module to zero. Both the central and the analogue slave module are defined for data mode communication using 2 data characters to the slave. 0/0/ Slave 3 answers with seven bits of an A/D input value. 0/0/ Last seven bits show that the analogue input was set to 0 V. C4 Address of slave 4 (same hardware module as slave 3). 40/ The least significant seven bits of the value 0/140/ = 0000001. 0/2 Remaining seven bits of the value 0/140/ = 0010000. 7F Slave 4 answers with seven bits of A/D value 0/1FF. 0/3 The most significant part of 0/1FF. SIOX SYSTEM DESCRIPTION p 14 String Mode Compared with the compactness of the data mode message, a string mode communication offers more flexibility through its variable message length. The inclusion of a checksum for the message in addition to the parity check offers vastly improved reliability in the transmission. Up to 80 data characters, each with eight data bits, can be transmitted in each direction. Two types of string mode messages are possible, namely setup and text. Setup strings are used for reading or modifying parameters and other functions in a station. Text strings may contain text characters to be shown on a display or a printer, and return keyboard codes or strings of numbers from magnetic or bar code readers. Text strings may also represent digital or analog bit patterns or contain program sequences in binary code. String Address All string mode communications start with the character C0/ from the central. By analogy with data mode this would represent an address of an invalid slave number 0. To identify one individual slave, the C0/ is directly followed by a data character (0/0/ - 7F). The data characters 0/1 - 3F or 41 - 7F serve here as equivalents to the data mode addresses C1 - FF for the 63 slaves available. The difference between e.g. 0/1 and 41, both representing an address to slave number 1, at the same time defines whether the communication is meant to be a setup (0/1 - 3F) or text string (41 -7F). Global Address The slave number 0 is not allowed. Instead, when the C0/ is followed by an address character 0/0/ or 40/, this indicates a call to all modules irrespective of their address 1-63. Data or text can consequently be sent to all modules, although the overlapping answers will probably be unreadable. A typical station also terminates its answer as soon as it identifies that the bus is interfered with. Another use is for the central to quickly find out if a bus is inhabited. Older modules cannot identify global addresses and will not answer. String Data Following the two-character string address, up to 80 data characters (0/0/ - 7F) can be sent. More than 80 characters will not be accepted by the selected station. SIOX SYSTEM DESCRIPTION p 15 String End Since the number of characters cannot be defined in advance, a special character must end the string. A reserved character (BC - BF) is used for this purpose. The ending character is, in turn, followed by an extra character (0/0/ 7F), containing the checksum for the whole message (excluding the start character C0/). All characters including the end character (BC - BF) are added and the sum is complemented (1-complement, i. e. every bit is changed from 0 to 1 and vice versa). The eighth bit must, however, always be cleared to 0 so that the checksum cannot be mistaken for a data mode address or other special character. Inhibit Answer This string end character can be modified by the central into B8-BB by clearing bit 2. This indicates to the slaves that they shall inhibit their answer, but still carry out the order in the message, typically a global call. String Answer When the station has received and accepted the whole string from the central, it answers with a similar string, but where the address part has been left out. The answer is terminated by the same end character (BC-BF) as in the call, followed by the checksum for this message. Example text string from central: C0/ 41 Station address 54 T 45 E 53 S 54 T BE End 40/ Checksum Example string answer from station: 4F O 4B K BE End 27 Checksum Note that the central or the station can send "empty" messages (without data characters). For example if the central transmits: C0/ 41 Station address BC End 0/2 Checksum this is only a request for a reply from station 1. If the station does not have a message to present, it will answer with: BC End 43 Checksum As already mentioned, the central can transmit one of eight different end SIOX SYSTEM DESCRIPTION p 16 characters. BC (and BD, B8 and B9) means unnumbered calls, suitable for most messages when a retransmission of the same message does not lead to any ambiguity. A different case is when transferring e.g. a text, where sending the message twice would cause the text to double on the display. If the central sends BE and BF in alternate transmissions, the messages are numbered. Should the station receive two consecutive numbered messages with the same end character, and has already accepted the first message, the second one will be discarded and the first response repeated. Slave is Busy The station must reply using the same end character (BC - BF) as transmitted by the central. The station can also inform the central that it is busy, or that there is no space for further messages. It does so by clearing bit 2 in its end character, replacing BC - BF with B8 - BB. The central can then either wait a while or transmit empty messages until the slave once again answers with BC - BF. Note that the central also uses the end characters B8-BB to request inhibition of the answer, but in that case the slave is not supposed to answer. Group Address Expansion Router modules like the R30 (page 7) permit expanding the number of modules to be addressed in a bus by interpreting its received string address (C0/) 41 (C0/) 7F as a group address. The next consecutive character received, 0/1-3F or 41-7F, is then the real module’s address in string mode for one of up to 63 modules connected to the R30's secondary side. R30 retransmits the whole message except the character after C0/ (its own address), changing the checksum to reflect the missing character. Any answer from the secondary bus is copied, character by character, to the calling master side. The total delay will be one character in each direction, which must be accounted for. Note that a router cannot simultaneously accept text strings due to the address ambiguity. Some modules include options to handle both the group and station address without an intermediary router module. This increases the number of stations on a single bus, but care must be taken not to consume too much bus current. A group address = 40/ is accepted as a global group call. Each router retransmits the rest of the message on its secondary bus. Hereby, data can simultaneously be sent to a station with a specific address in each group. Meta Characters Since only data characters (0/0/ - 7F) may form a string message, whole bytes or eight-bit ASCII text characters (80/ - FF) cannot be included in the message. Such "meta characters" are therefore sent as two characters, first the special character B0/ and then the desired character with the eighth, the most significant, bit cleared to 0. A string of 80 bytes can therefore theoretically be SIOX SYSTEM DESCRIPTION p 17 formed by 164 transmitted characters. If e.g. 4 bytes, 0/0/ 40/ 80/ C0/, shall be sent from the central to the station, the whole string will look like this: C0/ 41 0/0/ Address 40/ 1st B0/ 0/0/ 2nd B0/ 40/ -- 3rd -- BC 22 -- 4th -End Check Repeated Characters In transferring e.g. text, many equal characters may appear in succession. Such characters can automatically be compacted to save communication time. The transmitting central or station counts the number of equal characters in succession, adds 80/ and sends a special character (82 - AF), followed by the repeated character. The text: N a m e : _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 4E 61 6D 6E 2A 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F may at the transmission be reduced to: 4E 61 6D 6E 2A 8F 5F In this way up to 47 characters can be compacted down to only two. The meta characters (80/ - FF), which already have received special treatment, cannot be compacted. The receiver expands the double character at arrival, recreating the original text. Setup Messages String Setup messages include several particulars to let it handle data in the module. Many SIOX modules contain a non-volatile EEPROM memory and/or a RAM area used for storing setup parameters, station addresses and working modes. Each parameter contains 16 data bits and may typically contain 16 digital information bits or a 16-bit integer. At power-up, many of the parameters are copied from EEPROM to RAM to create default values that are active until they are modified by communications. As mentioned earlier, a range of string mode addresses, C0/ 0/1 - C0/ 3F for station numbers 1 - 63, are set aside for setup messages to read and modify such parameters. In this way, they cannot be mistaken for ordinary text information using string addresses C0/ 41 - C0/ 7F. Setup strings normally contain 2, 4, 6 or 8 data characters in addition to the address, end and checksum characters. Each data character is used to transfer 4 bits of information to/from the station, using the ASCII characters 0 9 and A - F (hex 30/ - 39 and 41 - 46). SIOX SYSTEM DESCRIPTION p 18 The first two or four data characters transmitted from the central to a station form a combined command/parameter number. To identify the length, the module looks at the whole message length. Four or eight characters define the first four as a number. Any other length defines the shorter, two-character number as follows: Hex 30/ 30/ - 33 46 form a command/number: 0/0/ - 3F Read one of the 64 first RAM parameters. Hex 34 30/ - 37 46 form a command/number: 40/ - 7F Read one of the first 64 EEPROM parameters. Hex 38 30/ - 42 46 form a command/number: 80/ - BF Write one of the first 64 RAM parameters. Hex 43 30/ - 46 46 form a command/number: C0/ - FF Write one of the first 64 RAM parameters and the corresponding EEPROM parameter. A four-character number defines: Hex 30/ 30/ 30/ 30/ - 33 46 46 46 form a command/number: 0/0/0/0/ - 3FFF Read one of 16384 RAM parameters. Hex 34 30/ 30/ 30/ - 37 46 46 46 form a command/number: 40/0/0/ - 7FFF Read one of first 64 EEPROM parameters. Hex 38 30/ 30/ 30/ - 42 46 46 46 form a command/number: 80/0/0/ - BFFF Write one of 16 384 64 RAM parameters. Hex 43 30/ 30/ 30/ - 46 46 46 46 form a command/number: C0/0/0/ - FFFF Write one of 16 384 RAM parameters and the corresponding EEPROM parameter. As can be seen, the first 64 parameters can be accessed either way. The two bits defining Read/Write and RAM/EEPROM are always contained in the first character. After the two/four characters may follow four more characters, 30/ 30/ 30/ 30/ - 46 46 46 46 = 0/0/0/0/ - FFFF, which constitute the 16-bit data in write commands. A Read discards them, while a Write with missing data is terminated. Following example shows a write to EEPROM address 63 (hex 0/0/3F) in compact and expanded form: 46 46 31 32 33 34 F F 1 2 3 4 or 43 30/ 33 46 31 32 33 34 C 0/ 3 F 1 2 3 4 The string is terminated by an end character, B8-BF, and a checksum character. SIOX SYSTEM DESCRIPTION p 19 The answer from the station always contains the 16 bit parameter data expressed as 4 data characters (same as the write data from the central). As usual, the string is terminated by an end character and a checksum. Example: 1) Writing 0/70/1 to the first RAM+EEPROM parameter in station 1: From central: C0/ 0/1 43 30/ 30/ 37 30/ 31 BE 0/5 C 0/ 0/ 7 0/ 1 From station: 30/ 37 30/ 31 BE 0/ 7 0/ 1 79 2) Reading EEPROM parameter number 64 (the 65th, hex 40/) in station 1: From central: C0/ 0/1 34 30/ 34 30/ BF 77 4 0/ 4 0/ From station: 43 31 30/ 30/ BF 6C C 1 0/ 0/ Enquiry Help Texts Setup strings can, in most SIOX modules, access help texts stored in the module. Two types of help information are available, 1) A Type Enquiry, to which the module answers with a text string describing the module type, software version and special option numbers selected. 2) Parameter Help texts describe, for each parameter, the function of the particular parameter, simplifying setup of the module. A Type Enquiry consists of a setup string containing only one data character from the central: C0/ 0/1 0/5 BC 3D ENQ A typical station answer can be: 53 34 35 20/ 56 65 72 20/ 30/ 2E 30/ 35 3A 30/ 30/ 30/ BC 0/D S 4 5 V e r 0 . 0 5 : 0 0 0 A Parameter Help enquiry is similar to the Type Enquiry string containing the data character hex 0/5, but with the addition of a two/four-character parameter number. Since the answer string from the station may contain a maximum of 80 data characters and some parameters may need more explanatory characters, a secondary answer string can be requested by setting the 2nd highest bit in the parameter address. This bit normally defines selection between RAM and EEPROM. SIOX SYSTEM DESCRIPTION p 20 Example: First Help enquiry for parameter number 8: From central: C0/ 0/1 0/5 30/ 38 BE 53 ENQ 0/ 8 Answer from station: 41 6E 61 6C 6F 67 20/ 43 68 61 6E 6E 65 6C 20/ 31 BE 45 C h a n n e l 1 A n a l o g From central: C0/ 0/1 0/5 34 38 BE 4F ENQ 4 8 Answer from station: 53 63 61 6C 69 6E 67 BF 7F S c a l i n g Selective Type Access A setup string may include the letter “T” (hex 54) anywhere in the call. Most modules can collect the following three letters and compare them with its own Type definition. If a full match is found, the module accepts the call, else not. Older modules scrap the whole call. This is useful to select a specific module on the bus if two or more stations are installed with the same address. Together with a Global call it can modify a specific parameter exclusively in one type of station. From central: C0/ 0/0/ 38 32 30/ 30/ 30/ 31 54 53 34 35 B8 0/C Global Write0/2 = 0/0/0/1 Type S45 No answer SIOX SYSTEM DESCRIPTION p 21 Bit Modify Some parameters include functional bits that may change independently of one another. For that purpose, e.g. the parameter(s) controlling digital outputs typically include masking functions to protect local bits when a write parameter is carried out. Still, it may be necessary to send a setup command to modify only one bit. This is identified by including in the setup string a letter”S” or “R”, followed by a letter 0 - F (hex 30/ - 46 ). This will set or reset the bit, appointed by the second letter, in the parameter defined by the usual two or four characters. Any 16-bit write data is scrapped, and a read command is disregarded. The answer will contain the usual 16-bit data value of the modified parameter. Sequential Addressing The address in several installed modules can be modified without accessing each module individually if the modules have an addressing button or a magnetically accessible reed switch. The central sends repeated setup messages which include the letter”Q” and an address character from 0/1 to 3F. No module may answer, even if the Group, Station Address and Type are correct, unless the operator presses the button on one module. This module will then send an empty answer and save the received address character in its EEPROM. The central can now choose to send another addressing command, typically with the next sequential address, and the operator presses the button on next module. The EEPROM address is only valid if no jumper address is set in the modules. Example: From central: C0/ 0/0/ 54 53 34 35 51 0/2 BC 60/ Global Type S45 Addr.02 Answer from module with button pressed and new address 0/2: BC 43 Message Types Summary The SIOX protocol uses asynchronous characters (even parity, one stop) with hex 80/ - FF as addresses/special flags and hex 0/0/ -7F as data. Each "address" must be followed by at least one "data", or both "addresses" will be considered illegal by the receiver. SIOX SYSTEM DESCRIPTION p 22 Function Addr Data 80/-81 Description Reserved for future use. RptCount 82-AF 0/0/-7F Multiple quantity 2 - 2F of the data character (string mode). Meta B0/ 0/0/-7F Convert data 0/0/-7F into 80/-FF (string mode). B1-B7 Sign-Off Reserved for future use. B8-BF 0/0/-7F End of string mode message. The data character contains the complemented checksum (7 bits) for the whole string excluding the C0/ start character. Address bit 2 = 0: No answer required / Not ready for more data (station answer only). Address bit 1 = 0: Unnumbered message. Address bit 0 = 0/1: 1st/2nd message. String Start C0/ 0/1-3F String mode setup message header from central to station number 1 - 63. String Start C0/ 41-7F String mode data message header from central to station number 1 - 63. Data Message C1-FF 0/0/-7F Data mode message from central to station number 1 - 63. An extra data character is optional. -- 0/0/-7F Data mode answer (2 characters) from 0/0/-7F station. SETUP EXTENSIONS Enquiry 0/5 Answer with module type / parameter help text. Type 54 xx yy zz Only modules of the type xx yy zz are affected. Set bit 53 xx Set bit number xx in the appointed parameter. Reset bit 52 xx Clear bit number xx in the appointed parameter. SeqAddr 51 xx Set the address xx in a physically selected module. SIOX SYSTEM DESCRIPTION p 23 FAULT TRACING IN A SIOX SYSTEM A SIOX system consists of a central computer, typically a PC with a serial port, a converter module of type K32 or U32, a two wire SIOX bus and up to 63 SIOX modules, stations, containing different I/O functions. The central can also be a custom computer or a modem adapter with a built-in SIOX port, eliminating the need for the K32. The converter isolates the central from the SIOX bus and translates the central's RS232 signals to the special signal levels used for transferring serial information to and from the stations. Checking the Supply Voltage Communication typically requires a SIOX bus supply of at least 15 V/100 mA. It is easy to check both voltage and current on the bus using a universal instrument. Note, however, that the voltage measured will be lower on a communicating bus, since each transferred bit = 0 pulls the voltage down to nearly 0 V. A current measurement between the bus wires also interrupts the communication between the central and the stations during the measurement, possibly triggering application dependent alarms. If a communication interrupt can be allowed, the RS232 connector may be pulled during the measurement. The K32 module will then supply a steady signal to the bus, so that voltage and current may be checked. LED Diagnostic System Most SIOX modules are equipped with two LED's for supervising the communication, one green and one red. The green LED, when lit, indicates that sufficient voltage is being applied to the SIOX bus. If it is flickering - at a rate corresponding to the communication speed of the central - it indicates that the central is transmitting information. SIOX SYSTEM DESCRIPTION p 24 Several causes to the green LED being off exist, most of them self-evident: * The bus power supply is out of order or not connected. * The wrong COM-port in the PC is specified, and the current port transmits a Break. Check by unplugging the K32 adapter from the PC. If the LED lights up, this was the problem. * The SIOX bus has been disconnected somewhere between the central and the module in question. Check the green LED's of other modules for a rough indication of the break position. * The SIOX bus is short-circuited somewhere along the line, usually at a branch-off point or a connector. Disconnecting the bus from the central permits measuring with an ohmmeter. The reading will be below 50 . * The bus adapter components in a module have failed, shorting the bus. However, this is very unusual, since modules are designed in such a way that most errors just disconnect the failing module. The red LED of a SIOX module flashes each time the station transmits a response to the central. Should the LED never flash in spite of the fact that the green LED is flickering, then the central is unable to communicate with this particular module. Several reasons for this are possible: * The central transmits using a different speed. All standard modules are supplied set to 4800 bits/s, while the central may communicate using e.g. a 1200 bits/s modem. Modern modules are typically set to automatic bit rate detection from 1200 to 19200 bps. * The address of the module is incorrect. Most modules are set to address 1 at delivery, since this is available in most SIOX systems. The address is set either by jumpers or in an EEPROM, as described in the respective manual. If the address is inadvertently set to 0, the station will switch to number 63, which is not normally used by the central. Furthermore, most systems communicate with less than the permitted 62 stations or may, under program control, elect not to communicate with specific stations for some time. * The module may be set up to, in data mode, receive two data characters from a central set to transmit only one to this module. This cannot occur when a standard SIOX protocol is used, since this automatically adapts to the station type. * The supply voltage to the SIOX bus is too low (15 V - 35 V is recommended) or not enough current can be supplied (typically > 120 mA). SIOX SYSTEM DESCRIPTION p 25 * The SIOX bus may be continuously affected by intense electrical interference, e.g. through involuntary connection to other signal or power networks. It may also have been grounded at more than one point, so that differences in ground potential are carried through the bus, overlaying the bus signal. Such problems are best identified using an oscilloscope (please see below). * Should two modules inadvertently be set to the same address, the red LED's of both will flash when they answer a call from the central. In almost every case, their overlapping answers will enable the central to identify an error, retransmit and finally define this address at a lower priority. This is identified by the red LED's in the two doubly addressed modules flashing at a slower rate. Bus Listeners In the SIOX system several different terminal modules with keyboard and display are available, which also may be used to "spy" on the bus communications (M10, M11, P10). On the display is shown a slice of the communications, either to all stations or only to a specific address. For details, please refer to the manuals of M10, M11, P10. Since the SIOX bus is bidirectional, all characters to and from the modules are shown, specially indicating faults due to disturbances. Such a bus listener may be connected to the bus at any point, since it doesn't require a separate power supply. A standard PC may also be used as a bus listener through a K32 or U32 converter set at 0 mA bus current and the SIOX-Spy program. The advantage, as compared to SIOX terminal modules, is that a larger slice of the communications can be shown, but with less portability of the equipment. Oscilloscope An oscilloscope can be connected to the bus to check for interference etc. If the oscilloscope has a grounded power cord, start by connecting only the probe tip to either bus wire to check which lead may eventually be grounded and which carries the positive voltage. The safest way to proceed is to use a fully isolated instrument. The levels for "1", typically 24 V, and "0" can now be checked. Note, that "0" bit levels transmitted from a station measure approximately 4 V, while "0" bits from the central drop to 1 V from ground. When long buses are employed, the "0" bit levels may be considerably higher, depending on where along the bus that the connection is made. The levels for "1" may also deviate, either if the supply is poorly filtered, causing the level to fluctuate a few volts, or if the bus is heavily loaded so that each "1" slants upwards to the right on the screen. SIOX SYSTEM DESCRIPTION p 26 A check should also be made that each rise and fall time is adequately short, less than 20% of the bit time (208 µs at 4800 b/s). It is difficult to obtain a stationary picture for a complex communication, but the first few bits after the trigger are usually identifiable. Intense hum causing both the "0" and "1" levels to sway up and down more than some 5 V indicate a grounding error. Tall, sharp spikes indicate that the bus is subjected to capacitively or inductively coupled noise from other wiring or magnetic fields Although the SIOX bus features much greater noise immunity than other communication buses, such problems should be corrected by screening, twisting or relocating the bus wires. Conclusion Be aware that most errors have trivial grounds such as lacking supply or shorted or disjoint bus. These errors can almost always be singled out by checking the two LED's on the modules. Telefrang AB, Varbergsgatan 8, S-412 65 Gothenburg, Sweden Tel +46 31 403060, Fax +46 31 402025, E-mail [email protected]