Fuji Electric ZAF Instruction Manual

Fuji Electric ZAF Instruction Manual

Thermal conductivity gas analyzer communication functions (modbus)

Advertisement

Quick Links

Instruction Manual
THERMAL CONDUCTIVITY
GAS ANALYZER
COMMUNICATION
FUNCTIONS (MODBUS)
TYPE:ZAF
INP-TN513974a-E

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ZAF and is the answer not in the manual?

Questions and answers

Summary of Contents for Fuji Electric ZAF

  • Page 1 Instruction Manual THERMAL CONDUCTIVITY GAS ANALYZER COMMUNICATION FUNCTIONS (MODBUS) TYPE:ZAF INP-TN513974a-E...
  • Page 2: Table Of Contents

    CONTENTS 1. COMMUNICATION FUNCTIONS ....................1 1.1 General..............................1 2. SPECIFICATIONS ........................2 2.1 Communication specifications......................2 3. CONNECTION..........................3 3.1 Terminal allocation (Input/output terminal CN2) ................3 3.2 Connection ............................3 4. SETTING OF COMMUNICATION CONDITION ..............4 4.1 Set items..............................4 4.2 Setting operation ..........................4 5. MODBUS COMMUNICATION PROTOCOL................5 5.1 General..............................5 5.2 Composition of message ........................6 5.3 Response of slave station ........................8...
  • Page 3: Communication Functions

    COMMUNICATION FUNCTIONS General • This instrument provides a communication function through RS-232 interface, which allows data transmit to or receive from the host computer and other devices. • The communication system is comprised of a master station and slave stations. One slave station (this instrument) can be connected to one master station.
  • Page 4: Specifications

    SPECIFICATIONS Communication specifications Item Specification Electrical specification Based on EIA RS-232 Transmission system 2-wire, semi-duplicate Synchronizing system Start-stop synchronous system Connection format 1 : 1 Number connectable units 1 unit (or 31 if RS-485 interface is used) Transmission speed 9600bps Data format Data length 8 bits...
  • Page 5: Connection

    CONNECTION WARNING For avoiding electric shock and malfunctions, do not turn on the power supply untill all wiring have been completed. Terminal allocation (Input/output terminal CN2) Terminal number Signal name Pin connection Recive Data Transmit Data 9-pin D-Sub Signal GND (male) Others Connection...
  • Page 6: Setting Of Communication Condition

    SETTING OF COMMUNICATION CONDITION In order that the master station and instrument can correctly communicate, following settings are required. • All communication condition settings of the master station are the same as those of instruments. • All instruments connected on a line are set to "Station Nos. (STno)" which are different from each other. (Any "Station No."...
  • Page 7: Modbus Communication Protocol

    MODBUS COMMUNICATION PROTOCOL General The communication system by the MODBUS protocol is that the communication is always started from the master station and a slave station responds to the received message. Transmission procedures is as shown below. The master station sends a command message to a slave station. The slave station checks that the station No.
  • Page 8: Composition Of Message

    Composition of message Command message and response message consist of 4 fields ; Station No., Function code, Data and Error check code. And these are send in this order. Station No. (1 byte) Function code (1 byte) Data (2 to 133 bytes) Error check code (CRC-16) (2 bytes) Fig.
  • Page 9 Error check code This is the code to detect message errors (change in bit) in the signal transmission. On the MODUBUS protocol (RTU mode), CRC-16 (Cycric Redundancy Check) is applied. For CRC calculation method, refer to section 5.5. INZ-TN513974-E...
  • Page 10: Response Of Slave Station

    Response of slave station Response for normal command To a relevant message, the slave station creates and sends back a response message which corresponds to the command message. The composition of message in this case is the same as in section 5.2. Contents of the data field depend on the function code.
  • Page 11: Function Code

    Function code According to MODBUS protocol, register numbers are assigned by function codes. Each function code acts on specific register number. This correspondence is shown in Table 5-2, and the message length by function is shown in Table 5-3. Table 5-2 Correspondence between function codes and objective address Function code Resister No.
  • Page 12: Calculation Of Error Check Code (Crc-16)

    Calculation of error check code (CRC-16) CRC-16 is the 2-byte (16-bits) error check code. From the top of the message (station No.) to the end of the data field are calculated. The slave station calculates the CRC of the received message, and does not respond if the calculated CRC is different from the contents of the received CRC code.
  • Page 13 Start Explanation of variables CR:CRC error check data (2 bytes) I:Digits of calculation characters Set FFFF (hexadecimal number) in CR. in command message J:Check on the number of times of CR calculation Set 1 in I. Exclusive logical sum (XOR) is executed with CR and one character (1 byte) of #I of the message, and its results is set in CR.
  • Page 14: Transmission Control Procedure

    Transmission control procedure Transmission procedure of master station The master station must proceed to a communication upon conforming to the following items. (1-1) Before sending a command message, provide 48 bits time or more vacant status. (1-2) For sending, the interval between bytes of a command message is below 24 bits time. (1-3) Within 24 bits time after sending a command message, the receiving status is posted.
  • Page 15 Space time of longer than 5ms is needed (longer than 10ms is recommended) Master station → Analyzer POL1 POL2 1 to 30msec Master station ← Analyzer POL1 response data Data on line POL1 POL1 response data POL2 INZ-TN513974-E...
  • Page 16: Details Of Message

    DETAILS OF MESSAGE Read-out of word data [Function code:03 Function code Max. word number read-out in Relative data address Resister No. Contents one message User setting 64 words 0000 40001-40036 -0023 Message composition Command message composition (byte) Response message composition (byte) Station No.
  • Page 17 Message transmission (example) The following shows an example of reading out from No. 1 station the setting range-1 zero and span calibration concentration. Relative address of range-1 zero calibration concentration setting: 0000 Data number: 02 Command message composition (byte) Response message composition (byte) Station No.
  • Page 18: Read-Out Of Read Only Word Data

    Read-out of read only word data [Function code:04 Function Max. word number read-out in Relative data address Resister No. Contents code one message Measurement value and 0000 30001-30105 -0068 64 words status Message composition Command message composition (byte) Response message composition (byte) Station No.
  • Page 19 Message transmission (example) The following shows an example of reading out from No. 1 station the measurement concentration, decimal point position and measurement unit. Relative address of measurement concentration: 0000 Data number: 02 Command message composition (byte) Response message composition (byte) Station No.
  • Page 20: Write-In Of Word Data (1 Word) [Function Code:06 H ]

    Write-in of word data (1 word) [Function code:06 Function code Max. word number write-in Relative data address Resister No. Contents in one message User setting 0000 40001-40036 -0023 1 word Operation command 07D0 42001-42003 -07D2 Message composition Command message composition (byte) Response message composition (byte) Station No.
  • Page 21: Write-In Of Continuous Word Data [Function Code:10 ]

    Write-in of continuous word data [Function code:10 Function code Max. word number write-in Relative data address Resister No. Kind of data in one message User setting 64 words 0000 -0023 40001-40036 Message composition Command message composition (byte) Response message composition (byte) Station No.
  • Page 22 Message transmission (example) The following shows an example of writing the CH1 (1st component) alarm settings to No. 1 station. Range1 alarm 1-step set value = 07D0 (= 2000 Range1 alarm 2-step set value = 03E8 (= 1000 Range2 alarm 1-step set value = 0384 (= 900 Range2 alarm 2-step set value = 0064 (= 100...
  • Page 23: Address Map And Data Format

    ADDRESS MAP AND DATA FORMAT Data format 7.1.1 Transmission data format The MODBUS protocol used in this instrument is RTU (Remote Terminal Unit) mode. Transmitted data is "numeric value" and not ASCII code". 7.1.2 Handling of decimal point position and measurement unit When transmitted, the calibration concentration setting, alarm's high and low limits and measurement concentration data have no decimal point nor measurement unit.
  • Page 24 (b) Measurement concentration (register No. 30001) The decimal point position for each concentration are stored in registers following that of concentration, and can be known by reading them in. The meaning of decimal point position data and measurement unit data values are the same as in (a) above.
  • Page 25: Address Map

    Address map For details of functions and settable ranges of different parameters, refer to the instruction manual for the analyzer. Word data [read-out/write-in]: Function code [03 , 06 , 10 User settings Remarks Relative Register Data Memory contents Read/Write data Corresponding address type...
  • Page 26 Word data [read-out/write-in]: Function code [03 , 06 , 10 User settings Remarks Relative Register Data Memory contents Read/Write data Corresponding address type parameters 001A 40027 Backlight switch 0: OFF, 1: ON back_light_sw 001B 40028 Backlight out time 5 to 99 minutes back_light_time 001C 40029...
  • Page 27 Word data [read-out only] : Function code[04 User data Remarks Relative Register Data Memory contents Readout data Corresponding address type parameters 0000 30001 Concentration value Concentration value: -9999 to 9999 0001 30002 Decimal point position (Display value equivalent to no 0002 30003 Reserved...
  • Page 28 Word data [read-out only] : Function code[04 User data Remarks Relative Register Data Memory contents Readout data Corresponding address type parameters 0051 30082 Oldest error No -1: Empty, 4 to 9 1 to 7 (Sunday to Saturday) 0052 30083 Oldest error WEEK 0 to 23 (Hour) 0053 30084...
  • Page 29: Supplement To Address Map

    Supplement to address map *(1) Register No. 30017 to 30085 (Error log) From Error log, up to 14 errors occurred in the past can be read sequentially from newer one. The contents are, Error No.: Occurred error number. The stored value is the value decremented by 1 from the error number Error WEEK: Day-of week when the error occurred Error HOUR: Hour when the error occurred...
  • Page 30: Sample Program

    SAMPLE PROGRAM This chapter concerns data read-out/write-in sample program which operates on N88-Japanese BASIC (*2) for PC-9801 (*1) or compatible PCs. Note that the program shown here is for reference for you to create a program and not for guaranteeing all actions. Before executing the program, make sure of the communication conditions in the following procedure.
  • Page 31 (a) Example of data read-out Operation: Read-out CH1 measurement concentration value. (Continuous word read-out from read-out only area) Used function code : 04H Read-out start register No. : 30001 Read-out word number 1000 '------------------------------------------------------- 1010 ' READ CONTINUOUS WORDS SAMPLE PROGRAM 1020 '------------------------------------------------------- 1030 ' 1040 ' Transmission speed = 9600 bps (selected with SPEED command and SWITCH command of MS-DOS)
  • Page 32 1510 '------------- Data receive ---------------------------- 1520 PRINT 1530 LENGTH=LOC(1) 'Number of data in receiving buffer 1540 IF LENGTH=0 THEN PRINT "No answer" :END 1550 PRINT " Receiving data < "; 1560 FOR I=1 TO LENGTH 1570 X$=INPUT$(1,#1) 'Taking data from receiving buffer 1580 CC(I)=ASC(X$) 'Digitizing and storing...
  • Page 33 3010 '------------ CRC calculation ------------------------------ 3020 *CRC.CALC ' For contents, refer to CRC calculation flow chart 3030 CR=&HFFFF 3040 FOR I=1 TO COUNT 3050 CR=CR XOR CC(I) 3060 FOR J=1 TO 8 3070 CT=CR AND &H1 3080 IF CR<0 THEN CH=1 ELSE CH=0:GOTO *CRC.CALC.10 3090 CR=CR AND &H7FFF 3100...
  • Page 34 (b) Data write-in example Operation : Change CH1 measurement range via communication (Single word write-in) Used function code : 06H Write-in register No. : 40026 Write-in data : 1 (changeover from range 1 to range 2) 1000 '------------------------------------------------------- 1010 ' WRITE 1 WORD SAMPLE PROGRAM 1020 '-------------------------------------------------------...
  • Page 35 1510 '------------- Data receive ---------------------------- 1520 PRINT 1530 LENGTH=LOC(1) 'Number of data in receiving buffer 1540 IF LENGTH=0 THEN PRINT "No answer" :END 1550 PRINT "Receiving data < "; 1560 FOR I=1 TO LENGTH 1570 X$=INPUT$(1,#1) 'Taking data from receiving buffer 1580 CC(I)=ASC(X$) 'Digitizing and storing...
  • Page 36: Troubleshooting

    TROUBLESHOOTING If the communication is unavailable, check the following items. Whether all devices related to communication are turned on. □ □ Whether connections are correct. □ Whether the number of connected instruments and connection distance are as specified Whether communication conditions coincide between the master station (host computer) and slave stations □...

Table of Contents