Fuji Electric PHL Operating Manual

PAPERLESS RECORDER COMMUNICATION FUNCTION
(RS-485 MODBUS/Ethernet)
TYPE: PHL
INP-TN513979c-E
Note: MODBUS® is the registered trade mark of AEG Schneider Automaion International.
Note: GW-BASIC, Windows 98 and MS-DOS are registered trademarks of Microsoft Corporation.
NOTICE
1. Exemption items from responsibility
The contents of this document may be changed in the future without prior notice.
We paid the utmost care for the accuracy of the contents. However, we are not liable for direct and
indirect damages resulting from incorrect descriptions, omission of information, and use of
information in this document.

CONTENTS

1. COMMUNICATION FUNCTIONS .....................................................................................................1
1.1 General ...............................................................................................................................................1
1.2 Overview of MODBUS slave communication function (RS-485 interface)......................................1
1.3 Overview of Ethernet communication functions................................................................................2
2. SPECIFICATIONS ...............................................................................................................................3
2.1 Communication Specifications...........................................................................................................3
3. CONNECTION.....................................................................................................................................4
3.1 Communication Terminal Allocation.................................................................................................4
3.2 Wiring.................................................................................................................................................5
SETTING OF COMMUNICATION CONDITION
4.
4.1 Set Items.............................................................................................................................................6
4.2 Setting Operation Method ..................................................................................................................7
5. MODBUS COMMUNICATION PROTOCOL ....................................................................................8
5.1 General ...............................................................................................................................................8
5.2 Composition of Message ....................................................................................................................9
5.3 Response of Slave Station ................................................................................................................11
5.4 Function Code ..................................................................................................................................12
5.5 Calculation of Error Check Code (CRC-16) ....................................................................................13
5.6 Transmission Control Procedure ......................................................................................................14
5.7 FIX Processing (Cautions in data write)...........................................................................................16
6. DETAILS OF MESSAGE...................................................................................................................17
6.1 Read-out of Word Data [Function code: 03
Read-out of Read-out Only Word Data [Function code: 04H]
6.2
6.3 Write-in of Continuous Word Data [Function code: 10
7. ADDRESS MAP AND DATA FORMAT ...........................................................................................23
7.1 Data Format......................................................................................................................................23
7.2 Address Map.....................................................................................................................................25
7.3 Additional Explanation of Address Map..........................................................................................39
.....................................................................................6
] ..................................................................................17
H
.............................................................19
]................................................................21
H
8. SAMPLE PROGRAM ........................................................................................................................48
9. ETHERNET COMMUNICATION FUNCTIONS..............................................................................53
9.1 LAN port specification.....................................................................................................................53
9.2 Connection to the terminal ...............................................................................................................53
9.3 Connection........................................................................................................................................53
9.4 Setting Ethernet communicating conditions.....................................................................................54
9.5 Ethernet communicating conditions setting operation .....................................................................54
10. FTP SERVER FUNCTION.................................................................................................................55
10.1 Description of FTP server function ..................................................................................................55
10.2 Setting FTP server function..............................................................................................................57
10.3 FTP server function setting operation ..............................................................................................57
10.4 FTP server operation ........................................................................................................................58
11. WEB SERVER FUNCTION...............................................................................................................59
11.1 Description of web server function ..................................................................................................59
11.2 Setting web server function..............................................................................................................59
- i -
11.3 Web server function setting operation..............................................................................................59
11.4 Web server operation .......................................................................................................................60
11.5 Web monitor screen .........................................................................................................................60
12. E-MAIL SEND FUNCTION..............................................................................................................63
12.1 Description of E-mail send function ................................................................................................63
12.2 Setting E-mail function ....................................................................................................................63
12.3 E-mail function setting operation.....................................................................................................64
12.4 E-mail send test operation................................................................................................................67
12.5 E-mail send contents ........................................................................................................................67
13. MODBUS TCP/IP FUNCTION .........................................................................................................68
13.1 Description of MODBUS TCP/IP function......................................................................................68
13.2 Setting MODBUS TCP/IP function ................................................................................................. 68
13.3 MODBUS TCP/IP function setting operation..................................................................................68
13.4 MODBUS TCP/IP communication protocol....................................................................................69
14. TROUBLESHOOTING......................................................................................................................71
- ii -
1. COMMUNICATION FUNCTIONS
1.1 General
This equipment provides a communication function (optional) using an RS-485 interface and also a
communication function (optional) using an Ethernet interface.
1.2 Overview of MODBUS slave communication function
(RS-485 interface)
See Chapter 2 through Chapter 8 for the method for use of MODBUS slave communication function in detail.
The MODBUS slave communication function permits exchange of data with host computer, programmable
controller, graphic display panel, etc.
The communication system consists of master station and slave stations. Up to 31 slave stations (PHL) can
be connected per master station.
Note that, because the master station can communicate with only one slave station at a time, a party to
communicate with must be specified by the “MODBUS Station No.” set at each slave station.
In order that the master station and slave station can communicate, the format of the transmit/receive data must
coincide. For the PHL, the format of the communication data is determined by the MODBUS protocol.
Please use an RS-232C RS-485 converter in case of designating a personal computer or other devices which
have an RS-232C interface as a master station. [RS-232C RS-485 converter] (recommended article)
Type: K3SC-10 (isolated type)/ OMRON Corporation.
Programmable controller
RS-485
RS-232C
RS-485
Caution:
When using the RS-232C RS-485 converter, pay attention to cable connection between the converter and
master station. If the cable is not connected correctly, the master station and slave station cannot communicate.
In addition, be careful about communication settings such as baud rate and parity set for the converter.
Personal computer
RS-232C RS-485 converter
- 1 -

