ASCII Control Protocol

Document Sample
ASCII Control Protocol Powered By Docstoc
					Revision Date:   2002-09-24
Creation Date:   2000-11-01
Author:          Gerry Sullivan
File Name:       AppNote_ASCII Control Protocol_2002-09-24.doc

                            ASCII Control Protocol


1.0   INTRODUCTION
      This application note describes the protocol that is used for supporting communications
      between the SmartClass system and a 3rd party A/V control system, such as those
      manufactured by Crestron and/or AMX (Panja).

      To enable such control, the standard firmware supplied with the SC2000 CR controller must
      be replaced with the optional ASCII firmware, (pronounced ASK-EE, an acronym for
      American Standard Code for Information Interchange). Note that the ASCII firmware option
      can be ordered for the SC2000 CR or SC2000 C, but not for other SmartClass control units.

      Figure 1 shows a typical system configuration with an A/V control system.



                                            Touch
                                            Control
                                             Panel
                                                                   A/V
                                                                   Control System



                                      Control Processor

                  RS-232




                    SC2000 CR                                                        B
                                                          B




                      JU                       I                          I


                  SmartClass
                  System

      Figure 1      Third-Party A/V Control Environment – System Block Diagram
Application Note                                             ASCII Control Protocol
                                                                                        Page 2 of 15

1.1   A/V Control System Programming

      Most A/V control systems have a two-level structure similar to that shown in Figure 1.

      The Control Panel is an intelligent device the must be programmed by the system integrator to
      reflect the client’s specific requirements for the user interface. Colors, button styles and page
      layouts are usually customized on a project-by-project basis.

      The Control Processor is also an intelligent device that must be programmed by the system
      integrator, to enable button touches on the Control Panel to be translated into specific device
      commands on the system’s various control ports. SmartClass is treated as a specialized A/V
      device connected to one of the system’s RS-232 control ports.

      In order for SmartClass and the A/V control system to communicate, a standardized
      communications protocol, (ASCII), is used for information exchange.

      This application note describes the command structure for the SmartClass ASCII firmware.


1.2   Simplified Command Set

      The SmartClass ASCII firmware currently supports a subset of the functions that are possible
      with the SmartClass system. This simplified command set is still quite broad, and is generally
      more than adequate to support the system functions that would be implemented in a typical
      A/V control system environment.

      For applications that require more complex functions, it is strongly recommended that system
      integrators use separate control interfaces for A/V control and for SmartClass.

      Some A/V control system manufacturers support Windows based control interfaces, which
      allows both the A/V control GUI and the SmartClass control GUI, (SCVI), to be installed on
      the same control computer and share the same touch panel.
Application Note                                            ASCII Control Protocol
                                                                                      Page 3 of 15




2.0 SMARTCLASS ASCII CONTROL PROTOCOL
2.4   Hardware Configuration

      This section describes the electrical signal protocol supported by the SC2000 CR controller
      when equipped with the ASCII firmware option.

             •   Connection Type:          Asynchronous RS-232
             •   Port ID:                  Port “A”
             •   Connector:                DB-9 (male)
             •   Baud Rate:                9600 bps
             •   Character Length:         8 bits
             •   Parity:                   none
             •   Stop Bits:                1
             •   Bit Order:                LSB first
             •   Handshaking:              none


2.2   Control Characters

      All communication is based on the extended (8-bit) ASCII character set. This provides a way
      of mapping letters, punctuation, symbols and special control codes into numeric values
      readable by a computer. In this document, characters are shown with their more familiar
      ASCII identities and also with their hexadecimal values, (Hex Code). Appendix A provides a
      complete summary of the extended ASCII character set. The control characters used in this
      document are summarized below:

             •   Start of String           Carriage Return (CR)          Hex Code: 0Dh
             •   End of String             Line Feed (LF)                Hex Code: 0Ah
             •   Parameter Delimiter       Comma (,):                    Hex Code: 2Ch



2.3   Station Addressing Limitations

      A standard SmartClass system uses 6-bit addressing and supports the address range of 0
      through 63. There are two different multi-port address bridges that can be employed to
      extend system addressing up to seven bits (0 through 127) or eight bits (0 through 255).

      With the SC2000 CR controller, it is necessary to remove the internal jumper between pins 16
      and 17 of J1 when operating with an SC2000 X98 or SC2000 X252 address bridge.
