You are on page 1of 20

Messung Systems NEXGEN PLC Libraries

NEXGEN Series of PLCs


GOT Library Manual
Document No.:ED-2002-048

Version: 1.0

Published Jan 2003

MESSUNG SYSTEMS
EL-2, J- Block MIDC Bhosari,
Pune – 411026.(INDIA)

Tel: (+91)-020-7120807, 7122807.


Email : marketing@ms.messung.com
WEB: www.messung.com

GOT Library Manual Published Jan 2003


Document No.: ED-2002-048 /V1.0 Page 1 of 20
NEXGEN PLC Libraries Messung Systems

Revision

Version Date Description

1.0 Jan 2003 GOT Library Manual (Nexgen PLC Libraries)

Warning !

The specifications of product and contents of manual are subject


to change without notice.

Published Jan 2003 GOT Library Manual


Page 2 of 20 Document No.: ED-2002-048/V1.0
Messung Systems NEXGEN PLC Libraries

INDEX

1. Introduction .................................................................................................................. 5
2. GOT_SLAVE (FB) ......................................................................................................... 6
2.1 PLC Variables and Range Supported by FB.............................................................. 8
2.2 Memory Mapping for Processor 521x......................................................................... 9
Appendix 1 GOT_ComSet ................................................................................................... 10
Appendix 2 PLC Variables and Range Supported by Processor 521x........................... 13
Appendix 3 Function List Supported by GOT interfaced with Nexgen. ......................... 14
Appendix 4 Commands Supported by FB ......................................................................... 16
Appendix 5 Set Up for GOT................................................................................................. 17

GOT Library Manual Published Jan 2003


Document No.: ED-2002-048 /V1.0 Page 3 of 20
NEXGEN PLC Libraries Messung Systems

Published Jan 2003 GOT Library Manual


Page 4 of 20 Document No.: ED-2002-048/V1.0
Messung Systems NEXGEN PLC Libraries

1. Introduction
The GOT FB library is designed to configure the on-board serial ports of
Nexgen5000 series CPUs as Mitsubishi C 24 protocol slave port. The
Processor modules in Nexgen5000 series, provides up to 3 serial ports with
open protocol feature. The GOT library FB is compatible with all these ports.

• Port 1 – This is basically used as programming port when connected


to CoDeSys. Alternatively, it can also be used in open protocol
mode.
• Port 2 – This port is used as port with open protocol.
• Port 3 – This port is used as port with open protocol.

Depending on the CPU model, Port 1, Port 2 and Port 3 are available. Please
refer to Processor 521x User Manual for model wise features. All the three
serial ports support open protocol and user can communicate with any third
party device using communication driver functions.

In Nexgen5000 series, the Protocol and Application layers in standard OSI


model of communication can be defined by using any of the five IEC
programming languages. The GOT FB library is one of such protocol FBs.
The library consists of FB namely “GOT_SLAVE”.

Highlighting Features of GOT_SLAVE FB

• User need not know the C 24 protocol.


• Communicates with any third party C 24 master.
• Allows exchanging data via I, Q and M devices in Nexgen 5000 PLC.
• Ready to use FB with few parameters to define to go
• Flexibility in station number programming.

These FBs are useful to interface Mitsubishi make Graphic Operator


Terminals (GOTs) as a master. The functions of GOT, serial commands
supported and set up required for GOT for interface with Nexgen 521X is
explained in Appendix 3, Appendix 4 and Appendix 5, respectively.

The subsequent topics discuss how to program and use FB.

GOT Library Manual Published Jan 2003


Document No.: ED-2002-048 /V1.0 Page 5 of 20
NEXGEN PLC Libraries Messung Systems

2. GOT_SLAVE (FB)

This FB handles serial communication with


C 24 protocol as slave device.
The GOT_SLAVE FB is useful to
communicate with Mitsubishi
make Graphic Operator Terminals (GOTs).

Description of Parameters-