1.3 Overview of Ethernet communication functions

See Chapter 10 and Chapter 11 for the method for use of Ethernet communication functions in detail.
The following functions are available as Ethernet communication functions.
(1) FTP server function
Permits take-out of files from the compact flash of the paperless recorder, using personal computer's
browser (Internet Explorer) or DOS prompt.
(2) Web server function
Permits check of measured values and event information recorded in the paperless recorder, using personal
computer's browser (Internet Explorer).
(3) E-mail send function
Permits E-mail transmission in a fixed period and also on occurrence of an alarm.
(4) MODBUS TCP/IP function
Permits exchange of data with host computer, programmable controller, graphic display panel, etc. by
MODBUS TCP/IP communication.
- 2 -
2. SPECIFICATIONS

2.1 Communication Specifications

Item Specification Electrical specification Based on EIA RS-485 Transmission system 2-wire, semi-duplicate Synchronizing system Start-stop synchronous system Connection format 1: N Number connectable units Up to 31 units Transmission distance 500 m max. (total extension distance) Transmission speed 9600, 19200 bps Data format Data length 8 bits Stop bit 1 bit Parity none, even, odd (selectable) Transmission code HEX value (MODBUS RTU mode) Error detection CRC-16
Isolation
Functional isolation between transmission circuit and ground (withstand voltage: 500V AC)
- 3 -
3. CONNECTION
WARNING
For avoiding electric shock and malfunctions, do not turn on the power supply untill all wiring have been completed.
3.1 Communication Terminal Allocation
Signal name
TRX2 – TRX1 +
Communication Terminal
Communication Terminal
Shield
-
TRX2
TRX1 +
- 4 -
3.2 Wiring
Use twisted pair cables with shield.
Recommended eable: UL2464, UL2448, etc.
The total extension length of the cable is up to 500 m. A master station and up to 31 units of the PHL can be
connected per line.
Both ends of the cable should be terminate with terminating resistors 100Ω (1/2W).
The shield wire of the cable should be grounded at one place on the master station unit side.
If the PHL is to be installed where the level of noise applied to the PHL may exceed 1000 V, it is recommended
to install a noise filter in the master station side as below.
Recommended noise filter: ZRAC2203-11/TDK
Master station
(PC, etc.)
RS-232CRS-485
Master station side
Noise filter PHL
Transmission
cable
Slave station (PHL)
FG
RS-485 interface
or RS-485 side of the RS-232C (Recomended converter: K3SC-10/OMRON Corporation)
Twisted pair cable with shield
Terminating resistor 100
(1/2W)
RS-485 converter
TRX1
TRX2
Slave station (PHL)
TRX1
TRX2
Slave station (PHL)
TRX1
TRX2
Terminating resistor 100 (1/2W)
- 5 -
4.
In order that the master station and instrument (PHL) can correctly communicate, following settings are required.
All communication condition settings of the master station are the same as those of instruments (PHL).
All instruments (PHL) connected on a line are set to “ MODBUS Station No.” which are different from each