Application Note                                           ASCII Control Protocol
                                                                                    Page 4 of 15


2.4    SmartClass ASCII Command Set

       The following high-level commands are supported with release 2.4.0.0 (and newer) of the
       ASCII firmware:

          Command                        Description
             A           Communication Initialization
             B           Group/Subgroup Define
             C           Audio/Video/Keyboard/Mouse Switching
             D           NOT SUPPORTED
             E           NOT SUPPORTED
             F           Status Check
             G           Status Change Notification
             H           NOT SUPPORTED
             I           Last Station Address
             J           USB Time Delay
             K           Teamwork (peer-to-peer)
             L           Teamwork (with team leader)


Note that command K cannot be used if there is an SC2000 X252 address bridge in the system.
Application Note                                              ASCII Control Protocol
                                                                                         Page 5 of 15


2.5   Communication Initialization – Command A

      SmartClass should normally be left in a power-on state. If the A/V control system is also left
      in a permanent power-on state, it should only be necessary to initialize communications once
      before the first use. If either system is powered-off, then it will be necessary to re-initialized
      communications before use.

      For communications initialization, the A/V system should be programmed to periodically,
      (e.g. once per second), poll SmartClass to determine if it is operational using the following
      “are you there?” string:

      CR , A , LF                            (the hex code is: 0Dh 2Ch 41h 2Ch 0Ah)

      When the SmartClass system recognizes the poll, it will respond with another character string
      to indicate “Yes, I am here”. The response string is:

      CR , A , a1 , LF                       (the hex code is: 0Dh 2Ch 41h 2Ch “a1”h 2Ch 0Ah)

      Where:         a1 = the firmware identification number (currently this is 1 (or 31h))

      Upon receiving this response, the A/V control system should suspend polling of SmartClass.
      To complete the connection negotiation sequence, the A/V system will return the following
      acknowledgement, (where once again, the parameter following the “A” is the same as that
      provided by the SmartClass system in its response):

      CR , A , a1 , LF                       (the hex code is: 0Dh 2Ch 41h 2Ch “a1”h 2Ch 0Ah)

      Where:         a1 = the firmware revision number (as received from SmartClass in the
                     previous response)

      Communications are now initialized between the A/V system and SmartClass.
Application Note                                                     ASCII Control Protocol
                                                                                                    Page 6 of 15


2.6   Group/Subgroup Define – Command B

      The SmartClass system, by default, will include all stations, (e.g. Group), in switching
      operations. The “B” command is used to modify this standard group definition, by allowing
      all or any subgroup of stations to be selected. The selected subgroup will remain in effect until
      this command is issued again with a different station range. Note that with firmware revision
      2.2.0 and newer, any previously defined switching is reset each time the B command is
      issued.

      This command is issued from the A/V control system to SmartClass using the following
      command format:

      CR , B , bn , LF                   (the hex code is: 0Dh 2Ch 42h 2Ch “bn”h 2Ch 0Ah)

      Where:           bn = a variable length set of parameters, representing the list of numeric station
                       addresses to be included. Addresses can be defined within the range of 0 to 99.

      Example 1:       Define Subgroup

      If the subgroup is to include the stations 0, 3, 6, 7, 12 and 32, the command is:

      CR , B , 0 , 3 , 6 , 7 , 12 , 32 , LF

      (the hex code is: 0Dh 2Ch 42h 2Ch 30h 2Ch 31h 2Ch 33h 2Ch 36h 2Ch 37h 2Ch 31h 32h 2Ch 33h
      32h 2Ch 0Ah)

      Example 2:       Define Group

      If the subgroup is to be cancelled, and all stations, (0 to 32), are to be included in subsequent
      operations, the command format would be as follows:

      CR , B , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 ,
      22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , LF

      (the hex code is: 0Dh 2Ch 42h 2Ch 30h 2Ch 31h 2Ch 32h 2Ch 33h 2Ch 2Ch 34h 2Ch 35h 2Ch 36h
      2Ch 37h 2Ch 38h 2Ch 39h 2Ch 31h 30h 2Ch 31h 31h 2Ch 31h 32h 2Ch 31h 33h 2Ch 31h 34h 2Ch 31h
      35h 2Ch 31h 36h 2Ch 31h 37h 2Ch 31h 38h 2Ch 31h 39h 2Ch 32h 30h 2Ch 32h 31h 2Ch 32h 32h 2Ch
      32h 33h 2Ch 32h 34h 2Ch 32h 35h 2Ch 32h 36h 2Ch 32h 37h 2Ch 32h 38h 2Ch 32h 39h 2Ch 33h 30h
      2Ch 33h 31h 2Ch 33h 32h 2Ch 0Ah)



      Note: to use a student station as a transmitter or receiver (audio, video or keyboard) this
      station has to be defined in the subgroup. If not, the command will not be executed.