Port VAR_IN BYTE This input byte holds communication port number to
be activated with GOT slave FB. It should contain
constant value of 1 or 2 or 3 for Port 1, Port 2, Port
3 respectively. Any other value is invalid.
SNo VAR_IN BYTE This input byte holds the station number. Valid range
is from 0 to 31. For invalid station numbers, FB is not
executed.
Comset VAR_IN_OUT GOT_Comset This is input variable of user defined data type
GOT_Comset. It defines communication parameter
settings like baud rate, parity, operation mode, etc
for a slave device. Appendix 1 provides the details of
various communication parameter settings.
Status VAR_OUT BYTE This output BYTE holds the status of execution
Status.0 This bit is TRUE when port is opened
successfully with the communication
parameters assigned.
Replies VAR_OUT WORD This word holds number of healthy replies send to
the commands received from master. After 65535,
value rolls over to 0.
ErrCount VAR_OUT WORD This word holds number of errors detected in
reception. The number increments by 1 if
• Station number in command received is not
matching with station number defined by SNo.
• CPU type is not matching to Melsec A.
• Command received in invalid. The commands
supported by FB are listed in Appendix 4.
• While reception of any command, necessary
number of bytes are not received in time
duration of 300 ms.
• After reception of any command, calculated
ckecksum is not matching with that of received.
• Command requests for PLC variables which are
out of range for a particular Nexgen 5000
Processor.
In all these cases, earlier received bytes are ignored
and no response is sent.FB looks for next command.

Published Jan 2003 GOT Library Manual


Page 6 of 20 Document No.: ED-2002-048/V1.0
Messung Systems NEXGEN PLC Libraries

Example –

This example shows initialization of communication port 2. Default


communication parameters are 19.2 KBaud, Even parity, 7 data bits, 1 stop
bit and full duplex mode. When EN is TRUE, Port2_Status hold 1 indicating
that port 2 is opened with assigned communication parameters successfully.
If any valid command received is responded successfully, output word
Port2_Replies increments by 1. If any error is observed in reception, output
word Port2_ErrCounter increments by 1. In such errors, slave does not
respond and waits to receive next valid command.

GOT Library Manual Published Jan 2003


Document No.: ED-2002-048 /V1.0 Page 7 of 20
NEXGEN PLC Libraries Messung Systems

2.1 PLC Variables and Range Supported by FB

C 24 protocol accesses PLC variables as X (input bits), Y (output bits),


M ( auxiliary relay bits) and D (Data registers). PLC Variables supported by
GOT_SLAVE FB for read and write operations are listed below along with
the addressing ranges.

Device Mnemonic Range Quantity


Input bits X X0000 to X000F 2048
X0010 to X001F

X07F0 to X07FF
Output bits Y Y0000 to Y000F 2048
Y0010 to Y001F

Y07F0 to Y07FF
Auxiliary Relay bits M M0000 to M8191 8192
Data Registers D D0, D1 to D7935 7936

GOT_SLAVE FB supports commands explained in Appendix 3. If GOT tries


to access devices other than I, Q, M and D (like R, T, C, etc), FB does
respond and communication error is detected.

Published Jan 2003 GOT Library Manual


Page 8 of 20 Document No.: ED-2002-048/V1.0
Messung Systems NEXGEN PLC Libraries

2.2 Memory Mapping for Processor 521x

Processor 5000 supports PLC variables as %I (inputs), %Q (outputs) and


%M (markers). The table in Appendix 1 shows PLC variables supported by
Processor 521x along with the addressing ranges.

The variables supported by GOT_SLAVE FB are mapped in such a way that


PLC variables of Nexgen 5000 Processor can be accessed with UC 24
protocol. The variables I (Input), Q (Output) and M (Marker) are mapped as
X (input), Y (output), M( auxiliary relay bits) and D ( Data registers). The table
below shows the memory mapping of PLC variables.