SETTING OF COMMUNICATION CONDITION

other. (Any “ MODBUS Station No.” is not shared by more than one instrument.)
4.1 Set Items
The parameters to be set are shown in the following table. Set them by operating the front panel keys.
Item
Station No. 1
Transmission speed
Parity setting Odd
Data length
Stop bit
Value at delivery
0 to 255 (0: communication function stop)
19200 bps 9600bps, 19200bps
None: None parity Odd: Odd parity Even: Even parity
8 bit
1 bit
Fixed (can not be changed)
Fixed (can not be changed)
Setting range Remarks
Set a different value to each station.
Set the same communi­cation condition to the master station and all stave stations.
- 6 -

4.2 Setting Operation Method

The following example shows how to set the communication conditions.
Example: Selecting an even parity and “STno=10 and 9600bps” on a station.
Keys used Display Meanings
Trend display Operation state (Trend display)
SEL Menu
Press the [SEL] key to display the Menu screen.
ENT Parameter setting Press the [ENT] key to the Parameter setting screen.
ENT Basic setting
ENT
MODBUS Station NO
Numeric value entering screen
<010>
ENT MODBUS Station NO
ENT
MODBUS baud rate
Baud rate selection screen
9600
ENT MODBUS baud rate
ENT
MODBUS parity
Parity bit selection screen
Even
Press the [ENT] key to the Basic setting screen.
Press the [ key pressed more than six times, use the [
Press the [ENT] key to display the Numeric value entering screen.
Use [<], [>] ,[], or [] key to change the numeric value to 10.
Press the [ENT] key to confirm the MODBUS Station NO. Press the [] key to select the MODBUS baud rate.
] key six times to select MODBUS Station NO. (When the
] key to back)
Press the [ENT] key to display the Baud rate selection screen.
Press the [
Press the [ENT] key to confirm the baud rate. Press the [] key to select the MODBUS parity.
Press the [ENT] key to display the Parity bit selection screen.
Press the [] key to select “Even”.
] key to select “9600”.
ENT MODBUS parity
DISP
ENT
Selection screen for saving the settings
Confirmation screen for saving the settings
ENT Trend display
Power OFF -
Power ON Trend display
Press [ENT] key to confirm the parity bit.
Press the [DISP] key to display a screen asking you want to save the setting.
Press the [ENT] key to save the setting. (The confirmation screen appears.)
The Trend screen appears.
Turn off the power.
Turn on the power once again to complete the setting.
- 7 -

5. MODBUS COMMUNICATION PROTOCOL

5.1 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.
1) The master station sends a command message to a slave station.
2) The slave station checks that the station No. in the received message matches with the own station No. or
not.
3) If matched, the slave station executes the command and sends back the response message.
4) If mismatched, the slave station leaves the command message and wait for the next command message.
a) In case when the station No. in the received command message matches with the own slave station No.
Master to slave
Slave to master
b) In case when the station No. in the received command message mismatches with the own slave station
No.
Master to slave
Slave to master
5) To assure safety, provide a structure where the response message is checked and retry is made three (3)
times or more if no response is made or an error occurs.
The master station can individually communicate with any one of slave stations connected on the same line upon
setting the station No. in the command message.
Command message
Command message
Response message
(Not respond)
Data on
the line
Data on
the line
- 8 -