Application Note                                                                     ASCII Control Protocol
                                                                                                                             Page 7 of 15


2.7   Audio/Video/Keyboard/Mouse Switching – Command C

      This command supports all switching operations. It is used to invoke video and/or audio
      broadcasts, (both point-to-point and point-to-multipoint variations), to blank student displays
      and to assign keyboard/mouse control of the video broadcasting station to another station.

      The command structure is as follows:

      CR , C , c1 , c2 , c3 , c4 , c5 , c6 , c7 , LF

      (the hex code is: 0Dh 2Ch 43h 2Ch “c1”h 2Ch “c2”h 2Ch “c3”h 2Ch “c4”h 2Ch “c5”h 2Ch “c6”h 2Ch
      “c7”h 2Ch 0Ah)

      Where:               c1 = Video Source station
                           c2 = Audio 1 Source station
                           c3 = Keyboard/Mouse Source station

                           c4 = Video Receiver station(s)
                           c5 = Audio Receiver station(s)
                           c6 = Keyboard/Mouse Receiver station

                           c7 = Audio 2 Source station

      Station numbers must be in the range 0 to 98, and all stations included in the switching
      operation must be defined as part of the current Group/Subgroup for the proper results.

      There are three short cut arguments that can be substituted for station numbers in the “C”
      command. These arguments are as follows:

               •   Blank                         L          Hex Code: 4Ch (can be used for c4)
               •   Reset                         R          Hex Code: 52h (can be used for c1 through c7)
               •   All Stations1                 T          Hex Code: 54h (can be used for c4 and/or c5)
                   1
                       Note that all stations includes only those stations defined by the current Group/Subgroup or Group Override definition

      For systems that are not equipped with audio support and/or keyboard/mouse switching
      support, the Reset argument should be used for the corresponding audio and keyboard/mouse
      parameters. To better understand how this function is used, a series of examples is presented:

      Example 3:           Reset

      The command for resetting all switching operations, (which corresponds to having all stations
      operate independently with their own keyboard, monitor and mouse, and having all intercom
      functions suspended), is as follows:

      CR , C , R , R , R , R , R , R, R , LF

      (the hex code is: 0Dh 2Ch 43h 2Ch 52h 2Ch 52h 2Ch 52h 2Ch 52h 2Ch 52h 2Ch 52h 2Ch 52h 2Ch
      0Ah)
Application Note                                            ASCII Control Protocol
                                                                                        Page 8 of 15


    Example 4:      Blanking

    The following command is used to blank all station screens and (if so equipped) lock all
    keyboards and mice:

    CR , C , R , R , R , L , R , R, R , LF

    (the hex code is: 0Dh 2Ch 43h 2Ch 52h 2Ch 52h 2Ch 52h 2Ch 4Ch 2Ch 52h 2Ch 52h 2Ch 52h 2Ch
    0Ah)


    Example 5:      Group/Subgroup Broadcast

    The following command is used to broadcast the video and intercom audio of the instructor
    station, (station 0), to all student stations that are part of the current group/subgroup:

    CR , C , 0 , 0 , R , T , T , R, R , LF

    (the hex code is: 0Dh 2Ch 43h 2Ch 30h 2Ch 30h 2Ch 52h 2Ch 54h 2Ch 54h 2Ch 52h 2Ch 52h 2Ch
    0Ah)


    Example 6:      Silent Monitoring of a Student Station

    The following command is used to monitor the video and audio of a selected student station,
    (station 15):

    CR , C , 15 , 15 , R , 0 , 0 , R, R , LF

    (the hex code is: 0Dh 2Ch 43h 2Ch 31h 35h 2Ch 31h 35h 2Ch 52h 2Ch 30h 2Ch 30h 2Ch 52h 2Ch
    52h 2Ch 0Ah)


    Example 7:      One-on-One Tutoring with Keyboard/Mouse Control

    The following command is used to monitor, (e.g. unicast), the video and audio of a selected
    student station, (station 15); to enable the microphone of the instructor station, (station 0); and
    to have the instructor’s keyboard and mouse control the student’s workstation:

    CR , C , 15 , 15 , 0 , 0 , 0 , 15, 0 , LF

    (the hex code is: 0Dh 2Ch 43h 2Ch 31h 35h 2Ch 31h 35h 2Ch 30h 2Ch 30h 2Ch 30h 2Ch 31h 35h
    2Ch 30h 2Ch 0Ah)
