MITEQ TECHNICAL NOTE 25T052 OCTOBER 2002 REV A LOCAL/REMOTE CONTROL DESCRIPTION OUTDOOR-MOUNTED TEST TRANSLATOR WITH REMOTE CONTROL ______________________ 1.0 INTRODUCTION This document provides a description of the monitor and control functions provided with the MITEQ Outdoor-Mounted Test Translator with Remote Control. Among the features are optional control of LO frequency for multi-band units, control of output attenuation, optional control of input attenuation and 32 memory locations for the unit, where setups can be stored and recalled easily. Also, a log is continuously updated with time stamped records of significant events such as status and setup changes for the unit. The internal frequency reference can be adjusted via software so there is no need to open the unit. 2.0 MONITOR AND CONTROL ACCESS Each unit is provided with both a local and a remote serial interface. Monitor and control of the unit is performed through these ports. A robust command protocol set is available at both ports. Status is always accessible at both ports. Control, however, is limited to one port at a time. The unit can be placed under either local or remote control from the local port exclusively. To change the control the proper command must be sent to the local port. The unit defaults to remote control upon power-up. Also, while in Local mode, if thirty minutes of inactivity at the local port expire, remote control is automatically restored. Local control accommodates initial setup and maintenance of the system. The RS232 local interface easily connects to a PC COM port. This prevents local operation from interrupting the polling of a remote host computer. The baud rate and parity of the local port are permanently fixed at 9600 and odd respectively. Remote communication is provided via either an RS485 (2-wire) or an RS422 (4-wire) serial interface to support a multi-drop bus arrangement. The remote interface parameters such as address, baud rate and parity are set from the local port. The message format is identical for both ports. All transmissions are multi-byte sequences beginning with a header byte and ending with a trailer byte followed by a checksum byte. The transmitted bytes are all ASCII printable characters in the range of 20H to 7EH. MITEQ provides software for local setup and operation of the unit. This document outlines the communication protocol information necessary for the development of remote monitor and control applications. Some of the command sequences apply to only one of the ports. 3.0 LOCAL OPERATION Upon Power-up the green power LED will be lit, and the unit will be in remote control mode. During operation, the red alarm LED will light whenever a component fault exists. The unit is supplied with an RS232 local interface port. Status is always available locally. The unit can be placed under local control by sending the appropriate command to the local port only. If the unit is under local control and the local port is inactive for more than thirty minutes, remote control is automatically restored. MITEQ provides local monitor and control software that can be run on an IBM compatible PC. The local message format is identical to the remote format. Local communication is fixed at 9600 baud and odd parity. The remote address, baud rate, and parity are set from the local port during initial setup. In order to maintain consistency with the remote message format, the address byte must be included in local communications, however, it is ignored. All messages to the unit are acknowledged with a response message. The unit continually monitors the local communications bus and will acknowledge messages addressed to it. When in Remote mode, receipt of any SET commands (commands beginning with “$”) at the local port will be ignored and the unit will respond with an error code. 4.0 REMOTE OPERATION The unit is supplied with an RS485 remote interface or, as an option, can be supplied with RS422. The command structures for all of these serial buses are identical. Status is always available at the remote port regardless of which port is in control. Remote or local control cannot be selected from the remote port. This function is available at the local port only. If the unit is inadvertently left in local control mode, after thirty-minutes of inactivity at the local port, remote control will be automatically restored. All messages addressed to the unit are acknowledged with a response message. The unit continually monitors the remote communication bus and will accept commands, addressed to it, even in Local mode. When in Local mode, receipt of any SET commands (commands beginning with “$”) at the remote port will be ignored and the unit will respond with an error code. 2 5.0 LOCAL/REMOTE COMMUNICATIONS 5.1 LOCAL/REMOTE MESSAGE PROTOCOL (RS232/RS485/RS422) The data format is a 10-bit sequence for each character. If odd or even parity is selected the ten bits are 1 Start, 7 Data, 1 Parity, and 1 Stop bit. If the parity is set to none, the bits are 1 Start, 8 Data, and 1 Stop bit. The local address character must be included in all local messages but is ignored. The local baud rate and parity are fixed at 9600 and odd respectively. The remote Address, Baud Rate, and Parity are programmable from the local control port. If any character in a command message contains an error in parity, framing, overrun, or the checksum is incorrect, the command is ignored and no response is made. When odd or even parity is selected, all characters, including the checksum character, are checked for parity. The response time from command to acknowledge is 100 ms. maximum. 5.2 MESSAGE FORMAT The message format is as follows: HEADER - UNIT ADDRESS - COMMAND/ERROR CODE PARAMETERS - TRAILER - CHECKSUM The response time from command to acknowledge is 100 ms. maximum. Since all bytes are ASCII printable characters, a compatible terminal may be used to control the unit or monitor traffic on the communication bus. 5.2.1 HEADER BYTE The Header byte is 7BH, ASCII character "{". 5.2.2 UNIT ADDRESS The unit may take on the address values from 64 to 95 (40H to 5FH). 3 5.2.3 COMMAND CODE SUMMARY COMMAND CODES ASCII Character String Function REV Firmware title and revision CLK Internal Calendar and Clock TMP Internal Thermometer reading VLT System Voltages STA Unit Status ALR Unit Alarm Status FRQ Unit LO Frequency ATT Unit Output Attenuation ATI Unit Input Attenuation COM Unit Combination Command MUT Unit Mute MEM Store/Recall Memory register SET Store/Recall Memory register and set unit LOG Unit LOG functions REM Remote/Local mode BUS Remote bus selection SPD Remote baud rate selection PAR Remote parity selection ADR Remote address selection REF Reference Frequency Adjust FRS Reference Frequency Source NAM Unit Name 4 5.2.4 ERROR CODES ASCII Character Function a Command not recognized b Illegal parameter or parameter out of range c Port does not have control rights d Busy 5.2.5 PARAMETERS Parameters are all ASCII printable characters in the range of 20H to 7EH. Numeric parameters are sent MSD first, LSD last. Values which do not adhere to the command format, or are beyond the allowable range, will be rejected and cause the unit to respond with an error code. 5.2.6 TRAILER BYTE The Trailer byte is 7DH, ASCII character "}". 5.2.7 CHECKSUM BYTE The checksum byte is the sum modulo 95 of all message characters beginning with the header byte up to and including the trailer byte. The value 32 is subtracted from each character value before taking the modulo 95 sum. The value 32 is added to the final sum to obtain the checksum value. All values are in decimal. Checksum = MOD [(character value - 32), 95] + 32 Below is a program, written in the ‘C’ programming language that illustrates the checksum calculation. /* return the checksum character for the message in array subtract 32 from each character before taking modulo 95 sum add 32 to the final sum mes_len = message length */ char check_sum(char *array, char mes_len) { char i,sum; for (i = 0, sum = 0; i < mes_len; i++) { sum += *array++ - 32; sum %= 95; } return(sum + 32); } 5 5.3 COMMAND CODE DESCRIPTION The following paragraphs describe each of the command codes. For clarity the header, address, trailer and checksum characters are not shown. Upper case letters are the actual command or response characters. Lower case letters represent parameter character strings. Commands preceded by “?” are QUERY commands and those commands preceded by “$” are SET commands. QUERY commands are used to examine system parameters while SET commands are intended to modify system parameters. Below is a detailed description of the protocol required for each of the commands and replies. 5.3.1 FIRMWARE TITLE AND REVISION = REV There is no SET command. The QUERY command requires no parameters. Remote Command Sequence: ?REV Unit Response: ?REV firmware title and revision The length of this reply will vary depending on the title of the applicable firmware 5.3.2 INTERNAL CALENDAR AND CLOCK = CLK The SET command requires a 12-character parameter, which sets the date and time of the Internal Calendar and Clock. Remote Command Sequence: $CLKyymmddhhnnss Unit Response: $CLK The QUERY command requires no parameters. Remote Command Sequence: ?CLK Unit Response: ?CLKyymmddhhnnss yy: Year, 2 digit ASCII numeric characters, MSD first, LSD last. mm: Month, 2 digit ASCII numeric characters dd: Day, 2 digit ASCII numeric characters hh: Hour, 2 digit ASCII numeric characters nn: Minute, 2 digit ASCII numeric characters ss: Second, 2 digit ASCII numeric characters 6 5.3.3 INTERNAL THERMOMETER READING = TMP There is no SET command. The QUERY command requires no parameters. Remote Command Sequence: ?TMP Unit Response: ?TMPsttt s: “+” or “-“ indicating sign. ttt: Temperature in degrees Celsius, 3 digit ASCII numeric characters 5.3.4 SYSTEM VOLTAGES = VLT There is no SET command. The QUERY command requires a one-digit parameter indicating the voltage to be reported. Remote Command Sequence: ?VLTx Unit Response: ?VLTxsvv.vv x: “a” through “p” indicating the particular voltage to be reported. s: “+” or “-“ indicating sign. vv.vv: Four-digit ASCII numeric characters, indicating the measured voltage in Volts. a: b: c: d: e: f: g: h: +24.00 Volt Supply Rail +20.00 Volt Supply Rail +5.00 A Volt Supply Rail +5.00 B Volt Supply Rail -15.00 Volt Supply Rail* N/A N/A N/A i: N/A j: N/A k: N/A l: Downconverter RF Phase Voltage m: N/A n: N/A o: N/A p: Auxiliary Voltage *(If applicable) 7 5.3.5 UNIT STATUS = STA There is no SET command. The QUERY command requires no parameters. Remote Command Sequence: ?STA Unit Response: ?STAFffffffffTttt(Aaaa)LlIiMm?abcdefghij F: LO Frequency indicator. fffffff: Eight-digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the frequency in kHz. T: Output Attenuation indicator. ttt: Three-digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the attenuation in tenths of a dB. A: Input Attenuation indicator. Included only on units with input attenuators aaa: Three-digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the attenuation in tenths of a dB. L: Local / Remote mode indicator. l: "0" or "1" ASCII numeric character 0 = Local control 1 = Remote control I: IF indicator. i: "0" ASCII numeric character M: Mute status indicator. m: "0" or "1" ASCII numeric character 0 = not mute 1 = mute. ?: Component Fault Status indicator a-j: "0" or "1" ASCII numeric character 0 = No fault 1 = Fault a-j indicates the status of the component faults described below. 5.3.6 SYSTEM FAULT STATUS = ALR The SET command requires ten parameters of which the first eight and tenth are ignored. The ninth parameter is used to set/clear a user generated test alarm. Remote Command Sequence: $ALRabcdefghij Unit Response: $ALR 8 The QUERY command requires no parameters. Remote Command Sequence: ?ALR Unit Response: ?ALRabcdefghij ?: Component Fault Status indicator a-j: "0" or "1" ASCII numeric character 0 = No fault 1 = Fault a-j indicates the status of the component faults described below. a Power Supply Alarm b Synthesized Local Oscillator Lock Alarm c N/A d N/A e N/A f N/A g N/A h N/A i User Test Alarm j Logged Alarm 5.3.7 UNIT LO FREQUENCY = FRQ The SET command requires one parameter which can be seven or eight digits in length representing the frequency in kHz. A leading zero may be used with frequencies below 10 GHz. If no alarms exist, this command also unmutes the output. Remote Command Sequence: $FRQfffffff(f) Unit Response: $FRQ The QUERY command requires no parameters. The reply will consist of eight digits indicating the frequency in kHz. A leading zero will be used for frequencies less than 10 GHz. Remote Command Sequence: ?FRQ Unit Response: ?FRQffffffff FRQ: LO Frequency indicator fffffff(f): Seven or Eight-digit ASCII numeric characters, MSD transmitted first, LSD last indicating frequency in kHz. 5.3.8 UNIT OUTPUT ATTENUATION = ATT The SET command requires a three-digit parameter representing the attenuation in dB. The three-character string “INC” or “DEC” can be used in place of the attenuation parameter to increment or decrement the attenuator by 0.2 dB. This event is logged in unit event log. Remote Command Sequence: $ATTttt or $ATTINC or $ATTDEC Unit Response: $ATT 9 The QUERY command requires no parameters. Remote Command Sequence: ?ATT Unit Response: ?ATTttt ATT: Output Attenuation indicator ttt: Three-digit parameter indicating attenuation in tenths of a dB. INC: Used in place of “ttt” in the SET command to increment the attenuator 0.2 dB DEC: Used in place of “ttt” in the SET command to decrement the attenuator 0.2 dB 5.3.9 UNIT INPUT ATTENUATION = ATI (this command is only valid for units equipped with the optional Input attenuator) The SET command requires a three-digit parameter representing the attenuation in dB. The three-character string “INC” or “DEC” can be used in place of the attenuation parameter to increment or decrement the attenuator by 0.2 dB. This event is logged in unit event log. Remote Command Sequence: $ATIttt or $ATIINC or $ATIDEC Unit Response: $ATI The QUERY command requires no parameters. Remote Command Sequence: ?ATI Unit Response: ?ATIttt ATI: Input Attenuation indicator ttt: Three-digit parameter indicating attenuation in tenths of a dB. INC: Used in place of “ttt” in the SET command to increment the attenuator 0.2 dB DEC: Used in place of “ttt” in the SET command to decrement the attenuator 0.2 dB 5.3.10 UNIT COMBINATION COMMAND = COM The SET command requires three parameters; an LO frequency parameter, an output attenuation parameter, and an input attenuation parameter. Remote Command Sequence: $COMFfffffff(f)Tttt(Aaaa) Unit Response: $COM The QUERY command requires no parameters. Remote Command Sequence: ?COM Unit Response: ?COMFffffffffTtttAaaa F: LO Frequency indicator. Ffffff(f): Seven or Eight digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the frequency in kHz. 10 T: Output Attenuation indicator. ttt: Three digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the attenuation in tenths of a dB. A: Input Attenuation indicator. Included only on units with input attenuators aaa: Three digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the attenuation in tenths of a dB. 5.3.11 UNIT MUTE COMMAND = MUT The SET command requires a one-digit parameter indicating mute or unmute. Remote Command Sequence: $MUTm Unit Response: $MUT The QUERY command requires no parameters. Remote Command Sequence: ?MUT Unit Response: ?MUTm MUT: Mute indicator. 5.3.12 UNIT MEMORY REGISTER STORE/RECALL = MEM The SET command stores LO frequency, output attenuation and input attenuation into a selected memory register. Thus four parameters are required; memory register, LO frequency, output attenuation and input attenuation. This command does not affect unit operation. Remote Command Sequence: $MEMnnFfffffff(f)Tttt(Aaaa) Unit Response: $MEM The QUERY command requires one parameter indicating the memory register to recall and returns the contents of that register. This command does not affect unit operation. Remote Command Sequence: ?MEMnn Unit Response: ?MEMnnFfffffff(f)Tttt(Aaaa)Ii nn: Two digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the memory register accessed. F: LO Frequency indicator. Ffffff(f): Seven or Eight digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the frequency in kHz. T: Output Attenuation indicator. ttt: Three digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the attenuation in tenths of a dB. 11 A: Input Attenuation indicator. Included only on units with input attenuators aaa: Three digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the attenuation in tenths of a dB. 5.3.13 UNIT MEMORY REGISTER STORE/RECALL AND SET = SET The SET command stores LO frequency, output attenuation and input attenuation into a selected memory register. Thus four parameters are required; memory register, LO frequency, output attenuation and input attenuation. The unit is set to the parameters included in the command. Remote Command Sequence: $SETnnFfffffff(f)Tttt(Aaaa) Unit Response: $SET The QUERY command requires one parameter indicating the memory register to recall and returns the contents of that register. The unit is set to the parameters included in the reply. Remote Command Sequence: ?SETnn Unit Response: ?SETnnFfffffff(f)Tttt(Aaaa)Ii nn: Two digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the memory register accessed. F: LO Frequency indicator. fffffff: Seven or Eight digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the frequency in kHz. T: Output Attenuation indicator. ttt: Three digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the attenuation in tenths of a dB. A: Input Attenuation indicator. Included only on units with input attenuators aaa: Three digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the attenuation in tenths of a dB. 12 5.3.14 UNIT EVENT LOG = LOG The only SET command clears the unit log of its contents. Remote Command Sequence: $LOG00 Unit Response: $LOG The QUERY command requires a two-digit parameter indicating the log entry to be examined. If entry 00 is selected, the unit returns the number of log entries currently in the log, otherwise the unit responds with the date, time and a code indicating the event which has occurred. Remote Command Sequence: ?LOGnn Unit Response: ?LOGnnCyymmddhhnnssEee nn: Two digit ASCII numeric characters, MSD transmitted first, LSD last. Indicating the log entry queried. C: Calendar/Clock indicator yy: Year, two digit ASCII numeric characters, MSD transmitted first, LSD last. mm: Month, 2 digit ASCII numeric characters dd: Day, 2 digit ASCII numeric characters hh: Hour, 2 digit ASCII numeric characters nn: Minute, 2 digit ASCII numeric characters ss: Second, 2 digit ASCII numeric characters E: Event indicator. cc: Event Code 01 to 99 represent the following: 01: 02: 04: 06: 08: 10: 14: 16: 26: 29: 31: 33: Processor Startup +24V Power Supply Fault +15V Power Supply Fault +5V A Power Supply Fault +5V B Power Supply Fault -15V Power Supply Fault Synthesizer Lock Fault Synthesizer Level Fault LO Frequency Change Unit Mute By Operator Test Alarm Activated By Operator Unit Name Change 03: 05: 07: 09: 11: 15: 17: 27: 30: 32: 34: +24V Power Supply Fault Recovery +15V Power Supply Fault Recovery +5V A Power Supply Fault Recovery +5V B Power Supply Fault Recovery -15V Power Supply Fault Recovery Synthesizer Lock Fault Recovery Synthesizer Level Fault Recovery Output Attenuation Change Unit Unmute By Operator Test Alarm Deactivated By Operator Input Attenuation Change 13 5.3.15 UNIT REMOTE/LOCAL CONTROL MODE = REM The SET command applies to the local port only. It requires a one-digit parameter indicating remote or local control. If the unit is in local mode and the local control port is idle for more than thirty minutes the unit will automatically switch into remote control mode. Remote Command Sequence: $REMr Unit Response: $REM The QUERY command requires no parameters and is available from both ports. Remote Command Sequence: ?REM Unit Response: ?REMr r: "0" or "1" ASCII numeric character 0 = Local control mode 1 = Remote control mode 5.3.16 REMOTE CONTROL BUS SELECTION = BUS The SET command requires a one-digit parameter indicating the remote bus selection. This command is available from the local port only. Remote Command Sequence: $BUSb Unit Response: $BUS The QUERY command requires no parameters. Remote Command Sequence: ?BUS Unit Response: ?BUSb b: "0" or "1" ASCII numeric character 0 = RS485 (two-wire, half duplex) 1 = RS422 (four-wire, full duplex) 5.3.17 REMOTE PORT BAUD RATE SELECTION = SPD The SET command requires a one-digit parameter indicating the remote baud rate. This command is available from the local port only. Remote Command Sequence: $SPDb Unit Response: $SPD The QUERY command requires no parameters. Remote Command Sequence: ?SPD Unit Response: ?SPDb b: "0" through "6" ASCII numeric character 0 = 300 4 = 4800 1 = 600 5 = 9600 2 = 1200 6 = 19200 3 = 2400 14 5.3.18 REMOTE PARITY SELECTION = PAR The SET command requires a one-digit parameter indicating the remote parity. This command is available from the local port only. Remote Command Sequence: $PARp Unit Response: $PAR The QUERY command requires no parameters. Remote Command Sequence: ?PAR Unit Response: ?PARp b: "0" through "6" ASCII numeric character 0 = Odd 1 = Even 2 = None 5.3.19 REMOTE ADDRESS SELECTION = ADR The SET command requires a two-digit parameter indicating the remote bus address in decimal. This command is available from the local port only. Remote Command Sequence: $ADRaa Unit Response: $ADR The QUERY command requires no parameters. Remote Command Sequence: ?ADR Unit Response: ?ADRaa aa: "64" through "95" ASCII numeric characters indicating address. 5.3.20 REFERENCE FREQUENCY ADJUSTMENT = REF The SET command requires a four-digit parameter indicating the twelve-bit reference frequency adjustment from 0 to 4095. Remote Command Sequence: $REFaaaa Unit Response: $REF The QUERY command requires no parameters. Remote Command Sequence: ?REF Unit Response: ?REFaaaa aaaa: Reference frequency adjustment (0000 to 4095) in ASCII numeric characters. 15 5.3.21 REFERENCE FREQUENCY SOURCE = FRS There is no SET command. The QUERY command requires no parameters. Remote Command Sequence: ?FRS Unit Response: ?FRSn n: "0" or "1" ASCII numeric character 0 = Internal Reference 1 = External Reference 5.3.22 UNIT NAME = NAM The SET command requires an ASCII string from one to seventy-two digits in length indicating the name of the unit. Allowable characters are in the range of 20H to 7AH. Remote Command Sequence: $NAMnnnnnnnnnn... Unit Response: $NAM The QUERY command requires no parameters. Remote Command Sequence: ?NAM Unit Response: ?NAMnnnnnnnnnn... nnnnnnnnnn...: Seventy-two character unit name. 16 6.0 INTERFACE CONNECTIONS 6.0.1 AC POWER CONNECTIONS J5-Pin Signal 1 2 3 4 AC HOT AC NUETRAL CHASSIS GROUND NO CONNECTION 6.0.2 RS422/485 REMOTE INTERFACE AND SUMMARY ALARM CONNECTIONS J3-Pin Signal A E J K Data Out – Data In Data Out + Data In + (Internally connected to J7-E) (Internally connected to J7-C) (Internally connected to J7-D) (Internally connected to J7-B) B C D DOWNCONVERTER SUMMARY ALARM NORMALLY CLOSED DOWNCONVERTER SUMMARY ALARM COMMON DOWNCONVERTER SUMMARY ALARM NORMALLY OPEN For RS485 two-wire party line operation Data In + must be connected to Data Out +, and Data In - must be connected to Data Out -. These can be connected using the internal control board jumpers J6C and J6D or wired externally. To simplify multi-drop wiring, the RS485 / RS422 remote interface pins called out on J3 are internally connected to the pins called out on J7. Form C contacts are provided to indicate the operational status of each converter. Status: Normal: Fault: J3-B to J3-C closed, J3-D to J3-C open. J3-B to J3-C open, J3-D to J3-C closed. 6.0.3 RS232 LOCAL INTERFACE CONNECTIONS J5-Pin Signal A B C D E F Chassis Ground RD TD CTS RTS No Connection CTS and RTS are connected together with an internal control board jumper J6E. This jumper can be removed to use the RTS / CTS handshaking. M:\TECHNOTE\25T052.DOC 17