5.2 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. 5-1 Composition of message
In the following, each field is explained.
(1) Station No
Station No. is the number specifiing a slave station. The command message is received and operated only by
the slave station whose station No. matches with the No. set in the parameter “ MODBUS Station No.”
For details of setting the parameter “ MODBUS Station No.”, refer to chapter 4.
(2) Function code
This is a code to designate the function executed at a slave station.
For details, refer to section 5.4.
(3) Data
Data are the data required for executing function codes. The composition of data varies with function codes.
For details, refer to chapter 6.
A register number is assigned to each data in the recorder. For reading/writing
the data by communication, designate the register number.
Note that the register number transmitted on message is expressed as its relative address.
The relative address is calculated by the following expression.
The lower 4 digits of the
Relative address
For example, when the resister number designated by a function code is 40003,
Relative address = (lower 4 digits of 40003)
= 0002
is used on the message.
=
 
register number
-
1
- 1
 
- 9 -
(1) 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.
- 10 -

5.3 Response of Slave Station

(1) 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. For details, refer to Chapter 6.
(2) Response for abnormal command
If contents of a command message have an abnormality (for example, non-actual function code is designated)
other than transmission error, the slave station does not execute that command but creates and sends back a
response message at error detection.
The composition of response message at error detection is as shown in Fig. 5-2 The value used for function
code field is function code of command message plus 80
Table 5-1 gives error codes.
Station No.
Function code + 80H
Error code
Error check (CRC-16)
.
H
Error code Contents Description
01H Illegal function code Non-actual function code is designated.
02H Illegal data address A relative address of a resister number to which the
03H Illegal data number Because the designation of number is too much,
(3) No response
Under any of the following items, the slave station takes no action of the command message and sends back no
response.
A station number transmitted in the command message differs from the station number specified to the
slave station.
A error check code is not matched, or a transmission error (parity error, etc.) is detected.
The time interval between the composition data of the message becomes longer than the time
corresponding to 24 bits. (Refer to section 5.6 Transmission Control Procedure)
Station No. of a slave station is set to 0.
Fig. 5-2 Response message at error detection
Table 5-1 Error Code
Check for the function code.
designated function code can not be used.
the area where resister numbers do not exist is designated.
- 11 -
5.4 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 Table5-2, and the message length by function is shown in Table5-3.
Table5-2 Correspondence between function codes and objective address

Function code

No. Function Object
03H
04H
10H
Function
code
03H Read-out of word data 64 words 8 8 7 133
04H
10H Write-in of continuous word data 64 words 11 137 8 8
Read-out (continuously) Read-out (continuously) Write-in (continuously)
Contents
Read-out of word data
(read-out only)
Holding register
Input register
Holding register
Table5-3 Function code and message length
Number of
designatable
data
64 words 8 8 7 133
No. Contents
4xxxx Read-out/write-in word data
3xxxx Read-out word data
4xxxx Read-out/write-in word data
Command message Response message
Minimum Maximum Minimum Maximum
Resister No.
[Unit: byte]
- 12 -
r
e