Application Note                                         ASCII Control Protocol
                                                                                   Page 9 of 15

2.8   Enable Teamwork Mode – Command D

      This command is not supported with firmware revision 2.4.0.0 and higher. Refer to new
      commands K and L for teamwork support.


2.9   Disable Teamwork Mode – Command E

      This command is not supported with firmware revision 2.4.0.0 and higher. Refer to new
      commands K and L for teamwork support.
Application Note                                               ASCII Control Protocol
                                                                                         Page 10 of 15


2.10   Status Check – Command F

       Student stations can be equipped with two different styles of user interface options; the
       SC2000 B audio/call box or the SC2000 T interactive response terminal. Both of these
       devices provide audio intercom and audio mixing support. Both of these devices provide a
       call button, allowing the student to electronically raise his hand and notify the instructor that
       he has a question. Additionally, the terminal also includes a help button, which is normally
       used to notify the instructor that the student is completely lost. (The terminal includes a
       number of other response buttons.)

       Both the Status Check command, (“F”), and the Status Change Notification command, (“G”),
       provide the A/V control system with a mechanism for determining the status of the call and
       help buttons on the student interfaces. Command “F”, (A/V system to SmartClass), is used in
       a polling style, while command “G”, (SmartClass to A/V system), provides an interrupt-
       driven style. You will not need to use both of these commands, and the capabilities of your
       A/V control systems will likely dictate which is preferable.

       When using command “F”, the system integrator would normally create a subroutine to
       periodically poll all student stations

       To invoke the Status Check command, the A/V control system will send the following
       character string to SmartClass:

       CR , F , f1 , LF               (the hex code is: 0Dh 2Ch 46h 2Ch “f1”h 2Ch 0Ah)

       Where:          f1 = the address of the student station being checked.

       Upon receiving this command, the SmartClass system will respond to the A/V controller with
       the following status message:

       CR , f1 , f2 , LF              (the hex code is: 0Dh 2Ch “f1”h 2Ch “f2”h 2Ch 0Ah)

       Where:          f1 = the address of the student station being checked.
                       f2 = the state of the call and help buttons:
                                    No user interface          0      30h
                                    No call or help request 1         31h
                                    Call                       2      32h
                                    Help                       3      33h


       Once triggered by a student, a call request or help request can be reset in one of two different
       ways. The student can press on the button a second time to cancel the call or help request; or
       the instructor can clear the call or help request by enabling the student’s microphone, so that
       the student may ask his question. When a student’s microphone is active, his call and help
       buttons are inactive.
Application Note                                              ASCII Control Protocol
                                                                                       Page 11 of 15


2.11   Status Change Notification – Command G

       This command is used by the SmartClass system to notify the A/V controller of a status
       change to the call and/or help buttons at the student interface, (SC2000 B or SC2000 T).

       To enable this command, the A/V control system will send the following character string to
       SmartClass.

       CR , G , 1 , LF               (the hex code is: 0Dh 2Ch 47h 2Ch 31h 2Ch 0Ah)

       To disable this command, the A/V control system will send the following character string to
       SmartClass.

       CR , G , 0 , LF               (the hex code is: 0Dh 2Ch 47h 2Ch 30h 2Ch 0Ah)


       When the G command is enabled, any time that a change in status occurs, the following
       message is sent from SmartClass to the A/V controller:

       CR , G , g1 , g2 , LF         (the hex code is: 0Dh 2Ch 47h 2Ch “g1”h 2Ch “g2”h 2Ch 0Ah)

       Where:         g1 = the address of the student station with the status change
                      g2 = the nature of the status change:
                                  Call/Help deactivated      1       31h
                                  Call activated             2       32h
                                  Help activated             3       33h