Nexgen 5000 Processor supports 2048 Input BOOLs from %IX0.0 to %IX255.7.
They are mapped as input devices from X0000 to X07FF.
Variable Range Mapping in X (Input Devices)
Input %IX0.0 to %IX1.7 X0000 to X000F
BOOL %IX2.0 to %IX3.7 X0010 to X001F
%IX4.0 to %IX5.7 X0020 to X002F

%IX255.0 to %IX255.7 X07F0 to X07FF


Nexgen 5000 Processor supports 2048 output BOOLs from %IX0.0 to %IX255.7.
They are mapped as output devices from Y0000 to Y07FF.
Variable Range Mapping in Y (Output Devices)
Output %QX0.0 to %QX1.7 Y0000 to Y000F
BOOL %QX2.0 to %QX3.7 Y0010 to Y001F
%QX4.0 to %QIX5.7 Y0020 to Y002F

%QX255.0 to %QX255.7 Y07F0 to Y07FF


Nexgen 5000 Processor supports 126976 Marker BOOLs from %MX0.0 to
%MX15871.7. Out of this range, 8192 BOOLs from %MX0.0 to %MX1023.7 can be
accessed as M0000 to M8191. The remaining BOOLS up to %MX15871.7 cannot
be accessed.
Variable Range Mapping in M (Auxiliary Relays)
Marker %MX0.0 to %MX0.7 0000 to 0007
BOOL %MX1.0 to %MX1.7 0008 to 0015
%MX2.0 to %MX2.7 0016 to 0031

%MX1022.0 to MX1022.7 8176 to 8183


%MX1023.0 to MX1023.7 8184 to 8191
Nexgen 5000 Processor supports 7936 Marker WORDs from %MW0 to
%MW15870. They are mapped as D0 to D7935.
Variable Range Mapping in D ( Data registers)
Marker %MW0, %MW2 to D0000, D0001 to D7935
WORDs %MW15870

GOT Library Manual Published Jan 2003


Document No.: ED-2002-048 /V1.0 Page 9 of 20
NEXGEN PLC Libraries Messung Systems

Appendix 1 GOT_ComSet

This is user defined data type provided in GOT library. The definition of this
user defined data type along with default values is as shown below.