5.5 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.
Fig. 5-3 shows the flow of the CRC-16 calculation system.
Set FFFFH (hexadecimal number) in CR.
Exclusive logical sum (XOR) is executed with CR and one character (1 byte) of the I characters, and its results is set in CR.
Start
Set 1 in I.
Set 1 in J.
Explanation of variables
CR : CRC error check data (2 bytes)
I : Digits of calculation characters
in command message
J : Check on the number of times
of CR calculation
Bit at right end of CR is 1?
YES
Shift CR to right by 1 bit, and A001H and exclusive logical sum (XOR) are executed and its result is set in CR.
Add 1 to J.
NO
NO
Calculation (8 times) is finished?
J>8
YES
Add 1 to I.
Calculation of all characters is completed?
I>All characters
YES
End
NO
Shift CR to right by 1 bit.
(Calculation is executed in the orde of command message station No., function code and data.)
CR calculation result shall be added to the last command message in th order of LOW byte and HIGH byte.
Fig. 5-3 Flow of CRC-16 calculation
- 13 -
5.6 Transmission Control Procedure
(1) 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.
(1-4) Provide 48 bits time or more vacant status between the end of response message reception and
beginning of next command message sending [same as in (1-1)].
(1-5) For ensuring the safety, make a confirmation of the response message and make an arrangement so
as to provide 3 or more retries in case of no response, error occurrence, etc.
Note) The above definition is for most unfavorable value. For ensuring the safety, it’s recommended the
program of the master to work with safety factors of 2 to 3. Concretely, it is advised to arrange the
program for 9600 bps with 10 ms or more for vacant status (1-1), and within 1 ms for byte interval
(1-2) and changeover from sending to receiving (1-3).
(2) Description
1) Detection of the message frame
Since the communication system uses the 2-wire RS-485 interface, there may be 2 statuses on a line below.
(a) Vacant status (no data on line)
(b) Communication status (data is existing)
Instruments connected on the line are initially at a receiving status and monitoring the line. When 24 bits
time or more vacant status has appeared on the line, the end of preceding frame is assumed and, within
following 24 bits time, a receiving status is posted. When data appears on the line, instruments receive it
while 24 bits time or more vacant status is detected again, and the end of that frame is assumed. I.e., data
which appeared on the line from the first 24 bits time or more vacant status to the next 24 bits time or more
vacant status is fetched as one frame.
Therefore, one frame (command message) must be sent upon confirming the following.
(1-1) 48 bits time or more vacant status precedes the command message sending.
(1-2) Interval between bytes of 1 command message is smaller than 24 bits time.
2) Response of this instrument (PHL)
After a frame detection (24 bits time or more vacant status), this instrument carries out processing with that
frame as a command message. If the command message is destined to the own station, a response
message is returned. Its processing time is 300 to 500 ms (depends on contents of command message).
After sending a command message, therefore, the master station must observe the following
(1-3) Receiving status is posted within 24 bits time after sending a command message.
- 14 -
Space time of longer than 5 ms is needed. (longer than 10 ms is recommended.)
Master station
Master station
PHL
Data on line
PHL
POL1
500 ms max
POL1 response data
POL1 POL2 POL1 response data
POL2
- 15 -

5.7 FIX Processing (Cautions in data write)

The instrument is provided inside with a non-volatile memory (F-ROM) for holding the setting parameters.
Data written in the non-volatile memory is not lost even if turning off the power.
To hold parameters that were written in the internal memory via communication after turning off the power, the FIX
process is effective. It allows parameters to be written in nonvolatile memory.
Fig.5-4 shows the FIX procedure.
Cautions:
Write in the non-volatile memory takes approximately 2 seconds.
While writing, do not turn off the power of the PHL. Otherwise, the data in the non-volatile memory will be
destroyed, whereby the PHL could not be used any longer.
Don’t change parameters on the front panel when performing the FIX procedure, or memory error may result.
The non-volatile memory (F-ROM) is a device where the number of write-in times is limited. The
guaranteed number of write-in times of the non-volatile memory used on the instrument is 100,000 minimum.
Therefore, limit the times of change of parameter setting to absolute minimum. Refrain from carrying out
the FIX processing periodically for example or while such is not absolutely required.
Start FIX
Read the FIX data with function code : 03
H
relative address : 1387
No
FIX=0?
Yes
Write ‘1’ into FIX data with function code : 10
H
relative address : 1387
Read the FIX data with function code : 03
H
relative address : 1387
No
FIX=0?
Yes
H
H
H
End FIX
Fig.5-4 FIX procedure
- 16 -

6. DETAILS OF MESSAGE

6.1 Read-out of Word Data [Function code: 03H]