2.12   Group Override Enable/Disable – Command H

This command is not supported with firmware revision 2.2.0.0 and higher.
Application Note                                                  ASCII Control Protocol
                                                                                        Page 12 of 15

2.13   Last Station Address – Command I

       By setting a definitive value for the highest station address in the SmartClass system, the user
       can significantly reduce the amount of time necessary to execute other switching commands.
       This value is saved only as a temporary parameter, and should be reinitialized whenever the
       controller is powered down.

       To enable this command, the A/V control system will send the following character string to
       SmartClass.

       CR , I , i1 , LF          (the hex code is: 0Dh 2Ch 49h 2Ch “i1”h 2Ch 0Ah)

       Where:             i1 = the highest interface address in the system


2.14   USB Time Delay – Command J

       This command only has meaning in SmartClass systems that are equipped with optional
       SC2000 USB modules at each workstation interface to support USB peripheral devices (such
       as keyboards and mice).

       Under normal circumstances, the default value of 0 seconds is appropriate for this parameter.
       With certain computer implementations, it has been identified that manufacturers do not
       always adhere to published USB standards, and in such cases if two subsequent USB
       switching operations are attempted before the computer has had time to fully detect the first
       change, then an operating system crash is possible.

       The USB Time Delay feature allows the user to program a non-zero time parameter that will
       automatically prevent sequential USB switching operations within the defined delay period.
       Normally, this delay period will be adjusted to just exceed the device detection cycle
       associated with a given computer type, (e.g. around 7 seconds).

       To enable this command, the A/V control system will send the following character string to
       SmartClass.

       CR , J , j1 , LF                  (the hex code is: 0Dh 2Ch 4Ah 2Ch “j1”h 2Ch 0Ah)

       Where:             j1 = the desired USB Time Delay in seconds (≤30 seconds)
Application Note                                              ASCII Control Protocol
                                                                                       Page 13 of 15

2.15   Teamwork (Peer-to-Peer) – Command K

       In SmartClass systems equipped with the SC2000 T interactive student terminal option, it is
       possible to split the class into multiple student teams, each of which can switch audio, video
       and keyboard/mouse signals independently of the other.

       The teams are intrinsically defined by the SmartClass hardware topology, where all of the
       interfaces connected to a single SC2000 JU Junction Unit constitute a team. Note that this
       command cannot be used if there is an SC2000 X252 address bridge in the system.

       As execution of this command can take some time, the system will automatically
       acknowledge each change of configuration request.

       The Peer-to-Peer teamwork option gives each interactive student terminal shared control over
       all switching operations.

       To enable this command, the A/V control system will send the following character string to
       SmartClass.

       CR , K , 1 , LF               (the hex code is: 0Dh 2Ch 4Bh 2Ch 31h 2Ch 0Ah)

       To acknowledge this command, SmartClass will send the following character string to the
       A/V control system.

       CR , K , 1 , LF               (the hex code is: 0Dh 2Ch 4Bh 2Ch 31h 2Ch 0Ah)



       To disable this command, the A/V control system will send the following character string to
       SmartClass:

       CR , K , 0 , LF               (the hex code is: 0Dh 2Ch 4Bh 2Ch 30h 2Ch 0Ah)

       To acknowledge this command, SmartClass will send the following character string to the
       A/V control system.

       CR , K , 0 , LF               (the hex code is: 0Dh 2Ch 4Bh 2Ch 30h 2Ch 0Ah)
Application Note                                              ASCII Control Protocol
                                                                                       Page 14 of 15