TYPE GOT_ComSet :
STRUCT
Comset : WORD:=16#1407;
TX_Delay : BYTE ;
RX_Delay :BYTE ;
END_STRUCT
END_TYPE`

First member ComSet defines basic communication parameters. The table


for ComSet explains the communication parameter settings for FBs
‘GOT_SLAVE.’.

Bits F E D C B A 9 8 7 6 5 4 3 2 1 0
ComSet is a word for
Receive Buffer Initialization
Baud Rate Group selection

communication parameter setting.


Various bit combinations in a word
Communication Mode
decides communication
Software Handshake

parameters of a serial port.

No. Of Data Bits


No. Of Stop bits

Baud Rate
Parity

Baud Rate Bits Hexadecimal


Lower byte (Bit 0 to 7) of ComSet Baud Rate
Value
decides the baud rate 7 6 5 4 3 2 1 0
300 0 0 0 0 0 0 0 0 16#0
600 0 0 0 0 0 0 0 1 16#1
1200 0 0 0 0 0 0 1 0 16#2

2400 0 0 0 0 0 0 1 1 16#3

4800 0 0 0 0 0 1 0 0 16#4

9600 0 0 0 0 0 1 0 1 16#5
14400 0 0 0 0 0 1 1 0 16#6
19200 0 0 0 0 0 1 1 1 16#7

28800 0 0 0 0 1 0 0 0 16#8

38400 0 0 0 0 1 0 0 1 16#9

57600 0 0 0 0 1 0 1 0 16#A

115200 0 0 0 0 1 0 1 1 16#B

230400 0 0 0 0 1 1 0 0 16#C

Published Jan 2003 GOT Library Manual


Page 10 of 20 Document No.: ED-2002-048/V1.0
Messung Systems NEXGEN PLC Libraries

F E D C B A 9 8
No. of Data Bits 7 data bits 0
Bit 8 decides number of data bits.
8 data bits 1
Parity No parity 0 0
Bits 9 and A decides parity.
Odd parity 0 1

Even parity 1 0

Invalid 1 1
No. of Stop Bits 1 stop bit 0
Bit B decides number of stop bits
2 stop bit 1
Communication Mode
Bit C decides communication
mode. If half duplex mode is Half duplex 0
selected, reception is disabled
during transmission and vice versa.
For full duplex mode, reception is
possible during transmission and
vice versa. If full duplex mode is
selected for RS-485, echo is
Full duplex 1
received while transmission. User
should take care for handling such
communication.
Software Handshake XON/XOFF control disable 0
Bit D selects software handshake.
XON/XOFF control enable 1
Receive Buffer Initialization No Initialization 0

Initialization at every reception. 1


Baud Rate Group Selection Group 0 ( Normal Mode ) 0
Bit F selects baud rate group.
Group 1 ( Extended Mode ) 1
For baud rate selection, two Baud Normal Mode Extended Mode
combination modes normal and Rate (bF=0) (bF=1)
extended are provided for second Port 2 Port 3 Port 2 Port 3
and third serial port. Mode is
selected considering baud rate 300 Y Y Y Y
required for both communication 600 Y Y Y Y
port 2 and 3. It is not possible to
select two different modes for 1200 Y Y Y Y
communication port 2 and 3. If 2400 Y Y Y Y
different modes are selected for
two ports, second OPENPORT FB 4800 Y Y Y Y
in logic scan is not executed. The 9600 Y Y Y Y
table shows different baud rate
combinations possible for 14400 Y N Y N
communication port 2 and 3. 19200 Y Y Y N
28800 Y N Y N
38400 N N Y Y
57600 Y N Y N
115200 Y N Y N
230400 N N Y N

GOT Library Manual Published Jan 2003


Document No.: ED-2002-048 /V1.0 Page 11 of 20
NEXGEN PLC Libraries Messung Systems

The Comset is initialized to 16#1407. So baud rate is 19.2 Kb, even parity, 7
data bits and 1 stop bit. Normally, these are default settings for GOT. Other
members of user defined data type GOT_ComSet are explained in table
below.

Rx_Delay BYTE Rx_Delay is a delay for starting reception after completion of any
transmission. This delay is active while receiving first byte after any
transmission. It is a character delay and varies according to
communication parameter settings. This is applicable only in half duplex
mode.
Actual time delay = (No. of parity bits+ No. of stop bits for transmission+
No. of data bits)*Rx_Delay / BPS
Tx_Delay BYTE Tx_Delay is a delay for starting transmission after completion of any
reception. This delay is active while transmitting first byte after any
reception. It is a character delay and varies according to communication
parameter settings. This is applicable only in half duplex mode.
Actual time delay = (No.of parity bits+ No. of stop bits for reception+
No. of data bits)* Tx_Delay / BPS

Published Jan 2003 GOT Library Manual


Page 12 of 20 Document No.: ED-2002-048/V1.0
Messung Systems NEXGEN PLC Libraries

Appendix 2 PLC Variables and Range Supported by Processor 521x

Processor 5000 supports PLC variables as %I (inputs), %Q (outputs) and


%M (markers). The table below shows PLC variables supported by
Processor 521x along with the addressing ranges.

Variable Type Data Type Range Quantity


Input BOOL %I X IX0.0 to IX0.7 2048
(X is optional) IX1.0 to IX1.7

IX255.0 to IX255.7
Input WORD %I W IW0, IW2, IW4 to IW254 128
Output BOOL %Q X QX0.0 to QX0.7 2048
(X is optional) QX1.0 to QX1.7

QX254.0 to QX254.7
Output WORD %Q W QW0, QW2, QW4 to QW254 128
Marker BOOL %M X MX0.0 to MX0.7 126976
(X is optional) MX1.0 to MX1.7

%MX15871.0 to %MX15871.7
Marker WORD %M W %MW0, %MW2, %MW4 to %MW15870 7936

GOT Library Manual Published Jan 2003


Document No.: ED-2002-048 /V1.0 Page 13 of 20
NEXGEN PLC Libraries Messung Systems

Appendix 3 Function List Supported by GOT interfaced with Nexgen.

The table below shows the functions supported by GOT for Nexgen
PLC interface marked as ‘Yes’ from the list of all the functions supported.

Mode Function Outline of function Supported


Character display Alphanumeric are displayed. Yes
Drawing Straight lines, circles and rectangles are displayed. Yes
The color of a specified area on the screen is inverted in
Lamp display accordance with the ON/OFF status of the bit devices in the Yes
PLC
Set values and current values of the word devices in the
Graphic display PLC can be displayed in the form of bar graph, line graph or Yes
panel meter.
Current values and set values of the word devices in the
Screen Data change function Yes
PLC can be changed.
mode
The ON/OFF status of bit devices in the PLC is controlled.
Switch function Control can be in the format of momentary, alternate or Yes
set/reset.
The display screen can be changed over. The PLC or touch
Screen changeover Yes
key can be used to change over the display screen.
Data batch transfer Data saved in the GOT can be transmitted to the PLC. Yes
Screens are displayed only when the proper password Is
Security function entered. (This function is also available in the system Yes
screens.)
Programs can be read/written/monitored in instruction list
Program (list) No
program format
Parameters for the program capacity, memory latch range,
Parameter No
etc can be read/written
Buffer memories (BFM) in special blocks can be monitored,
BFM monitor No
and their set values changed.
The ON/OFF status of bit devices as well as current values Yes without
HPP Device Monitor and set values of word devices can be monitored using comment
mode device Nos. and comment expression. expression
Yes without
Current value/ set Current values and set values of word devices can be
comment
value change changed using device Nos. and comment expression.
expression
Forced ON/OFF The bit devices in the PLC can be forced ON or OFF. Yes
State (S) Nos. in the ON status are automatically displayed
State monitor No
for monitoring.
PLC diagnosis Error information in the PLC is read and displayed. No

Published Jan 2003 GOT Library Manual


Page 14 of 20 Document No.: ED-2002-048/V1.0
Messung Systems NEXGEN PLC Libraries

The function list continues.

Mode Function Outline of function Supported


Conditions of up to four devices to be sampled, sampling
Condition setting Yes
start/end time, etc. are set
Sampling
mode Result display The sampling result is displayed in the form of list or graph Yes
Data clear The sampling data is cleared. Yes
The current alarms are displayed in the list in order of
List (status display) Yes
occurrence.

Alarm The alarm history is stored together with the event time, in
History Yes
mode order of occurrence.
Frequency The number of events of each alarm is stored. Yes
History clear The alarm history is cleared. Yes
Screen list User screens are displayed in order of screen No. Yes
The data used in the recipe function (data file transfer
Data file Yes
function) is changed.
Test The operations are checked to know whether key
mode Debug operation operations, screen changeover, etc. have been correctly Yes
performed on the displayed user screen.
Communication The status of communication with the connected PLC is
Yes
monitor displayed.
Time switch The specified bit device is turned ON/OFF at specified time. Yes
The screen data, the data sampling result and the alarm
PC transfer history can be transferred between the GOT and the screen Yes
creation software.
The sampling result and the alarm history can be output to a
Printer output Yes
Other printer
mode
The keyword (password) to protect programs in the PLC can
Keyword No
be registered.
The initial setting can be specified for the system language,
connected PLC, serial transfer, title screen, menu screen
Environment setting Yes
call, current time, backlight extinguishing time, buzzer
volume, LCD contrast, screen data clear, etc

GOT Library Manual Published Jan 2003


Document No.: ED-2002-048 /V1.0 Page 15 of 20
NEXGEN PLC Libraries Messung Systems

Appendix 4 Commands Supported by FB

GOT FB supports commands explained in table below.

Command
Function ASCII Description
Symbol
Code
Device Batch Read Bit JR 4AH, Reads bit devices (X,Y,M) in units of 1
Memory units 52H device
Word QR 51H, Reads bit devices (X,Y,M) in units of 16
units 52H devices
Reads word devices (D) in units of 1
device.
Batch Write Bit JW 4AH, Writes bit devices (X,Y,M) in units of 1
units 57H device
Word QW 51H, Writes bit devices (X,Y,M) in units of 16
units 57H devices
Writes word devices (D) in units of 1
device.
Monitor Data Bit JM 4AH, Sets bit devices to be monitored (X,Y,M)
Registration units 4DH in units of 1 device.
Word QM 51H, Sets bit devices to be monitored (X,Y,M)
units 4DH in units of 16 devices.
Sets word devices to be monitored (D) in
units of 1 device.
Monitor Bit MJ 4DH, Reads data from devices for which device
units 4AH data has been registered.
Word MQ 4DH,
units 51H
Parameter Batch Read PR 50H, Reads parameters from PLC CPU
52H
PC CPU PC CPU Read PC 50H, Reads type of PLC CPU
43H

Published Jan 2003 GOT Library Manual


Page 16 of 20 Document No.: ED-2002-048/V1.0
Messung Systems NEXGEN PLC Libraries

Appendix 5 Set Up for GOT

Certain settings are to be maintained in the GOT to be able to communicate


with the Nexgen 5000 PLC. These settings have to be set in the
configuration mode of the GOT.

Type of PLC Melsec -A


Communication Mode Full Duplex
Station number (DST STA),(GOT STA) 0 to 31
Protocol type ASCII
Handshake OFF
Connection LINK PORT (RS 422)

GOT can be interfaced to Port 2 (RS-422) and Port 3 (RS-422) of Processor


521x. The serial link cable details required are shown below.

Serial Link Cable from GOT port (RS-422) to Processor 521x Port 2 (RS-422)

GOT Processor 521x


9 pin D male Connector 8 pin Mini DIN maleConnector

RX+ TX+
2 7
TX-
7 RX- 4
TX+ RX+
1 2
TX- RX-
6 1
SG GND
5 3, 6

Shield to be connected Shield to be connected


to Earth to Earth

GOT Library Manual Published Jan 2003


Document No.: ED-2002-048 /V1.0 Page 17 of 20
NEXGEN PLC Libraries Messung Systems

Serial Link Cable from GOT port (RS-422) to Processor 521x Port 3 (RS-422)

GOT Processor 521x


9 pin D male Connector 9 pin D male Connector

RX+ TX+
2 3
TX-
7 RX- 2
TX+ RX+
1 4
TX- RX-
6 5
SG GND
5 1
RTS+
8
CTS+ 7
RTS-
9
CTS- 6

Shield to be connected Shield to be connected


to Earth to Earth

The figure below shows the cable connections required for downloading application
program from PC (GT Designer programming software) to GOT.

Serial Link Cable from PC port (RS-232) to GOT port (RS-232)

PC GOT
9 pin D Female Connector 9 pin D Female Connector

RXD TXD
2 3
RXD 2
3 TXD
SG SG
5 5
DSR DTR
6 4
CTS
8
DTR DSR
4 6
CTS
8

Published Jan 2003 GOT Library Manual


Page 18 of 20 Document No.: ED-2002-048/V1.0
Messung Systems NEXGEN PLC Libraries

GOT Library Manual Published Jan 2003


Document No.: ED-2002-048 /V1.0 Page 19 of 20
NEXGEN PLC Libraries Messung Systems

MESSUNG SYSTEMS
EL – 2, J - Block, MIDC, Bhosari,
PUNE – 411 026. INDIA
Tel. – (+91) –020 – 712 0807, 712 2807
Fax. – (+91) –020 –712 0391

NEXGEN PLC Libraries


GOT Library Manual

Document No.:ED-2002-048

Published Jan 2003 GOT Library Manual


Page 20 of 20 Document No.: ED-2002-048/V1.0

You might also like