Function code
03H 64 words
Max. word number read-out
in one message
(1) Message composition
Command message composition (byte) Response message composition (byte) Station No. Station No. Function code Function code Read-out start
No.
(relative address)
number
CRC data
* Arrangement of read-out word data
MSB LSB
Upper byte of contents of the first word data
Lower byte of contents of the first word data Upper byte of contents of the next word data Lower byte of contents of the next word data
~
Upper byte of contents of the last word data
Lower byte of contents of the last word data
Upper Read-out byte number Read-out word number×2
Lower Upper
Upper Lower Lower
Upper
(2) Function explanations
Relative data address Register No. Kind of data
0000H to 1386H 40001 to 44999 Storage enable data
to 176FH 45000 to 46000 Storage disable data
1387
H
Contents of the
 
1 to 64
first word data
Contents of the next word data
~~
Contents of the last word data
CRC data
~
Lower Read-out word Upper Lower
Upper
Lower
Lower Upper
Word data of continuous word numbers from the read-out start No. can be read. Read-out word data are
transmitted from the slave station in the order of upper and lower bytes.
- 17 -
(3) Message transmission (example)
Reading range start and range end in Channel 1 from No. 2 station is shown below.
Relative address of range start in Channel 1: 001B
Command message composition (byte) Response message composition (byte) Station No. 02 Function code 03H Function code 03H
Upper 00H Read-out byte number 04H Read-out start No.
(relative address)
number
CRC data
* Meaning of data to be read
Channel 1 Range start 00 00
(contents of the first word data)
Channel 1 Range end 0F A0
(contents of the next word data)
Where the unit is
°C with decimal point position set at 1,
Channel 1 Range start = 0.0
Channel 1 Range end = 400.0
Point
For “Point” decimal point, refer to Section 7.1
Lower 1B Upper 00H Lower 02 Lower B4H Upper 3F
°C
°C
(Register No.40028), Data number: 02H
H
Station No. 02H
H
Upper 00H
H
H
Lower CCH
H
= 0
H
= 4000
H
Contents of the first word data
Contents of the next word data
CRC data
Lower 00H Read-out word Upper 0FH Lower A0H
Upper BBH
- 18 -
6.2

Read-out of Read-out Only Word Data [Function code: 04H]

Function code
04H 64 words 0000H to 07CFH 30001 to 32000
(1) Message composition
Command message composition (byte) Response message composition (byte) Station No. Station No. Function code Function code
Read-out start No.
(relative address)
Read-out word number
CRC data
* Arrangement of read-out word data
MSB LSB
Upper byte of contents of the first word data
Lower byte of contents of the first word data Upper byte of contents of the next word data Lower byte of contents of the next word data
~
Upper byte of contents of the last word data
Lower byte of contents of the last word data
(2) Function explanations
Max. word number read-out
in one message
Upper
Lower
Upper
Lower
Lower
Upper
Read-out byte number Read-out word number×2
Upper
 
1 to 64
Contents of the first word data
Contents of the next word data
~~
the last word data
CRC data
Relative data address Register No.
Lower
Upper
Lower
Upper Contents of
Lower
Lower Upper
~
Word data of continuous word numbers from the read-out start No. can be read. Read-out word data are
transmitted from the slave station in the order of upper and lower bytes.
- 19 -
(3) Message transmission (example)
Reading measured values in Channel 2 from No. 1 station is shown below.
Relative address of measured value in Channel 2: 0065
Command message composition (byte) Response message composition (byte) Station No. 01 Function code 04H Function code 04H
Upper 00H Read-out byte number 02H Read-out start No.
(relative address)
number
CRC data
* Meaning of data to be read
Channel 2 Measured value 01 4F
(contents of the first word data)
Where the unit is °C with decimal point position set at 1
Channel 2 Measured value = 33.5
Point
For “Point” decimal point, refer to Section 7.1.
Lower 65 Upper 00H Lower 01 Lower 21H
Upper D5
°C
(Register No.30102), Data number: 01H
H
Station No. 01H
H
Upper 01H
H
H
H
= 335
H
Contents of the first word data Lower 4FH Read-out word
CRC data
Lower F9H Upper 54H
- 20 -
Loading...
+ 53 hidden pages