2.16   Teamwork (With Team Leader) – Command L

       In SmartClass systems equipped with the SC2000 T interactive student terminal option, it is
       possible to split the class into multiple student teams, each of which can switch audio, video
       and keyboard/mouse signals independently of the other.

       The teams are intrinsically defined by the SmartClass hardware topology, where all of the
       interfaces connected to a single SC2000 JU Junction Unit constitute a team. Note that this
       command cannot be used if there is an SC2000 X252 address bridge in the system.

       As execution of this command can take some time, the system will automatically
       acknowledge each change of configuration request.

       The Team Leader teamwork option gives a specified student terminal in each team control
       over all switching operations. With the L command, the team leaders, by default, will be
       automatically selected based on hardware connections. The first interface in each branch
       (e.g. closed to the Junction Unit), will become the team leader.

       To enable this command, the A/V control system will send the following character string to
       SmartClass.

       CR , L , 1 , LF               (the hex code is: 0Dh 2Ch 4Ch 2Ch 31h 2Ch 0Ah)

       To acknowledge this command, SmartClass will send the following character string to the
       A/V control system.

       CR , L , 1 , LF               (the hex code is: 0Dh 2Ch 4Ch 2Ch 31h 2Ch 0Ah)



       To disable this command, the A/V control system will send the following character string to
       SmartClass:

       CR , L , 0 , LF               (the hex code is: 0Dh 2Ch 4Ch 2Ch 30h 2Ch 0Ah)

       To acknowledge this command, SmartClass will send the following character string to the
       A/V control system.

       CR , L , 0 , LF               (the hex code is: 0Dh 2Ch 4Ch 2Ch 30h 2Ch 0Ah)
Application Note                                                                         ASCII Control Protocol
                                                                                                                           Page 15 of 15

                                                        APPENDIX A
          Hexadecimal
                                      ASCII Command Set



                                          Hexadecimal




                                                                           Hexadecimal




                                                                                                             Hexadecimal
Decimal




                                Decimal




                                                                 Decimal




                                                                                                   Decimal
                        ASCII




                                                         ASCII




                                                                                           ASCII




                                                                                                                               ASCII
0         00            NUL     32        20             SP      64        40              @        96       60                ‘
1         01            SOH     33        21              !      65        41              A        97       61                a
2         02            STX     34        22              “      66        42              B        98       62                b
3         03            ETX     35        23              #      67        43              C        99       63                c
4         04            EOT     36        24              $      68        44              D       100       64                d
5         05            ENQ     37        25             %       69        45              E       101       65                e
6         06            ACK     38        26             &       70        46              F       102       66                f
7         07            BEL     39        27              ’      71        47              G       103       67                g
8         08             BS     40        28              (      72        48              H       104       68                h
9         09             HT     41        29              )      73        49              I       105       69                I
10        0A             LF     42        2A              *      74        4A              J       106       6A                j
11        0B             VT     43        2B              +      75        4B              K       107       6B                k
12        0C             FF     44        2C              ,      76        4C              L       108       6C                l
13        0D             CR     45        2D              -      77        4D              M       109       6D                m
14        0E             SO     46        2E              .      78        4E              N       110       6E                n
15        0F             SI     47        2F              /      79        4F              O       111       6F                o
16        10            DLE     48        30              0      80        50              P       112       70                p
17        11            DC1     49        31              1      81        51              Q       113       71                q
18        12            DC2     50        32              2      82        52              R       114       72                r
19        13            DC3     51        33              3      83        53              S       115       73                s
20        14            DC4     52        34              4      84        54              T       116       74                t
21        15            NAK     53        35              5      85        55              U       117       75                u
22        16            SYN     54        36              6      86        56              V       118       76                v
23        17            ETB     55        37              7      87        57              W       119       77                w
24        18            CAN     56        38              8      88        58              X       120       78                x
25        19             EM     57        39              9      89        59              Y       121       79                y
26        1A            SUB     58        3A              :      90        5A              Z       122       7A                z
27        1B            ESC     59        3B              ;      91        5B              [       123       7B                {
28        1C             FS     60        3C              <      92        5C              \       124       7C                |
29        1D             GS     61        3D              =      93        5D              ]       125       7D                }
30        1E             RS     62        3E              >      94        5E              ^       126       7E                ~
31        1F             US     63        3F              ?      95        5F              _       127       7F               DEL