Chapter 1 Outline |
||||||||||||||||||
|
||||||||||||||||||
1.1 Receive and Send Protocols |
||||||||||||||||||
The unit can be controlled with the same messages even if the communication interface, such as GP-IB, RS-232C, and 10BASE-T LAN, is different. (The unit cannot receive or send the messages through these interfaces simultaneously.)
TCP/IP protocol is used in 10BASE-T LAN.
A port number uses '2' 1 column for under the port number that set up it with "the communication setting of instruction manual". For example 8802 are used as a port, in the case that a port number is set up with 880X.
|
||||||||||||||||||
(1) Messages |
||||||||||||||||||
Data received or sent by the interface is called a message. The following are the message types:
|
||||||||||||||||||
|
||||||||||||||||||
►Of these, program messages are those received by the unit from the controller, while response messages are those sent from the unit to the controller. ►Program messages are command messages or query messages.
▪ Command messages are orders for control of the device, such as for making settings or for reset or the like. ▪ Query messages are orders for responses relating to the results of operation, results of measurement, or the state of device settings. ▪ Response messages are sent in response to query program messages. After a query message has been received, a response message is produced the moment that its syntax has been checked.
|
||||||||||||||||||
(2) Command syntax |
||||||||||||||||||
►When no ambiguity would arise, the term "command" is henceforth used to refer to both command and query program messages. (Control commands : HIOKI unique SCPI) ►The unit accepts commands without distinction between lower case and upper case letters.
▪ The names of commands are as far as possible mnemonic. Furthermore, all commands have a long form, and an abbreviated short form. ▪ In command references in this manual, the short form is written in upper case letters, and then this is continued in lower case letters so as to constitute the long form. Either of these forms will be accepted during operation, but intermediate forms will not be accepted. ▪ Further, during operation both lower case letters and upper case letters will be accepted without distinction. ▪ The unit generates response messages in the long form (when headers are enabled) and in upper case letters.
(Example) For "DISPlay", either "DISPLAY" (the long form) or "DISP" (the short form) will be accepted. However, any one of "DISPLA", "DISPL", or "DIS" is wrong and will generate an error.
|
||||||||||||||||||
(3) Command program headers |
||||||||||||||||||
►Commands must have a header, which identifies the command in question. ►There are three kinds of header: the simple command type, the compound command type, and standard command type.
|
||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
(4) Query program headers |
||||||||||||||||||
►These are for commands used for interrogating the unit about the result of an operation or about a setting. ►These can be recognized as queries by a question mark appearing after the program header. ►The structure of the header is identical to that of a command program header, with "?" always being affixed to the last command. There are queries possible in each of the three previously described types of command form.
|
||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
(5) Response messages |
||||||||||||||||||
►Response messages relating to queries are made up from header portions (which also may be absent due to header disablement) and data portions identical to those of program messages, and as a general rule are sent in an identical format to the format of the program message corresponding to their originating query.
|
||||||||||||||||||
|
||||||||||||||||||
(6) Terminators and separators |
||||||||||||||||||
1. Message Terminator A terminator is used in order to separate the transmission of one message from another, and this terminator is not itself included in the message.
[GP-IB interface] LF, EOI, or LF+EOI is used as the message terminator, and LF+EOI is also used as the response message terminator.
[RS232C interface] Set the delimiter for the message terminator. >> Refer to the instruction manual. (the communication setting)
2. Message Unit Separator A semicolon ";" is used as a message unit separator when it is desired to set out several messages on a single line.
|
||||||||||||||||||
|
||||||||||||||||||
3. Header separator With a message which has both a header and data, a space "_" is used as a header separator to separate the header from the data. The space "_" is used by way of explanation, but it does not appear on the actual program.
|
||||||||||||||||||
|
||||||||||||||||||
4. Data separator Commas are used as data separators for separating several data items from one another.
|
||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
(7) The command tree |
||||||||||||||||||
►The rule when writing several messages of compound command form on the same line, when no colon is prefixed to the next header after the semicolon (the message unit separator), is that that header is considered as continuing on from the header before the last colon in the message directly preceding. ►This corresponds to the general concept of the current directory in the directory structure of UNIX or MS-DOS, and this directly preceding header is called the "current path".
(Example 1) :CONF:TDIV 1. E-3;:CONF:SHOT 15 (Example 2) :CONF:TDIV 1. E-3;SHOT 15
▪Both Example 1 and Example 2 are messages setting TIME/DIV to 1 ms and recording length to 15 divisions. ▪With Example 1, because there is a colon directly after the semicolon, the current position is the "root". Accordingly the reference of the next command is performed from the root. ▪On the other hand, with Example 2, because with ":CONF:TDIV 1. E-3;" the current path has become ":CONF", it is now possible to omit the ":CONF:" before "SHOT". ▪To reiterate, the colon at the beginning of a command forces the search for the command to begin from the root. Thus in Example 1:
|
||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
(8) Data format |
||||||||||||||||||
►The unit uses character data, decimal data and character string data as a data format.
Character data1. The first character must be alphabetic. 2. The characters after the first character can only be alphabetic characters, numerals, or underline characters (_). 3. As alphabetic characters, during sending only upper case letters are used, but during receiving both upper case and lower case letters are permitted.
Decimal data▪Decimal data values are represented in what is termed NR format. ▪There are three types of NR format from NR1 to NR3, and each of these can appear as either a signed number or an unsigned number. Unsigned numbers are taken as positive. ▪Further, if the accuracy of a numerical value exceeds the range with which the unit can deal, it is rounded off. (5 and above is rounded up; 4 and below is rounded down.)
|
||||||||||||||||||
|
||||||||||||||||||
▪The term "NRf format" includes all these three formats. ▪When the unit is receiving it accepts NRf format, but when it is sending it utilizes whichever one of the formats NR1 to NR3 is indicated in the particular command.
Character string data▪Character string data is enclosed within quotation marks. 1. The data is composed of 8 bit ASCII characters. 2. Characters that cannot be handled by the unit are replaced by spaces. 3. When the unit is sending, only the double quotation mark (") is used as a quotation mark, but when receiving both this double quotation mark and also the single quotation mark (’) are accepted.
|
||||||||||||||||||
|
||||||||||||||||||
1.2 The Status Byte and the Event Registers |
||||||||||||||||||
|
||||||||||||||||||
(1) The status byte |
||||||||||||||||||
►Each bit of the status byte is a summary (logical OR) of the event register corresponding to that bit. ►Further, for GP-IB, the status byte and each event register has an enable register corresponding to it, and according to the setting of this enable register (which starts off at zero when the power is turned on) it is possible to mask the service requests originating from each event. ►For RS-232C, only the values for the status byte, standard event status register, and event status register 0 are valid. The enable register setting has no effect and is disregarded.
|
||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
The following commands are used for reading the status byte, and for setting the service request enable register and for reading it.
Reading the status byte *STB? Setting the service request enable register *SRE (GP-IB) Reading the service request enable register *SRE? (GP-IB)
|
||||||||||||||||||
|
||||||||||||||||||
(2) Standard event status register (SESR) |
||||||||||||||||||
►The summary of this register is set in bit 5 of the status byte. ►For GP-IB, each bit is masked by setting the standard event status enable register (which starts off at zero when the power is turned on). ►The circumstances when the contents of the standard event status register are cleared are as listed below. 1. When the *CLS command is received. 2. When the contents have been read by an *ESR? query. 3. When the power is turned off and turned on again.
|
||||||||||||||||||
|
||||||||||||||||||
►The following commands are used to read the standard event status register, and to set or read the standard event status enable register.
Read the standard event status register *ESR? Set the standard event status enable register *ESE (GP-IB) Read the standard event status enable register *ESE? (GP-IB)
|
||||||||||||||||||
(3) Event status register 0 (ESR0) |
||||||||||||||||||
►The summary of this register is set in bit 0 of the status byte. ►For GP-IB, each bit is masked when the event status enable register 0 (which starts off at zero when the power is turned on) is set. ►The circumstances when the contents of event status register 0 are cleared are as listed below. 1. When the *CLS command is received. 2. When the contents have been read by an :ESR0? query. 3. When the power is turned off and turned on again.
|
||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
►The following commands are used for reading the event status register 0, and for setting the event status enable register 0 and for reading it.
Reading event status register 0 :ESR0? Setting event status enable register 0 :ESE0 (GP-IB) Reading event status enable register 0 :ESE0? (GP-IB)
|
||||||||||||||||||
Status byte data structure |
||||||||||||||||||
|
||||||||||||||||||
Event status register 0 data structure |
||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
(1) Input buffer |
||||||||||||||||||
►The unit has an input buffer of 1024 bytes capacity. ►Messages which are received are put into this buffer and executed in order. However, an ABORT command is executed instantly as soon as it is received.
|
||||||||||||||||||
(2) Output queue |
||||||||||||||||||
►The unit has an output queue of 512 bytes capacity. ►Response messages are accumulated in this queue and are read out from the controller. ►If the length of a response message has exceeded 512 bytes, a query error occurs. ►The circumstances when the output queue is cleared are as listed below: 1. When the controller has read out its entire contents. 2. When a device clear is issued. 3. When the power is turned off and turned on again. 4. Upon receipt of the next message.
|
||||||||||||||||||
►To connect to an existing network, settings may need to be allocated by the network system administrator (IS department) beforehand. This is to avoid duplicating certain settings already allocated to other devices. ►Obtain the following setting information from the administrator (IS department), and write it down:
Host Name (up to 12 characters) IP AddressSubnet MaskDefault Gateway (present or not present, when present) TCP/IP Port NumberYou can set the upper three decimal digits of the port address(the rightmost digit is set internally by this device).
|
||||||||||||||||||
|
||||||||||||||||||
(1) Remote Control |
||||||||||||||||||
GP-IB Errors▪When a command which has been received contains an error, that one of bits 2 to 5 of the standard event status register which corresponds to the event which has occurred is set. ▪Further, if a command has given rise to an error (apart from an execution error), commands accumulated in the input buffer and waiting for execution after that command are ignored.
|
||||||||||||||||||
(2) RS-232C |
||||||||||||||||||
RS-232C Errors
(1) Parity error The parity bit can be set to even parity, odd parity, or no parity. When even or odd is selected, the "1" count is used to detect transmission errors. If the parity count is different at the receiving end, a parity error is returned.
(2) Framing error When counting from the start bit, if the stop bit is "L", a framing error is returned. Possible reason (1): Transmission rate, parity, stop bit or other parameter setting mismatch Possible reason (2): Noise
(3) Overrun error The transmission controller uses double buffering for receiving data (shift buffer for each bit and reception buffer read by the CPU). When there are data in the reception buffer, and the shift register completes reception of the next character before the data are read by the CPU, an overrun error occurs. Because the new data overwrites the previous data in the reception buffer, immediately preceding data are lost. Possible reason (1): Transmission rate is too high. Possible reason (2): Some interrupt inhibit intervals are too long. Possible reason (3): Execution time for higher-priority interrupt is too long, reducing the time available for the receive interrupt.
|
||||||||||||||||||
Flow Control
►The RS-232C interface can transfer data at the selected transfer rate, but if the CPU cannot keep up with the data that are being sent, later data will overwrite data that were received earlier. To prevent this, the receiving side must alert the sending side when the reception buffer is about to become full, so that the transfer can be temporarily paused. This is called flow control. Two types of flow control are possible, namely hardware handshaking and software handshaking.
(1) Hardware handshaking Flow control is performed by setting the signal lines RTS (RS) and CTS (CS) to ON and OFF.
Receiving data When input buffer content exceeds 3/4, RTS is set to Low. When input buffer content falls below 1/4, RTS is set to High.
Sending data When CTS becomes Low, data send is interrupted. When CTS becomes High, data send is resumed.
(2) Software handshaking Flow control is performed using the Xon and Xoff code.
Receiving data When input buffer content exceeds 3/4, D3 (13H) is sent. When input buffer content falls below 1/4, D1 (11H) is sent.
Sending data When D3 (13H) is received, data send is interrupted. When D1 (11H) is received, data send is resumed.
Note: Buffer size is as follows. Input buffer: 1024 bytes Output buffer: 512 bytes
|