Programmable Controller

PLC Board

Controlador Programable

Tarjeta PLC
Controlador Programável

Cartão PLC

User´s guide Guia del usuario Manual do usuário

MANUAL PLC1.01 BOARD
PROGRAMMABLE IN LADDER LANGUAGE BY WLP SOFTWARE

04/2004

PLC1 Software: V1.4X WLP Software: V3.4X 0899.4794 E/2

Summary of Revisions

The table below describes all revisions made to this manual.
Revision 1 Description First Edition Section -

Summary
1 2 Quick Parameter Reference ......................................................... 07 Fault Messages ........................................................................... 26

CHAPTER 1

Introduction
CHAPTER 2

Safety Notices
CHAPTER 3

General Information
CHAPTER

4 5 6

General Characteristics of the PLC1
CHAPTER

Connector Description
CHAPTER

Configuration of the CFW-09 Converter with PLC Board
CHAPTER

7 8 9

Board Installation into the Converter
CHAPTER

Detailed Parameter Description
CHAPTER

WLP
CHAPTER

10 11

WLP Blocks
CHAPTER

RTU - Modbus Protocol in the PLC1

PLC - QUCIK PARAMETER REFERENCE

QUICK PARAMETER REFERENCE, FAULT MESSAGES Software: V1.4X Application: Model: Serial Number: Responsible: Date: /

/

.

The parameter range starts from 750 up to 899, totalizing 150 parameters. The first 50 parameters are predefined by the system or are reserved parameters. The 100 remaining parameters are for general use and may be set by the user. Please find below a description of the parameters defined by the system.

1. PARAMETERS
Parameter P750 P751 P752 (*) P753 (*) P754 P755 Function PLC1 firmware version Scan cycle in 100µs units Resets the retentive markers Loads factory settings , if =1234 Position reference (rotations) Position reference (fraction of rotation) Position signal 0 = negative 1 = positive Real position (rotations) Real position (fraction of rot.) Kp: proportional position gain Ki: Integral position gain Max. lag error Disables user program if =1 PLC address at netwrok Adjustable Range Read Read 0...1 0..65535 Read Read 0 0 rot degrees / 10 x100µs Factory Setting Unit Page

P756 P757 P758 P760 P761 P762 P763 P764 (*)

Read Read Read 0...200 0...200 0...65535 0...1 1...247 1 = 1200bps 2 = 2400bps 3 = 4800bps 4 = 9600bps 5 = 19200bps Read 0...10000 0...65535 0...3599 50 0 0 0 1 rot degrees / 10

degrees / 10

P765 (*)

Baud rate of RS232

4 bits/second

P766 P767 (*) P768 (*) P769 (*)

Status of the Digital Inputs Synchronou speed of the motor in RPM Encoder pulse number Encoder zero pulse position

1800 1024 0

RPM ppr degrees / 10

(*) IMPORTANT: to enable the system to operate according the parameter seeting, the system must be reset after one or more parameters have been changed.

4

PLC - QUCIK PARAMETER REFERENCE

Parameter

Function

Adjustable Range 0=1Mbit/s 1=Reserved 2=500 Kbit/s

Factory Setting

Unit

Page

P772

CAN Baudrate

3=250 Kbit/s 4=125 Kbit/s 5=100 Kbit/s 6=50 Kbit/s 7=20 Kbit/s 8=10 Kbit/s

0

bits/second

P773 P775 P776 P777 P778

Bus off recovery CAN Status Counter of received telegrams Counter of trasmitted telegrams Counter of detected erros

0=Manual 1=Automatic Read Read Read

Read

5

PLC - QUCIK PARAMETER REFERENCE

2. Error Messages

Display

Description

Note

E50 E51

Lag error Error during program saving Two or more movements enabled simultaneously Movement data are not valid

Fatal Error, it disables the converter. Refer to Parameter P762. Reset the systems and try again. Check the user program logic

E52

E53 E54

E55

E56 E57

E58

E61

Perhaps some speed, acceleration value, etc. was reset to zero. Attempt to execute some movement Inverter disabled with disabled inverter Incompatible program Check program and install it again. or out of memory This error also occurs when there is limits no program installed in the PLC (PLC powered-up first time). Wrong CRC Transmit it again. Shaft has not been Before an absolut movement , referenced to absolute you must set the machine movement movement to zero position. Fatal Error: after enabled initial Master Reference communication, between master and Fault slave, by any cause has been disabled. Bus off has been detected on the CAN bus due to a high number of transfer Bus off erros. These erros may be caused due to bus problems or due to improper installation.

Note: In fatal erros, E50 and E58, the inverter is disabled and need restart.

6

CHAPTER

1

INTRODUCTION
The PLC1 board adds important PLC (Programmable Logical Controller) functions to the CFW-09, enabling the execution of complex linkage program by using the digital board inputs and outputs as well as the digital and analog inputs and outputs of the own inverter which can be accessed by the user´s program. Among the several available functions we can mention simple contacts and coils up to functions that uses floating point, such as sum, subtraction, multiplication, division, trigonometry, square root functions, etc. Other important functions are the PID blocks, high-pass and low-pass filters, saturation, comparison. All these functions operate with floating point. Besides the functions mentioned above, the PLC1 provides blocks for motor speed and motor position control, that is a trapezoidal-profile positioning and a S-profile positioning, speed reference generation with trapezoidal acceleration ramp, etc. (Note: when positioning functions used, the coupling of an encoder on motor shaft is required). All functions can interact with the user through the 100 programmable parameters that can be acessed directly through the inverter HMI. The texts and user units of the programmable parameters can be customized by the WLP.

ATTENTION!
The CFW-09 inverter software version should be the version V2.40 or later.

7

CHAPTER

2

SAFETY NOTICES
This Manual contains all necessary information for the correct installation and operation of the PLC1 with the CFW-09 Variable Frequency Drive. The PLC1 Manual has been written for qualified personnel with suitable training of technical qualifications to operate this type of equipment Only qualified personnel should plan or implement the installation, startup, operation and maintenance of the CFW-09 and associated equipment. The personnel must follow all safety instructions included in this Manual and/or defined by the local regulations. Failure to comply with these instructions may result in personnel injury and/or equipmrnt damage.

NOTE!
In this Manual, qualified personnel are defined as people that are trained to: 1. Install, ground, power up and operate the CFW-09, as well as the PLC1 board, according to this Manual and the local safety procedures; 2. Use the safety equipment according to the local regulations; 3. Give first aid.

DANGER!
Always disconnect the supply voltage before touching any electrical component inside the inverter. Many components are charged with high voltages, even after the incoming AC power supply has been disconnected or switched OFF. Wait at least 10 minutes for the total discharge of the power capacitors. Always connect the frame of the equipment to the ground (PE) at the suitable connection point.

ATTENTION!
All electronic boards have components that are sensitive to electrostatic discharges. Never touch any of the electrical components or connectors without following proper grounding procedures. If necessary to do so, touch the properly grounded metallic frame or use a suitable ground strap.

NOTE!
Read this entire Manual carefully and completely before installing or operating PLC1 board with the CFW-09.

8

CHAPTER

3

GENERAL INFORMATION
This chapter defines the contents and purpose of this manual

3.1

ABOUT THIS MANUAL

This manual describes the basic procedures required for the WLP installation, the creation of projects and provides a general view on the block existing in the PLC1. Chapter 1- Introduction Chapter 2 - Safety Notices; Chapter 3 -General Information; Chapter 4 - General characteristics of the PLC1; Chapter 5 -Description of the Connectors; Chapter 6 - Configuration of the CFW-09 converter with PLC board; Chapter 7 - Installation of the board into the converter; Chapter 8 - Detailed Parameter description; Chapter 9 - WLP blocks; Chapter 10 - WLP; Chapter 11 - RTU - Modbus Protocol in the PLC1. This Manual provides information required for the correct use of the PLC1. As the PLC1 is very flexible, it allows many different operation modes as described in this Manual. As the PLC1 can be applied in several ways, it is impossible to describe here all application possibilities of this board. WEG does not assume any responsibility when the PLC1 is not used according to this manual. No part of this Manual may be reproduced in any form, without written consent of WEG.

9

CHAPTER
GENERAL CHARACTERISTICS OF THE PLC1
4.1 Hardware

4

9 isolated digital inputs, bi-directional, 24VDC 3 digital relay output 250V x 3A 3 digital optocoupled outputs, bi-directional, 48VDC x 500mA 1 isolated encoder input, with external supply between 18 and 30VDC Encoder supply - 15VDC x 300mA 1 serial communication interface – RS-232C (standard Protocol: MODBUS-RTU) All sizes compatible with CFW-09 User programming in Ladder language, with specific blocks for positioning and PLC functions It permits the use of digital and analog inputs/ouputs of the CFW-09, comprising 15 digital inputs, 9 digital outputs, 2 analog inputs and 2 analog outputs, accessed by the ladder.

4.2

Software

The Parameter Range comprises the parameter from 750 to 899, totaling 150 parameters. The 50 first parameters are predefined by the system or are reserved parameters. The other 100 remaining parameters are for general use, i. e., they may be programmed by the user and can be used for the most different functions, as contactors, timers, speed, acceleration and position references, etc. BIT and volatile WORD type Markers (initialized at zero) and retentive and volatile FLOAT type markers. The board programming is performed through the WLP 3.3 program or later, in Ladder language.

10

CHAPTER

5

CONNECTOR DESCRIPTION

Connector XC21: Relay outputs and digital inputs
Connector XC21 1 DO1 2 3 DO2 4 5 DO3 6 7 NC 8 NC 9 DI6 10 DI7 11 DI8 12 DI9 13 COM DI Function Specification Contact capacity: 3A 250VAC

Digital relay outputs

Not connected Not connected Input voltage: 15...30VDC Input current: 11mA @ 24VDC

Isolated digital Inputs Common to the inputs DI6...DI9

+ -

+ -

11

CONNECTOR DESCRIPTION

Connector XC22: 24V transistor outputs and digital inputs
Connector XC22 Function Not connected 14 NC 15 COM DO Common to the digital outputs DO4, DO5 e DO6 16 DO6 Bipolar optocoupled digital 17 DO5 outputs 18 DO4 Not connected 19 NC Not connected 20 NC 21 DI1 22 DI2 Isolated digital inputs 23 DI3 24 DI4 25 DI5 26 COM DI Common to inputs DI1...DI5 Specification

+ -

Load

12

+ -

+ -

Max. voltage: 48VDC Current capacity: 500mA

+ -

Input voltage: 15...30VDC Input current: 11mA @ 24VDC

Conector XC3: Profibus of the HMS Board
Enable PLC communication Profibus Network.

Conector XC7: RS-232C
Connector XC7 1 2 3 4 5 6 5VCC RTS GND RX GND TX Function 5VDC supply Request to send Reference Receives Reference Transmits Specification Current capacity: 50mA

Connector XC8: Externa 24VDC input and CANopen network
Connector XC8 21 CAN GND 22 24Vcc Function CAN GND Supply for encoder inout Specification 18..26VDC Drawn current: 25mA + the encoder current.

23 24 25 26 27

CAN L GND ENC CAN H NC CAN 24Vcc 28 NC

CANL 24VDC encoder reference CANH Not connected Network supply CANopen Not connected

18..26VDC 50mA @ 24VDC

CONNECTOR DESCRIPTION

Connector XC9: Incremental Encoder
Applications that require more speed or positioning accuracy, a speed feedback of the motor shaft by means of incremental encoder is required. The inverter connection is realized through the XC9 (DB9) connector of the PLC1 board. The used encoder should have following features: Supply voltage: 15 VDC, with current consumption lower than 200 mA; 2 quadrature channels (90º) + zero pulse with supplementary outputs (differential): Signals A, A, B, B, Z and Z; “Linedriver” type or “Push-Pull” (level 15VDC) circuit; Electronic circuit isolated against encoder frame; Number of pulses recommended per revolution: 1024 ppr; Follow following procedures when encoder is mounted onto motor shaft: couple the encoder onto the motor shaft directly (by using a flexible coupling, but without torsional flexibility); Both motor shaft and metallic encoder frame must be isolated electrically against motor (min. spacing: 3 mm); Use flexible couplings of high quality to prevent mechanical oscillation or “backlash”; For electrical connection use shielded cable and lay it separately (spacing >25cm) from the oher wirings (power, controle cables, etc). If possible, install it inside a metallic conduit. During commissioning, program parameter P202 - control type = 4 (Vector with encoder) to operate the system through speed feedback by incremental encoder..
Encoder connect.***

Connector XC9

Description

red blue yellow green grey rose white brown loop Board PLC1
3 2 1 9 8 7 4 6 5 A A B B Z Z +VE COM Source* Reference 0V** Ground Encoder signal 15V diferencial

A H B I C J D F E G

A A B B Z Z +VE COM NC

Encoder

Max. recommended length: 100m

Connector XC9 (DB9 - male)

* 15V / 220mA power supply for encoder ** Referenced to ground via 1µF in parallel with 1kΩ *** Valid pin location for encoder HR526xxxxB5-Dynapar. When other encoder models are used, check the correct connection to meet the required sequence.

NOTE!
The max. permitted encoder frequency is 100kHz.

13

CONNECTOR DESCRIPTION

Required sequence for encoder signals:

B

t

A Motor is running clockwise

t

Jumper XC10: Firmware download
Jumper XC10 Normal Operation Firmware download

Open Closed

Jumper XC11: Encoder error
Jumper XC11 Enables encoder error generation Does not generate encoder error

Open Closed

14

CHAPTER

6

CONFIGURATION OF THE CFW-09 CONVERTER WITH PLC BOARD
Control type (P202):
For the blocks that generate speed reference (JOG and SETSPEED), you can use the converter in ‘Sensorless’ (P202=3) mode. Please consider that in this operation mode there is no high precision at low speed. In addition, the position gain Kp (P760) should be reset to zero to prevent instability when the motor is disabled. For the position blocks (TCURVE and SCURVE), the inverter must be operated in vector mode with encoder (P202 = 4). Important notes: always when possible, use the vector mode with encoder; avoid scalar mode operation (V/F), if the PLC will generate speed reference; Check the correct setting of the P161 and P162 parameters that are the proportional speed gain and the integral speed gain, respectively. The correct setting of these parameters are very important for a good inverter performance.

Local / Remote Selection (P220):
When the PLC is used as movement generator, this option must be set to ‘Always Local’ (P220=0).

Local Reference Selection (P221):
When the PLC is used as movement generator, this option must be set to ‘PLC’ (P221=11), i. e., the speed reference will be given by the PLC board.

Local Run/Stop Selection (P224)
To enable the PLC to control the converter through the run/stop options and also enable the PLC to disable the drive, this option must be set to ‘PLC’ (P224=4).

AO1 Output Function (P251):
To enable the PLC to control the analog inverter output 1 (AO1), set P251=12. Note that P252 is the gain of the analog output 1.

AO2 Output Function (P253):
To enable the PLC to control the analog inverter output 2 (AO2), set P253=12. Note that P254 is the gain of the analog output 2.

Entradas digitais DI101...DI106, P263...P268:
These parameters correspond to the digital inverter inputs DI1...DI6 and they are read by the PLC, independent of the functions programmed at the parameters P263...P268.

15

CONFIGURATION OF THE CFW-09 CONVERTER WITH PLC BOARD

Digital Relay Outputs DO101...DO103, P277, P279 and P280:
These Parameters correspond to the RL1...RL3 drive outputs. To enable the PLC to control these outputs, you must set these parameters to the function ‘PLC’, i. e. P277=27, P279=27 and P280=27.

16

CHAPTER

7

BOARD INSTALLATION INTO THE INVERTER

PLC Board

CC9 Board

Screw M3 x 8 Torque 1Nm

CFW-09 - Size 1 and 2

CFW-09 - Size 3 to 10

NOTE!
When size 1 is used, remove the plastic side cover to insert the PLC correctly.

17

CHAPTER

8

DETAILED PARAMETER DESCRIPTION
Range [Factory Setting] Unit Description / Notes Read parameter. [-] Example: version 1.30. At the parameter you can read 130. [-] x100 µs Read parameter. It shows the duration of the user program cycle. Each unit corresponds to 100µs. To obtain the value of the scan cycle, divide the value of P751 by 10. Exemple: when 79 is read, this means that the program scan cycle is 79 ÷ 10 = 7,9ms.

Parameter P750 Firmware Version of the PLC board P751 Scan cycle of the User Program

P752 Resets retentive markers

0...1 [0] -

It reset the retentive markers, both bit type and word type. Set the parameter to 1 (one) and restart the system. The value of this parameter returns to 0 (zero) automatically.

P753 Loads default settings, if =1234 P754 Position reference (rotations) P755 Position reference (fraction of turn) P756 Position signal

0...65535 [0] [-] rot [-] degrees/10 [-] [-] rot [-] degrees/10 0...200 [ 50 ] 0...200 [0] -

It loads the factory setting to the system parameters (750...P799). Set this parameter to 1234 and reset the system.

It shows the position reference in rotations. The position reference starts at zero and after the movement has been concluded, it returns to zero. It shows the fraction of the revolution of the reference position in tenth of degree. The position reference starts at zero and after the movement has been concluded, it returns to zero. Signal of the real position shown at Parameters P757 and P758. 1 = positive and 0 = negative.

P757 Real position (rotations)

It shows the real position in rotations.

P758 Real position (fraction of turn) P760 Proportional position gain (Kp) P761 Integral position gain (Ki)

It shows the fraction of revolution of the real position in tenth of degree.

Increase this gain to speed up the answer to a position error and decrease this gain when system vibrates or becomes unstable.

It has the function to reset eventual position errors. In general, this gain is zero and may cause a position overshoot, i.e. to go beyoud the desired position and return.

18

DETAILED PARAMETER DESCRIPTION

Parameter P762 Max. lag error

Range [Factory Setting] Unit Description / Notes 0...65535 This is the max. permitted positioning error, i. e., the max. permitted [0] difference between reference position and the real position, in degrees. degrees/10 The parameter and the lag values are divided by 10. For instance 10 at P762 means that the max. following error is 1 degree. When P762 = 0 (default setting), the lag error will not be checked. 0...1 [0] When this Parameter is set to 1, it disables the user program. This setting should be used in any abnormal condition only, where the program is causing some error type, for instance, when it prevents the communication with the serial interface. In this case, disable the program and install the new corrected version and then enable it again. When, for instance, the MODBUS network connection is used through serial interface RS 485 (inverter RS232-RS485), this parameter defines the address at the network board.

P763 Desables user program, if=1

P764 PLC adrres at network

1...247 [1] -

P765 Baud rate of RS232

1...5 [ 4 (= 9600bps) ] -

Sets the baud rate of the serial interface. The permitted settings are:
P765 1 2 3 4 5 Baud-Rate (bps) 1200 2400 4800 9600 19200

P766 Satus of the Digital Inputs

[-] -

It shows the status of the 15 digital inputs: 9 digital inputs of the PLC1 and 6 digital inputs of the inverter. The read number should be converted to binary value, thus obtaining a direct read of the status of each input.
BIT14 DI101 BIT7 DI8 BIT13 BIT12 DI102 DI103 BIT6 DI7 BIT5 DI6 BIT11 DI104 BIT4 DI5 BIT10 DI105 BIT3 DI4 BIT9 DI106 BIT8 DI9 BIT0 DI1

BIT2 DI3

BIT1 DI2

The DI101 to DI106 represents the status of the 6 digital inputs of the drive and the DI1 to DI9 represents the status of the 9 digital inputs of the PLC1. P767 Synchronous motor speed P768 Encoder resolution 0...10000 [ 1800 ] rpm 0...65535 [ 1024 ] ppr 0...3599 [0] degrees/10 For instance, a 4 pole motor - 50 Hz, has a synchronous speed of 1500RPM.

It shows the number of pulses per encoder revolution.

P769 Position of the encoder zero pulse

The input value should be in tenth of degree. This value can be used to search for the machine zero and so set the zero position.

19

DETAILED PARAMETER DESCRIPTION

Parameter P772 CAN Baudrate

Range [Factory Setting] Unit Description / Notes 0...8 Adjust CAN baudrate. Accept Values: [0] Description P772 Maximum bit/second
0 1 2 3 4 5 6 7 8 1 Mbit/s Reservado 500 Kbit/s 250 Kbit/s 125 Kbit/s 100 Kbit/s 50 Kbit/s 20 Kbit/s 10 Kbit/s

Cable Length 25 m 100 m 250 m 500 m 600 m 1000 m 1000 m 1000 m

P773 Bus off Recovery

0...1 [0] -

This parameter allows the PLC1 action selection when a bus off error occurs. The permitted values are:
P773 0 Description Manual Note After the bus off error has been detected, the device displays E61, the CAN communication will be disabled and the device must be reset manually to return to network operation. The communication will be restart automatically after bus off error has been detected.

1

Automatic

P775 CAN Status

0...5 [-] -

Read Parameter Inform CAN Status: 0=Disabled 1=Reserved 2=CAN enabled 3=Warning (some telegrams with error) 4=Error Passive (Much telegrams with error or is the only network device with enabled CAN transmitting telegrams). 5=Bus Off (number of detected errors exceeded the internal device limit and the communication has been disabled) Read parameter Cyclic counter is incremented at each CAN telegram received with success. Counting is restart each time the counter reaches to upper limit. Read parameter Cyclic counter is incremented at each CAN telegram received with success. Counting is restart each time the counter reaches to upper limit.

P776 Counter of received telegrams

0...65535 [-] -

P777 Counter of transmitted telegrams

0...65535 [-] -

P778 Counter of detected errors

0...65535 [-] -

Read parameter Cyclic counter is incremented each time an error is detected (warning, error passive or bus off). Counting is restart each time the counter reaches to upper limit.

20

CHAPTER

9

WLP
WLP is a software for Windows ambient used to program the PLC1 board in Ladder language. Its installation and programming in a PC is very easy. This Manual describes the basic procedures required for the WLP installation and for the creation of new projects and gives a general view of the blocks existing in the PLC1. 1. Insert the disk into the CD-ROM 2. Click on “Start” and select the command “Execute”. 3. Digit “d:setup.exe”. NOTE: This is valid, when CD-ROM drive is in d-drive: 4. Follow the Setup instructions. 1. 2. 3. 4. 5. Open the WLP. Select the option “New Project”. Enter a name for the project. Start programming by using the commands of the Edition Bar. After programming has been concluded, press <F7> (menuconstruct - compile) to compile the project and to correct eventual errors. 6. Connect the PC cable to the PLC board. 7. Configure the serial comunication by selecting the serial port, the address of the PLC board at the network, the baud rate and press <Shift>+<F8> (menu-communication-configurations). NOTE: The parity should be always set to the option “Without Parity” 8. Transmit the programm by keying <F8> (menu-communicationtransmit the user program). These parameters give to the user good flexibility to implement new projects, since they are readily accessed through the CFW-09 HMI. Consequently, the respective name of the parameter function and its unit may be editted in the WLP through the parameter editor (Alt+G), and afterwards transmitted to the PLC1 board.

9.1

WLP Installation

9.2

Programming Starting

9.3

Parameter settable by user

9.4

General Condideration about Programmable Blocks Position / Offset SCURVE, TCURVE, HOME:
The position / offset comprised three parts: signal number of revolutions Fraction of revolution Signal: Depending on the data type that has been chosen, the signal comprises a data type and an address or a constant value, The data type of signal be: constant user parameter bit marker digital input For the data type, the value may be: positive negative

9.4.1

21

WLP

Number of Revolutions: Depending on the chosen data type, the number of revolutions consists in a data type and an address or a constant value. The data type may be: constant user parameter word marker For the constant data type, the value must be programmed according to the unit that has been configured in the project, and the configuration of the field “Fraction of Revolution” is not required. For the user parameters and the word markers, should be considered for this field the number of revolutions. Fraction of Revolution: The fraction of revolution consists only in an address, since it shares the same data type of the field “Number of Revolutions”. When the data type is constant, this value is ignored and only the constant configured in the field "Number of Revolutions" is valid. For the user parameters and the word markers, the considered unit for this field is the pulse number, which may vary between 0 to 65535 pulses, and is equivalent to a range from 0 to 359,9945068359375º.

9.4.2

Velocidade - INBWG, SCURVE, TCURVE, HOME, JOG, SETSPEED:

Depending on the chosen data type, the speed consists in a data type and an address or a constant value. The speed data type may be: constant user parameter word marker For the constant data type, the value should be programmed according to the unit configured in the project. For the user parameters and the word marker, the unit to be considered for this field is the RPM (rotation per minute).

9.4.3

Acceleration/ Deceleration SCURVE, TCURVE, HOME, STOP, JOG, SETSPEED:

Depending on the chosen data type, the acceleration/deceleration consists in a data type and an address or constant value. The acceleration data type may be: constant user parameter word marker For the constant data type, the value should be programmed according to the unit configured in the project. For the user parameters and the word marker, the unit to be considered for this field is the RPM/s (rotation per minute per second).

9.4.4

Jerk - SCURVE:

Depending on the chosen data type, the jerk consists in a data type and an address or constant value.

22

WLP

The jerk data type may be: constant user parameter word marker For the constant data type, the value should be programmed according to the unit configured in the project. For the user parameters and the word marker, the unit to be considered for this field is the RPM/s² (rotation per minute per second to the square).

9.4.5

Mode - SCURVE, TCURVE:

The mode is always constant. Here there are two options: relative absolute In the relative mode it refers to a positioning, starting from its last position. In this case, the direction of rotation of this positioning is given by the signal, i. e., clocwise direction of rotation when positive and counterclockwise direction of rotation, when negative. The aboslute mode refers to the machine zero position, but this zero position may be used only when a zero search has been effected previously.

9.4.6

Direction of Rotation INBWG, HOME, JOG, ETSPEED:

The direction of rotation is always constant. Here there are two options: clockwise counter-clockwise. Depending on the chosen data type, the total part consists in a data type and an address or constant value. The data type of the total part may be: constant word marker user parameter

9.4.7

Total Part - INT2FL, FL2INT:

ATTENTION!
When the total part refers to an output result of any block, the constant data type is not allowed.

9.4.8

Farctional Part INT2FL, FL2INT:

The fractional part consists in a data type and an address. The data type of the fractional part may be: constant word marker user parameter

ATTENTION!
When the fractional part refers to an output result of any block, the constant data type is not allowed.

23

WLP

9.4.9

Float - INT2FL, FL2INT, MATH, COMP, PID, SAT, FUNC, FILTER:

The float comprises a data type and an address. The float data type may be: float constant float marker

ATTENTION!
When the float refers to an output result of any block, the loat constant data type is not allowed. The float limits are: max. presentation = 3.402823466e+38F min. positive value = 1.175494351e–38F

9.4.10 Limits - PID, SAT:

The limits consists in 2 parts: float – max. (see item 9.4.9) float – min.(see item 9.4.9) The values comprises in 2 parts: float – input (see item 9.4.9) float – output (see item 9.4.9)

9.4.11 Input Values/ Output Values - SAT, FUNC, FILTER: 9.5 Address Range

Type Retentive Bit markers Volatile Bit Markers Retentive Word markers Volatile Word Markers System Markers Volatile Float Markers User Parameters Digital Inputs Digital Drive Inpiuts Digital Outputs Digita Drive Outputs Analog Drive Inputs Analog Drive Outputs

Range %MX1000 ... %MX1671 %MX2000 ... %MX3407 %MW6000 ... %MW6299 %MW7000 ... %MW7799 %SW0 %MF9000 ... % MF9099 %UW800 ... %UW899 %IX1 ... %IX9 %IX101 ... %IX106 %QX1 ... %QX6 %QX101 ... %QX103 %IW101 ... %IW102 %QW101 ... %QW102,

Quantity 672 1308 300 800 1 100 100 9 6 6 3 2 2

24

CHAPTER

10

WLP BLOCKS
10.1 Normally Open Contact (NOCONTACT)
Figure:

Description: It consists of 1 input, 1 output and 1 argument. The argument comprises one data type and one address. The argument data type may be: bit marker digital input digital output user parameter

NOTE!
In the user parameter option, the even values correspond to 0, while the odd values correspond to 1. Operation: When its argument value is 1, it transfers the signal contained in its input to its output. Otherwise it transfers 0 to its output. Chart:
NO CONTACT

Example:

If the bit marker 2000 and the digital input 1 is 1, write 1 in the bit marker 1000. Otherwise, write 0.

25

WLP Blocks

10.2

Normally Closed Contact (NCCONTACT)

Chart:

Description: It consists of 1 input, 1 output and 1 argument. The argument consists of one data type and one address. The argument data type may be: bit marker digital input digital output user parameter

NOTE!
In the user parameter option, the even values correspond to 0, while the odd values correspond to 1. Operation: When its argument value is 0, it transfers the signal contained in its input to its output. Otherwise it transfers 0 to its output. Chart:
NC CONTACT

Example:

If the bit marker 2000 and the digital input 1 is 0, write 1 in the bit marker 1000. Otherwise, write 0.

26

WLP Blocks

10.3

Coil

Figure:

Description: It consists of 1 input and 1 argument. The argument comprises of one data type and one address. The argument data type may be: bit marker digital output user parameter

NOTE!
In the user parameter option, the current value is not saved in the E2PROM memory, i. e. the last value is not recovered. In addition, the even values correspond to 0 and the odd values correspond to 1. Operation: It transfers the signal contained in its input to its argument. Chart:

COIL

Example:

If the bit marker 2000 or the digital input 1 is 1, write 1 in the bit marker 1000. Otherwise, write 0.

27

WLP Blocks

10.4

Nagated Coil (NEGCOIL)

Figure:

Description: It consists of 1 input and 1 argument. The argument conisists of one data type and one address. The argument data type may be: bit marker digital output user parameter

NOTE!
In the user parameter option, the current value is not saved in the E2PROM memory, i. e. the last value is not restored. In addition, the even values correspond to 0 and the odd values correspond to 1. Operation: It transfers the reverse signal contained in its input to its argument. Chart:

NEGATED COIL

Example:

If the bit marker 2000 or the digital input 1 is 1, and the user parameter 800 is 0, write 1 to the digital output. Otherwise, write 1.

28

WLP Blocks

10.5

Set Coil (SETCOIL)

Figure:

Description: It consists of 1 input and 1 argument. The argument consists of one data type and one address. The argument data type may be: bit marker digital output user parameter

NOTE!
In the user parameter option, the current value is not saved in the E2PROM memory, i. e. the last value is not recovered. In addition, the even values correspond to 0 and the odd values correspond to 1. Operation: The argument is set, when the input signal is 1.The argument will be reset only when one component "resets coil" is activated. Chart:
SETS COIL

Example:

If the user parameter 801 and the digital output 1 of the drive are 1, or the digital input 1 is 1 and the user parameter 800 is 0, it sets the digital output 1. Otherwise, the output value is maintained.

29

WLP Blocks

10.6

Resets Coil (RESETCOIL)

Figure:

Description: It consists of 1 input and 1 argument. The argument consists of one data type and one address. The argument data type may be: bit marker digital output user parameter

NOTE!
In the user parameter option, the current value is not saved in the E2PROM memory, i. e., the last value is not recovered. In addition, the even values correspond to 0 and the odd values correspond to 1. Operation: When the input signal is 1, the argument is reset. The argument will be set only when one componente "resets coil" is activated. Chart:
RESETS COIL

Example:

If the digital input 1 is 1, its resets the user parameter 800. Otherwise, the parameter value is maintained.

30

WLP Blocks

10.7

Positive Transition Coil (PTSCOIL)

Figure:

Description: It consists of 1 input and 1 argument. The argument consists of one data type and one address. The argument data type may be: bit marker digital output user parameter

NOTE!
In the user parameter option, the current value is not saved in the E2PROM memory, i. e., the last value is not recovered. In addition, the even values correspond to 0 and the odd values correspond to 1. Operation: When there is a transition from 0 to 1 at the input signal, the argument is set during the scan cycle. Then the argument is reset, even if its input remains at 1. Chart:
POSITIVE TRANSTION COIL

1 SCAN CYCLE

Example:

When the digital input 1 commutates from 0 to 1, write 1 for 1 scan cycle into the bit marker 2000.

31

WLP Blocks

10.8

Negative Transition Coil (NTSCOIL)

Figure:

Description: It consists of 1 input and 1 argument. The argument consists of one data type and one address. The argument data type may be: bit marker digital output user parameter

NOTE!
In the user parameter option, the current value is not saved in the E2PROM memory, i. e., the last value is not restored. In addition, the even values correspond to 0 and the odd values correspond to 1. Operation: When there is a transition from 1 to 0 at the input signal, the argument is set during the scan cycle. Then the argument is reset, even if its input remains at 0. Chart:
NEGATIVE TRANSITION COIL

1 SCAN CYCLE

Example:

When the digital input 1 commutates from 1 to 0, write 1 for 1 scan cycle into the bit marker 2000.

32

WLP Blocks

10.9

Block in Movement (INBWG)

Figure:

Description: It consists of 1 EN input, 1 ENO output and 2 arguments, being: speed (see item 9.4.2) direction of rotation (see item 9.4.6) The EN input is responsible for the block enabling. The ENO output informs if the direction of rotation is the same as the programmed one and if the motor speed is higher or equal to the programmed value. Operation: If the EN input is 0, the block will not be executed and the ENO output commutates to 0. If the EN input is 1, the block compares the speed and the motor direction of rotation with the programmed speed arguments an the direction of rotation. If the motor is running in the same programmed argument direction of rotation and the motor speed is higher or equal to the programmed speed argument, then it is transferred 1 to the ENO output. Otherwise, 0 is transferered to the ENO output. Flow chart:

direction of rotation = programmed direction of rotation ?

speed >= programmed speed?

33

WLP Blocks

Chart:
INBWG

PROGRAMMED SPEED

EFFECTIVE SPEED

Example:

The INBWG block will be activated, while the digital input 1 is 1. In this case, if the motor is running clockwise and its speed is higher or equal to 1500 rpm, it writes 1 to the digital output 1. Otherwise, it writes 0.

10.10 S-Curve Block (SCURVE)

Figure:

Description: It is formed by 1 EN input, 1 ENO output and 5 arguments, being: position (signal, number of revolutions, fraction fo revolution) (see 9.4.1) speed (see item 9.4.2) acceleration (see item 9.4.3) jerk (see item 9.4.4) mode (see item 9.4.5)

34

WLP Blocks

The EN input is responsible for the block enable. The ENO output informs the moment when the block is finished. Operation: If the EN input is 0, the block will not be executed and the ENO output changes to 0. If there is at least one pulse at the EN input during the scan cycle and there is no other active block, a positioning with S-profile will be exectued, based on the argumet programmed characteristics. When the positioning is finished, the ENO input changes from 1 during the scan cycle and later returns to 0. Important: This block operates with position loop, and and it remains in this function even after the process has been ended. Flowchart:

is there one positioning active?

is this block?

start positioning

did positioning finish?

in this scan cycle?

finish the block

35

WLP Blocks

Chart:
EN SCURVE

SPEED

AT MIN. 1 SCAN CYCLE

ACCELERATION

JERK

ENO

1 SCAN CYCLE

Cinematic Equations that govern this positioning:

- x = end position - x0 = start position - v = end speed - v0 = start speed - a = end acceleration - a0 = start acceleration - J = jerk

36

WLP Blocks

Example:

When a transition from 0 to 1 is captured at the digital input 1 when it's triggered a positioning with 20.5 revolution at a speed of 2000 rpm, with an acceleration of 50000 rpm/s and a jerk of 230000 rpm/s², in the clockwise direction of rotation, since the mode is relative and the positioning signal is positive. After the positioning process has been ended it writes 1 during 1 scan cycle to the digital output 1. Remember that the jerk is the derivative from the acceleration as time function. Thus we can conclude that the max. acceleration will be reached at 50000 rpm/s / 230000 rpm/s² = 0.22 seconds.

10.11 Block of the Trapezoidal Curve (TCURVE)

Figure:

Description: It is formed by 1 EN input, 1 ENO ouput and 4 arguments, being: position (signal, number os revolutions, fraction of revolution) (see 9.4.1) speed (see item 9.4.2) acceleration (see item 9.4.3) mode (see item 9.4.5) The EN input is responsible for the block enable. The ENO output informs the moment as the block has been finished. Operation: If the EN input is 0, the block will not be executed and the ENO output changes to 0. If there is at least one pulse during one scan cycle at the EN input, and if there is no other positioning block active, a positioning with trapezoidal profile will be exceuted, based on the arguments programmed characteristics. After the positioning has been ended, the ENO input changes to 1 during one scan cycle and then returns to 0 again. Important: This block operates in positioning loop and remains at this function even after the process has been terminated.

37

WLP Blocks

Flowchart:

is there one positioning active?

is this block?

start positioning

is positioning finished?

in this scan cycle?

finish the block

Chart:
EN TCURVE

SPEED

AT MIN. 1 SCAN CYCLE

ACCELERATION

ENO

1 SCAN CYCLE

38

WLP Blocks

Cinematic Equations that governs this Positioning:

where: - x = end position - x0 = start position - v = end speed - v0 = start speed - a = end acceleration Example:

When at the digital input 1 a transition from 0 to 1 is captured, a position command is triggered to the absolute position, configured with the signal of the user parameter 800, with the number of revolutions of the user parameter 801 and with the fraction of revolution of the user parameter 802, with the speed of the user parameter 803 and with an acceleration based on the user parameter 904 in rpm/s. Thus is required that a machine zero search has been executed previously. When finished, it writes 1 during a scan cycle at the digital output 1.

10.12 Search Block for Machine Zero (HOME)

Figure:

Description: It is formed by 1 EN input, 1 ZEROSW input, 1 ENO output and 4 arguments, being: direction of rotation (see item 9.4.6) speed (see item 9.4.2) acceleration (see item 9.4.3) offset (signal, number of revolutions, fraction of revolution) (see 9.4.1) The EN input is responsible for the block enable. The ZEROSW input is responsible for informing the block that the zero machine position has been reached. The ENO output informs the moment when the block has been finished.

39

WLP Blocks

Operation: If the EN input is 0, the block is not executed and the ENO output remains at 0. If there is less than one pulse during a scan cycle at the EN input, and no other positioning block is active, the zero search is enabled with trapezoidal profile based on the characteristics of the programmed arguments. At the moment when there is at minimum one pulse during one scan cycle at the ZEROSW input, the search for the zero pulse is started. As soon as the zero pulse is found, the stop process is started and then the return to the position of the zero pulse is executed. Now the block is finished and the ENO output changes to 1 during one scan cycle and then returns to 0.

NOTE!
Assuming that this block is enabled and the ZEROSW input is 1, the search is started in the opposite direction as programmed until the ZEROSW input changes to 0. At this moment, the block reverses the direction of rotation and repeats the step described in the item above. As this block is finished, the found position will be referenced to the programmed offset value that generally is zero. If we program a negative offset with 25 revolutions and we execute a relative positioning with 50 revolutions with positive signal, the reached position would be of 25 revolutions and 0 fraction of revolution with positive signal. However is the positioning would be absolute, the end position would be of 50 revolutions and 0 fraction of revolution with positive signal and executing in fact 75 revolutions in clockwise direction of rotation.

NOTE!
Depending on the value of the Parameter 769, the position may show an offset that causes a position advance relating to the zero pulse. In this case, the stop will be the value of the tenth degrees of parameter P769 before the zero pulse.

ATTENTION!
After the machine zero search, the control remains in position loop.

40

WLP Blocks

Flowchart:

is there one positioning active?

is this block?

start positioning

was there a positive transition on ZEROSW input?

zero pulse reached?

return to zero position?

position is positioning finished

in this scan cycle?

finish the block

Chart: Normal condition - ZEROSW = 0
HOME

ZEROSW

AT MIN., 1 SCAN CYCLE

ZERO PULSE

SPEED

Depends on the value of P769

1 SCAN CYCLE

41

WLP Blocks

Excepting - ZEROSW = 1

HOME

ZEROSW

AT MIN., 1 SCAN CYCLE

ZERO PULSE

SPEED

1 SCAN CYCLE

Example:

Considering that the drive has been reset recently or switched OFF, the digital input 1, during the transition from 0 to 1, activates the machine zero search, since the marker of the bit 2001 is enabled at 0. The search for the zero pulse is started, when the input 2 changes to 1. The motor decelerates and returns to the found zero pulse position plus the value of P769, as soon as the zero pulse is found. The marker 2001 is set as soon as the positioning process has been concluded and now a new search is enabled.

42

WLP Blocks

10.13 Stop Block (STOP)

Figure:

Description: It is formed by 1 EN input, 1 ENO output and 2 arguments, being: deceleration (see item 9.4.3) mode The EN input is responsible for the block enable. The ENO output informs the moment when the block is terminated. Mode: The mode is always a constant. There are available two options: interrupts (feed enable) cancels (kill motion) Operation: If the EN input is 0, this block is not active, the ENO output remains at 0. If the EN input is 1, even when this occurs only during one scan cycle, a stop with trapezoidal profile is executed, based on the characteristics programmed at the arguments. As the stop has been concluded, the ENO output changes to 1 during one scan cycle and then returns to 0. After started, the stop block is not more cancelled until its total stop, even if the EN input changes to 0 before the termination on its stop. The interrupt mode causes the block stop while the EN input is 1. As soon as the input EN changes to 0, the previous active positioning block is restored, provided the current position is not higher or equal to the desired position by the previous active positioning. This can occur if the deceleration of the stop block is too slow. The cancel mode does not restore the previous positioning when the EN input is 0. Note: If use to stop the machine zero search, the stop mode will be always cancelled, even when programming has been set to interrupt. Important: This block does not change the control way, indifferent if it is in position loop or in speed loop.

43

WLP Blocks

Flowchart:

was there one previous positioning?

run stop

interrupt is mode?

restore positioning

stopped

in this scan cycle

finish the block

Chart:
STOP - INTERRUPT

SPEED

AT MIN., 1 SCAN CYCLE

1 SCAN CYCLE

44

WLP Blocks

Please note that in this case, after the EN input changes to 0, a S-curve is started, since this S-curve was being executed before the stop command was given.
STOP - CANCELL

SPEED

AT MIN., 1 SCAN CYCLE

1 SCAN CYCLE

Example:

When the digital input 1 is 1, a positioning of 100 revolutions is enabled. When the digital input 2 is 1, the stop block is enabled, causing the positioning interruption. After stopping, the digital output 1 of the drive 1 is written during one scan cycle. As soon as the digital input 2 returns to 0, the positioning of 100 revolutions is completed.

45

WLP Blocks

10.14 Jog Block (JOG)

Figure:

Description: It is formed by 1 EN input, 1 ENO output and 3 arguments, being: direction of rotation (see item 9.4.6) speed (see item 9.4.2) acceleration (see item 9.4.3) The EN input enables this block. Operation: If the EN input is 0, this block is not executed, the ENO output remains at 0. If the EN input is 1 and no other positioning block is active, the block executes a trapezoidal profile based on the characteristics programmed in the arguments and starts the deceleration when the EN input is 0. When the EN input is 0, a stop command is started and after it has been finished, the ENO output changes to 1 during one scan cycle ant then returns to 0.

NOTE!
The JOG speed is not used online, i.e., even when the programmed speed is changed, the speed of this block will not be changed.

Important: This block work in speed loop, and remains in this status even after the block has been finished.

46

WLP Blocks

Flowchart:

is there one positioning active?

has it been run?

is this block?

stopped?

run the block

in this scan cycle?

finish the block

CHART:
JOG

SPEED

AT MIN., 1 SCAN CYCLE

1 SCAN CYCLE

47

WLP Blocks

Example:

When the digital input 1 of the drive is 1, the digital output 1 is set and at the same time JOG is enabled at a speed of 0,3 rps. When the input 1 returns to 0, at the moment when the block ends, i. e., when it stops completely, the output 1 is reset.

10.15 Block Set Speed)

Figure:

Description: This block is formed by 1 EN input, 1 ENO output and 3 arguments being: direction of rotation (see item 9.4.6) speed (see item 9.4.2) acceleration (see item 9.4.3) The EN input is responsible for the block enable. The output ENO informs when the motor speed reaches the programmed speed. Operation: If the EN input is 0, the block is not executed and the ENO output remains at 0. If the EN input changes from 0 to 1 and no other movment block is active, excepting the block Set Speed, a trapezoidal profile is executed based on the characteristics programmed in the arguments and never are finished. However othe blocks Set Speed may be enabled online, thus changing the programming of its arguments. To finish this movement you must use the stop block. The ENO output changes to 1 only during one scan cycle, as the block reaches the programmed speed. Otherwise it is always 0. Important: This block works in speed loop and remains in this status even after it has been concluded.

48

WLP Blocks

Flowchart:

is this block active?

previous EN = 0 ?

continue run

is there one positioning active?

did reach the programmed speed?

is a setspeed?

in this scan cycle?

initialize the block

Chart:
SETSPEED

SPEED

AT MIN., 1SCAN CYCLE

1 SCAN CYCLE

49

WLP Blocks

Example:

During the transition from 0 to 1 of the digital input 1 of the drive, the block with speed of 500 rpm in clockwise direction of rotation is triggered. As soon as this speed is reached, the digital output 1 is set. During the transition from 0 to 1 of the digital input 2 of the drive, the block with speed of 1000 rpm in counter-clockwise direction of rotation is triggered and the digital output 1 is reset. If the digital input 1 is driven any one of the two previous movements that is active is cancelled and the motor stops and both outputs 1 and 2 are reset.

10.16 Timer Block (TON)

Figure:

Description: This block is formed by 1 IN input, 1 Q input and 2 arguments, being: PT – preset time ET – elapsed time The IN input is responsible for the block enable. The Q input informs if the elapsed time reached the programmed time. PT (Preset Time): The desired time is formed by a data type and one address or a constant value, depending on the chosen data type. The signal data type may be: constant user parameter word marker For the constant data type, the max. permitted value is 30.000 ms.

50

WLP Blocks

ET (elapsed time): The elapsed time is formed by a data type and a address. The data type of the elapsed time may be: user parameter word marker NOTE! In the option User Parameter, the current value is not saved in the E2PROM memory, i. e., this last value is not restored. Operation: If the IN input is 0, the elapsed time argument is reset and the Q output changes to 0. If the IN input is 1, the elapsed time is incremented till the value on the argument of the preset time is reached. After this value has been reached, the Q output changes to 1 and remains at this status till the IN input changes to 0. Flowchart:

Initialize

did reach the preset time?

51

WLP Blocks

Chart:
TON

Example:

When the digital input 1 of the drive is 1, a positioning based on the user parameter 800 to 803 is enabled. After this positioning has been concluded, the digital output 1 is set and the timer is enabled. After the programmed 2000 ms have been elapsed, the digital output 1 is reset.

10.17 Incremental Counter Block (CTU)

Figure:

52

WLP Blocks

Description: It is formed by 1 CU input, 1 R input, 1 Q output and 2 arguments, being: PV – desired counting CV – elapsed counting The CU input is the counting input. The R input resets the counting. The Q output informs if the programmed counting value has been reached. PV (Preset value) – CTU: Depending on the chosen data type, the preset value is formed by a data type and an address or a constant value. O The counting data type may be: constant user parameter word marker For the constant data type, the max. allowed value is 30.000. CV (Counter value) – CTU: The counter value is formed by a data type and an address. The counter value data type may be: user parameter word marker

NOTE!
In the User Parameter option, the current value is not saved in the E2PROM memory, i. e., this last value is not restored. Operation: When the CU input changes from 0 to 1, the elapsed counter value is incremented, excepting if the R input is 1 When the counter value reaches the preset value, output Q changes to 1, and remains at this status till R output changes to 1. Otherwise, Q output is 0. While R input is 1, the counter value is reset and the counting is not incremented.

53

WLP Blocks

Flowchart:

previous CU = 0 ?

increment counter value

reset counter value

did reach the preset value?

Chart :

54

WLP Blocks

Example:

If there is a transition from 0 to 1 at the digital input, or the bit 100 marker is 1, and the digital output 1 is 0, a TCURVE positioning is enabled. After conclusion, marker 1000 changes to 1, thus enabling the CTU block to make a counting and starting again the positioning, provided the digital input 1 is 0. After the counter has detected 50 positive transitions in the marker 1000, i.e., it has realized 50 positionings, the digital output 1 changes to 1, and makes impossible a new positioning before the digital input 2 is 1, thus resetting the output 1.

10.18 Transfer Block (TRANSFER)

Figure:

Description: This block is formed by 1 EN input, 1 ENO output and 2 arguments, being SRC – source data DST – destination data The EN input is responsible for the block enable. The ENO output is a copy of the ENB input value. SRC (Source Data): Depending on the selected data type, the source data may formed by a data type and an address or a constant value: The source data type may be: constant float constant bit marker word marker float marker system marker user parameter digital input digital output analog input

55

WLP Blocks

DST (Destination data): The destination data is formed by data type and an address and it is the local where is saved the source data value. The destination data type may be: bit marker word marker float marker system marker user parameter digital input digital output

NOTE!
In the option User Parameter , the current value is not saved in the E2PROM memory, i. e., the last value is not restored. Operation: The ENO output is always a copy of the EN input. When the EN input is active, the value contained in the source data is transferred to the destination data. Otherwise no operation is realized. Please consider the compatibility of the source data type and the destination data. Example:

The digital input 1 set to 1, enables the TRANSFER. Thus the value contained in the analog input 1 is shown at the user parameter 800. An useful application of the TRANSFER block is its use for enabling the motor start, for instance, through a digital input. So SRC will have a digital input as value, and DST a %SW0 system marker. Please consider that the motor is enabled only if it has been already enabled in the CFW-09 inverter. This may be programmed, for instance, at the digital input 1 of the drive.

56

WLP Blocks

10.19 Integer to Floating Point Converter Block (INT2FL)

Figure:

Description: This block is formed by 1 EN input, 1 ENO output and 3 arguments, being entire part – word (see item 9.4.7) fractional part – word (see item 9.4.8) float (see item 9.4.9) The EN input is responsible for the block enable. The ENO output is a copy of the EN input value. Operation: The EN input transfers always its content to the NO output. While the EN input is 1, the values contained in the entire word and fractional word are transferred to the float marker. The entire word and fractional word represent a number in 16.16 format. An entire word represents a whole number between -32768 and 32767. A fractional word represents a decimal number always positive between 0.0 to 0.9999847. Example: The conversion of an entire word, equal to 3, and a fractional word, equal to 8192, gives the value 3.125 with floating point, since 8192 / 65536 = 0.125. Example:

It converts the value of the user parameter 800 and 801 to the float marker 9000. Please consider that the parameter 800 represents the entire part and the parameter 801 represents the fractional part.

10.20 Floating Point to Integer Converter Block (FL2INT)

Figure:

Description: This block is formed by 1 EN input, 1 ENO output and 3 arguments, being: float (see item 9.4.9) entire part – word (see item 9.4.7) fractional part – word (see item 9.4.8) The EN input is responsible for the block enable.

57

WLP Blocks

The ENO output is a copy of the EN input value. Operation: The EN input always transfers its value to the ENO output. While the EN input is 1, the value contained in the float is transferred to the entire word and to the fractional word. The entire word and to the fractional word represent a number in 16.16 format. The entire word represents an integer number and may vary between -32768 and 32767. The fractional word represents a decimal number, always active, and may vary between 0.0 to 0.9999847. Example: The -5.5 float conversion results in an entire word equal to 5 and a fractional word equal to 32768 that represents 32768 / 65536 = 0.5. If the float value is higher than 32767, its value is saturated in the conversion, resulting in an entire word equal to 32767 in a fractional word = 65535, that represents 65535 / 65536 = 0.9999847. If the float value is lower than -32768, its value is saturated in the conversion, resulting in an entire word equal to -32768 in a fractional word = 65535, that represents 65535 / 65536 = 0.9999847. Example:

When the digital input 1 is 1, the value of ..... is converted to the user parameters 800 and 801, where the parameter 800 will be 3, and the parameter 801 will be 9175, that represents 0,14.

10.21 Arithmetic Block (MATH)

Figure:

Description: This block is formed by 1 EN input, 1 ENO output and 4 arguments, being: operator float 1 (see item 9.4.9) float 2 (see item 9.4.9) result float (see item 9.4.9) The EN input is responsible for the block enable. The ENO output is a copy of the value of the EN input. As all data type of this block are float constant or float marker, we recommend to use the blocks INT2FL and FL2INT.

58

WLP Blocks

Operator: The operator is always constant. There are following options: Sum Subtraction Multiplication Division Operation: The EN input transfers always its value to the ENO output. While the EN input is 1, the mathematic operation programmed between the arguments float 1 and float 2 is executed and the results are transferred to the result float. The executed operation is given by: [result float] = [float 1] [operator] [float 2] A compiling “warning” is generated during the division by the constant 0. If the division is effected with a parameter or a marker in the denominator, this verification will not be realized, but in both cases the value is saturated to the max. and min. float values, depending if the value of the numerator is higher or lower than 0. For saturated signal effects, zero is considered with positive signal. Example:

At every pulse given at the digital input 1, the value of the user parameter 800 and 801 is incremented by 1.5. Please remember that the value of the parameter 800 represents the entire part and the value of the parameter 801 represents the fractional part.

59

WLP Blocks

10.23 Comparator Block (COMP)

Figure:

Description: This block is formed by 1 EN input, 1 ENO output and 4 arguments, being: operator float 1 (see item 9.4.9) float 2 (see item 9.4.9) The EN input is responsible for the block enable. The ENO output is a copy of the value of the EN input. As all data type of this block are float constant or float marker, we recommend to use the blocks INT2FL and FL2INT. Operator: The operator is always constant. There are following options: Equal to Diffrent from Higher than Higher than or equal to Lower than Lower than or equal to Operation: When EN input is 0, the block is not executed and the ENO output changes to 0. While the EN input is 1 and the comparison [float 1] [operator] [float 2] is true, the ENO output changes to 1. Otherwise it changes to 0.

60

WLP Blocks

Example:

In this example, if the value contained in the analog input 1 of the drive is higher or equal to the value contained in the analog input 2 of the drive, the digital output is switched ON. Otherwise the digital output 1 is switched OFF.

10.24 PID Block (PID)

Figure:

Description: This block is formed by 1 EN input, 1 ENO output and 3 arguments, being: signals (reference, feedback, control output) gains (KP, KI, KD) limits (max., min) (see item 9.4.10) The EN input is responsible for the block enable. The ENO output is a copy of the value of the EN input. As all data type of this block are float constant or float marker, we recommend to use the blocks INT2FL and FL2INT.

61

WLP Blocks

Signals: The signals are formed by 3 parts: float – reference (see item 9.3.9) float – feedback (see item 9.3.9) float – control (see item 9.3.9) Gains: The gains are formed by 3 parts: float – proportional gain (Kp) (see item 9.3.9) float – integral gain (Ki) (see item 9.3.9) float – derivative gain (Kd) (see item 9.3.9) Operation: The EN input always transfers its value to the ENO output. The block is executed while the EN input 1. Otherwise the arguments are reset.

ATTENTION!
At maximum, two PID blocks may be active simultaneously. When a third block is present, no one will be executed, even when they are active at the EN input. Blockdiagram: Kd.s Reference + Kp Feedback Ki s + + + SAT Control

Example:

62

WLP Blocks

As explanation one can say that the reference value is given by the user parameter 800 and then converted to the float marker 9000. The value of the feedback signal is given by the value contained at the analog input 1 of the drive, which is transferred to the word marker 6000 and converted to the float marker 9001. The control output of the of the PID block is the marker 9002 which is converted to the word markers 6001 and 6002. The value contained in the word marker 6002 is transferred to the analog output 2 of the drive.

10.25 Saturation Block (SAT)

Figure:

Description: This block is formed by 1 EN input, 1 ENO output and 2 types of arguments, being: values (input, output) (see item 9.4.11) limits (max., min.) (see item 9.4.10) The EN input is responsible for the block enable. The ENO output indicates when saturation occurs. As all data types of this block are float constant or float marker, we recommend to use the blocks INT2FL e FL2INT. Operation: If the EN input is 0, the block is not executed and the ENO output changes to 0. While the EN input is 1, the block is executed. The ENO output changes to 1 only, if there is any saturation. Otherwise the ENO output remains at 0. The function of this block is to transfer the input data to the output, provided they are within the programmed limits. When these values are higher or lower that the maximum and the minimum programmed ones, the output value is saturated with these values. Example:

63

WLP Blocks

The value contained at the analog inout of the drive is transferred to the word marker 6000 which is then converted to the float marker 9000. The value read at the analog input is a value between 0 and 32767. The SAT block causes that on the float marker 9001 is read a value only between 10000 e 20000.

10.26 Mathematic Function Block (FUNC)

Figure:

Description This block is formed by 1 EN input, 1 ENO output and 2 types of arguments, being: function values (input, output) (see item 9.4.11) The EN input is responsible for the block enable. The ENO output is a copy of the value of the EN input. As all data type of this block are float constant or float marker, we recommend to use the blocks INT2FL and FL2INT. Function: The function is always constant. There are following options: absolute (module) negative square root sine cosine tangent sine arc cosine arc tangent arc Operation: The EN input transfers always it value to the ENO output. The block is exectured while the EN input is 1. The formulas are: absolute: [output] = | [input] | negative: [output] = - [input] square root: [output] = sqrt([input] ) sine: [output] = sin( [input] ) → [input] in radians cosine: [output] = cos([input]) → [input] in radians tangent: [output] = tag([input]) → [[input] in radians sine arc: [output] = asin([input]) → [output] in radians cosine arc: [output] = acos([input] ) → [output] in radians tangent arc: [output] = atag([input]) → [output] in radians

64

WLP Blocks

Example:

During the transition from 0 to 1 at the digital input 1, the user parameters 800 and 801 are converted to the float marker 9000. Then the square root is calculated from the value contained in the float marker 9000 and the result is saved in the float marker 9001. Then the value of the float marker 9001 is converted to the user parameter 802 and 803.

10.27 First Order Filter Block (FILTER)

Figure:

Description: This block is formed by 1 EN input, 1 ENO output and 2 arguments, being: values (inout, output) (see item 9.4.11) filter type float – time constant [seconds] (see item 9.4.9) The EN input is responsible for the block enable. The ENO output is a copy of the value of the EN input. As all data type of this block are float constant or float marker, we recommend to use the blocks INT2FL and FL2INT. Type: The filter type is a constant and may be: low-pass filter high-pass filter Operation: The EN input transfers always its value to the ENO output. The block is executed while the EN input is 1. Otherwise the arguments are reset.

65

WLP Blocks

The filter transfer function is given by: for low-pass filters: output = input time constant * s + 1

for high-pass filters: output = input * time constant * s time constant * s + 1

NOTE!
The time constant is given in seconds.

ATTENTION!
At maximum 2 filter blocks may be active each time. When three filter blocks are present, no one will be executed, even they are active at its EN input. Block Diagram: Low-pass filter
Input 1 Output

τ.s + 1

High-pass filter
Input

τ.s τ.s + 1

Output

Example:

The value contained at the analog input of the drive 1 is transferred to the word marker 6000 which is then converted to the float marker 9000. The float marker 9000 is the filter input, which time constant is 0.1s, resulting into the floar marker 9001.

66

WLP Blocks

10.28 Follow

Figure:

Description: It is formed by 1 EM input, 1 ENO output and 2 argument, being: Direction Synchronism ratio The EN input enables the Slave to follow the Master according to the data received by the CAN network. The ENO output informs if the Slave entered in synchronization. Synchronization Ratio The synchronization Ratio is formed by 1 data type and 2 addresses or constants. Depending on the selection, the data type may be: constant user parameter word marker The addresses or constants are destined for the master relation or slave relation. Operation: If the Master Drive is sending the data via CAN Network and the EM input of the Follower block is active, the slave motor follows the master motor according to the values of the speed loop synchronism ratio The ENO output will be set only after the salve motor reaches the specific ratio of the master motor. Example:

If the Master is sending the data via CAN network, the slave motor runs at 50% of the master motor speed.

67

WLP Blocks

10.29 CAN2MS

Figure:

Description: It is formed by 1 EN Input and 1 ENO output. The EN Input is responsible for maintaining the master sending the speed and position references via CAN network to the slave. The ENO output informs if the CAN netowk has been enabled or not. Operation: When this block has been enabled, the PLC1 starts to send the speed reference and position via CAN network.

NOTE!
If this block has not been enabled in the master design, the slave will not follow the master. Example:

The CAN communication is enabled automatically and the PLC board starts the transmission of the speed and the position reference to the slave.

68

CHAPTER

11

RTU–MODBUS PROTOCOL IN THE PLC1
Please find below an explanation about the operation of the PLC1 board in the RTU- Modbus. The baud rate is defined at the parameter 765. Following transfer rates are possible: 1 – 1200bps 2 – 2400bps 3 – 4800bps 4 – 9600bps (Factory Setting) 5 – 19200bps The communication is made through RS-232C, without parity, 8 bits and 2 stop bits. The use of MIW-02 converters is required for the network implementation, which convert the RS-232C (point-to-point) into RS-485 (multipoint). The PLC address in the network is defined at the Parameter 764 and can be set between 1 and 247 (0 is the broadcast address). The factory setting is 1. What can be programmed with the PLC1 when the RTU-Modbus protocol is used? 1 - Parameter write/read (commands 3, 4, 6 and 16): By means of the RTU-Modbus protocol in the PLC one can read and write the board parameters (P750...P899) in addition to the parameters of the own inverter (P000...P413). This programming can be carried out in only one parameter or in a parameter group. 2 - Digital Input/Output Write/Read (command 1, 2, 5 and 15): The PLC digital inputs/outputs can be read and written. This operation can be carried out in only one digital input/output and in a parameter group. Note: If the user program uses any PLC digital output, this program will have priority over the write operation through the Modbus, i. e., the user program overwrites the status imposed by the Modbus protocol. 3 - Board identification Reading (command 43): Through the command 43 you can read the board identification data, such as, manufacturer (WEG), model (PLC1.01, for example and the firmware version (V1.40, for example). Detailed Protocol Description:

69

RTU - Modbus Protocol in the PLC1

11.1 11.1.1

MODBUS-RTU Introduction to ModbusRTU Protocol
The Modbus protocol has been developed in 1979. Currently this protocol is a disclosed protocol and used widely by several equipment manufacturers. The RTU-Modbus communication for the PLC1 board has been developed according to the following documents: 1. MODBUS Protocol Reference Guide Rev. J, MODICON, June 1996. 2. MODBUS Application Protocol Specification, MODBUS.ORG, may 8th 2002. In these documents are defined the message format used by the elements that are part of the Modbus network, as well as the services (or functions) that are available via network and how these elements exchange the data via network.

11.1.1.1

Trasmission Mode

During the protocol specification you can chose between two transmission modes: ASCII or RTU. These modes define how the message bytes are transmitted. You can not use the two transmission modes in the same network. In the RTU transmission mode, each transmitted word has 1 start bit, eight data bits, 1 parity bit (optional) and 1 stop bit (2 stop bits, when parity bit is not used). Thus the bit sequence for the transmission of one byte is following:

Start

B0

B1

B2

B3

B4

B5

B6

B7

Parity or Stop

Stop

In the RTU transmission mode, each byte is transmitted as being one only word with it value as hexadecimal value. The PLC used this transmission mode only for the communication, and does not allow the communication in the ASCII mode.

11.1.1.2 Message Structure in the RTU-Mode

The RTU-Modbus network operates in the Master-Slave system, where can be available up to 247 slaves, but only one master can be connected. Every communication starts with the master requesting the salve and the slave answering to the master what has been requested. The structure is the same in both telegrams (request and answer): address, Function Code, Data and CRC. Depending on the request, only the data field may have variable length.

Master Request Message Address (1 byte) Function Code (1 byte) Data (n bytes) CRC (2 bytes)

Address (1 byte) Function Code (1 byte) Data (n bytes) CRC (2 bytes) Slave Response Message

70

RTU - Modbus Protocol in the PLC1

11.1.1.2.1 Address

Master starts the communication by sending a byte with the slave address to which the message should be sent. For the response, the salve also starts the message with its own address. The Master can also send a message to the address 0 (zero), which means that this message is destined to all slaves of the network (broadcast). However in this case no slave will answer to the master.

11.1.1.2.2 Function Code

This filed also contains an only byte, where the master specifies the service of function requested from the slave (read. write, etc.). According to the protocol, each function is used for accessing one specific data type.

11.1.1.2.3 Data Field

Field with variable length. The format and content depend on the used function and on the transmitted values. This field is described in the function description (see Item 8.14.3). The last part of the message is the field for checking the transmission errors. The used Method is the CRC-16 (Cycling Redundancy Check). This field is formed by two bytes. The least significant byte (CRC-) is transmitted first, only then is transmitted the most significant byte (CRC+). The CRC calculation is started by loading a 16 bit variable (referenced from now on as CRC variable) with the value FFFFh. After that, proceed according to the following routine: 1. Submit the first message byte (only the data bits - start bit, parity bit and stop bit are not used) to a XOR logic (OR exclusive) with the 8 least significant bits of the CRC variable, by returning the result to the own CRC variable. 2. Then the CRC variable is displace by on position to right, in the direction to the least significant bit and so the position of the most significant bit is filled out with 0 (zero). 3. After the displacement, the flag bit (the bit that has been displaced outside the CRC variable) is analyzed as follows: If the bit value is 0 (zero), no calculation is carried out. If the bit value is 1, the CRC variable content is submitted to a XOR logic with a A001h constant value and the result is returned to the CRC variable. 4. Repeat the step 2 and 3 until the eight displacements have been carried out. 5. Repeat the steps 1 to 4, by using the next message byte until the whole message has been processed. The end content of the CRC variable is the value of the CRC field that is transmitted at the end of the telegram. The least significant part is transmitted first (CRC-). Then is transmitted the most significant part (CRC+).

11.1.1.2.4 CRC

71

RTU - Modbus Protocol in the PLC1

11.1.1.2.5 Time Between Messages

There is no specific character in the RTU-mode that indicates the begin or the end of a telegram. The interruption of the data transmission during a time longer than 3,5 times required for transmitting a data word (11 bits) is the only indication of the begin or the end of the message. Thus if a telegram transmission is started only after this minimum time has been elapsed, the network elements assume that the received character represents the begin of a new telegram. In the same way, the network elements will assume that the telegram transmission has ended after this time has elapsed again. If during the transmission of a telegram , the time between the byte transmission is longer that this minimum established time, the telegram will be considered as a invalid telegram, this the PLC will disregard the already received bytes and will assemble a new telegram with the bytes that are being transmitted. The table below shows the times for three different communication rates.
Transmition Signal

T3.5 x

Tbetween bytes

T3.5 x

Time

T11 bits Telegram

Transfer Rate 9600 bits/seg 19200 bits/seg

T 11 bits 1.146 ms 573 µs

T 3.5x 4.010 ms 2.005 ms

T 11 bits = Time for transmitting one telegram word. T between bytes = Time between bytes (it can not be longher than que T 3.5x). T 3.5x = Minimun interval for indicate begin and the end of the telegram (3.5 x T 11bits).

11.1.2 PLC1 Operation in the Modbus-RTU

The PLC boards operate as Slaves at the Modbus-RTU network. The communication starts with the Master in the network requesting any service to a network address. If the PLC has been configured for the corresponding address, it processes the request and responses to the master as requested.

11.1.2.1 Interfaces Description

The PLC boards use a serial interface for the Modbus-RTU network communication. There are two possibilities for the physical connection between the master in the network an a LPC:

72

RTU - Modbus Protocol in the PLC1

11.1.2.1.1 RS-232

This interface is used for the point-to-point connection (between an only slave and the master). Maximum distance: 10 meters. Signal levels meet the EIA STANDARD RS-232C. Three wires: transmission (TX), reception (RX) and return (0V). The RS-232 Serial Interface module must be used.

11.1.2.1.2 RS-485

This interface is available through the MIW-02 converter connected to the PLC RS-232. This interface is used for the multipoint connection (several salves and one master). Maximum distance: 1000 meters (it uses shielded cables). Signal levels meet the EIA STANDARD RS-485. To enable the PLC for a correct communication in the network, you must, in addition to the physical connection, configure its address in the network and the respective transfer rate. This address is defined through Parameter 764. Each slave in the network must have its own address. The network master has no address. Even if the connection is made point-to-point, you must know the slave address in the network. The Transfer Rate is defined in the Parameter 765. Transfer Rate: 1200, 2400, 4800, 9600 or 19200 kbits/sec. Parity: No. All slaves, including the network master, must use the same transfer rate and the same parity. All PLC and inverter parameters, as well as the PLC digital inputs and outputs, can be accessed through the network The parameters have been defined In the PLC as holding type registers. In addition to these registers, you can also access the digital board inputs and outputs directly by using the bit type functions of the Modbus. Following services (or functions) have been made available for accessing these bits and registers). In addition to these registers, you can also access directly the digital inputs and outputs of the board by using the bit type function of the Modbus. Following services (or functions) are available for accessing these bits and register: Read Coils Description: read of the internal bit blocks or coils. Function: it reds the PLC digital outputs Function code: 01. Broadcast: not supported. Response time: 5 to 10 ms. Read Holding Registers Description: Read of the holding type register block Function: it reads the PLC digital outputs. Function code: 03 or 04. Broadcast: not supported. Response time 5 to 10 ms.

11.1.2.1.3 Configuration at the Modbus-RTU 11.1.2.1.4 PLC Address at the Network

11.1.2.1.5 Transfer Rate

11.1.2.2

Access to the PLC and Inverter Data

11.1.2.2.1 Available Functions and Response Times

73

RTU - Modbus Protocol in the PLC1

Write Single Coil Description: writes in an only internal bit or coils. Function: it reads the PLC digital outputs. Function code: 05. Broadcast: not supported. Response time 5 to 10 ms. Write Single Register Description: write in an only holding type register. Function: it writes in PLC or inverter parameter. Function code: 06. Broadcast: not supported. Response time 5 to 10 ms. Write Multiple Coils Description: write in an internal bit block or coils Function: it writes in several PLC digital outputs. Function code: 15. Broadcast: not supported. Response time 5 to 10 ms. Write Multiple Registers Description: write in holding type register block. Function: it writes several PLC or inverter parameters. Function code: 15. Broadcast: not supported. Response time: 10 to 20 ms for each written register. Read Device Identification Description: Device identification. Function: it reads the PLC model and the firmware version Function code: 15. Broadcast: not supported. Response time: 5 to 1o ms Note: The slaves of the Modbus-RTU network are addressed from 1 to 247. The master uses the address 0 (zero) to send a common message to all slaves (broadcast).

11.1.2.2.2 Data Addressing

The addressing of the PLC data is made with an offset equal to zero, which means that the address number is equal to the data number. The parameters, as well as the digital inputs/outputs are made available from the address 0 (zero) on.
Parameters Modbus Address Decimal 0 100
...

Parameter Number P000 P100
...

Hexadecimal 00h 064h 320h
... ...

P800
...

800
...

74

RTU - Modbus Protocol in the PLC1

Number of the Digital Input IX1 IX2
...

Digital Inputs Modbus Address Decimal Hexadecimal 0 0h 1 1h
...

IX9

8

Bit Number QX1 QX2
...

Digital Outputs Modbus Address Decimal Hexadecimal 0 0h 1 1h
...

QX6

5

5h

11.1.3 Detailed Description of the Functions

This item presents a detailed description of the functions that are available in the PLC for the Modbus-RTU communication. For the telegram preparation, please note following: The values are always transmitted as hexadecimal values. The data address, the data number and the register value are always represented in 16 bits. Thus it is required for transmitting these fields by using two bytes (high and low). The bit accessing and the form to represent a bit depend on the used function. The telegrams, both the request telegrams and the answer telegrams cannot be longer than 128 bytes. This function read the content of a digital output group of the PLC, which must be in numerical sequence. Please note that the output 1 must have the address 0, and so on up to output 6, which address is 5. This function has the following structure for the read and response telegrams (the values are always hexadecimal, and each field represents one byte):
Response (Slave) Slave Address Function Field Byte Count (number of the data bytes) Byte 1 Byte 2 Byte 3 etc... CRCCRC+

11.1.3.1

Function 01 - Read Coils

Resquest (Master) Slave Address Function Address oh the initial bit (byte high) Address oh the initial bit (byte low) Number of bits (byte high) Number of bits (byte low) CRCCRC+

Every answer bit is put in a position of the data bytes sent by the slave. The first byte, bits 0 to 7, receives the first 8 bits by starting with the initial address indicated by the master. The other bytes (when the number of read bits is higher than 8) remains in sequence. If the number of the read bits is not multiple of 8, the remaining bits of the last byte must be filled out with 0 (zero). Example: reading of the digital outputs, DO1 to DO6 at the address 1:

...

...

8h

75

RTU - Modbus Protocol in the PLC1

Resquest (Master) Field Slave Address Function Initial Bit (high) Initial Bit (low) Number of bits (high) Number of bits (low) CRCCRC+

Value 01h 01h 00h 00h 00h 06h BCh 08h

Response (Slave) Field Slave Address Function Byte Count

Status of the outputs 1 to 6
CRCCRC+

Value 01h 01h 01h 02h D0h 49h

11.1.3.2

Function 02 - Read Inputs Status

This function reads the content of a digital input group of the PLC that must be in a numerical sequence. Please note that the input 1 has the address 0, and so on up to input 9 that must have address 8. This function has following structure for the read and response telegrams (the values are always hexadecimal values, and each field represents a byte):

Resquest (Master) Slave address Function Address of the initial bit (byte high) Address of the initial bit (byte low) Number of bits (byte high) Number of bits (byte low) CRCCRC+

Response (Slave) Slave address Function Field Byte Count (number of data bytes) Byte 1 Byte 2 Byte 3 etc... CRCCRC+

Every answer bit is put in a position of the data bytes sent by the slave. The first byte, bits 0 to 7, receives the first 8 bits by starting with the initial address indicated by the master. The other bytes (when the number of read bits is higher than 8) remains in sequence. If the number of the read bits is not multiple of 8, the remaining bits of the last byte must be filled out with 0 (zero). Example: reading of the digital inputs, DI2 to DI7 at the address 1:
Resquest (Master) Field Slave Address Function initial Bit (high) initial Bit (low) Number of bits (high) Number of bits (low) CRCCRC+ Response (Slave) Field Slave Address Function Byte Count Status of the inputs 2 to 7 CRCCRC+

Value 01h 02h 00h 01h 00h 06h A9h C8h

Value 01h 02h 01h 15h 60h 47h

As in the example the number of the read bits is lower the 8, the slave needed only 1 byte for the response. The value of the byte was 15 h, where the binary has the form of 0001 0101. As the number of the read bits is equal to 6, only the 6 least significant bits which have the values of the digital inputs 2 to 7 are of interest, The other bits, as they did not have been requested are filled out with 0 (zero).

76

RTU - Modbus Protocol in the PLC1

11.1.3.3

Function 03 - Read Holding Register e Function 04 - Read Input Register

This function reads the content of a parameter group that must be in a numerical sequence. This function has following structure for the read and response telegrams (the values are always hexadecimal values, and each field represents a byte):

Request (Mater) Slave address Function Address of the initial register (byte high) Address of the initial register (byte low) Number of register (byte high) Number of register (byte low) CRCCRC+

Response (Slave Slave address Function Field Byte Count Data 1 (high) Data 1 (low) Data 2 (high) Data 2 (low) etc... CRCCRC+

Example: reading of the values proportional to the frequency (P002) and the motor current (P003) of the CFW-09 at address 1:
Resquest (Master) Field Slave Address Function Inicial Register (high) Inicial Register (low) Number of Register (high) Number of Register (low) CRCCRC+ Response (Slave) Field Slave Address Function Byte Count P002 (high) P002 (low) P003 (high) P003 (low) CRCCRC+

Value 01h 03h 00h 02h 00h 02h 65h CBh

Value 01h 03h 04h 03h 84h 00h 35h 7Ah 49h

Each register is formed by two (high e low). In our example we have P002 = 0384h, which in decimal is equal ton 900. As this parameter does not have decimal point for the indication, the effective read value is 900 rpm. Similarly the current value is P003 = 0035h, which is equal to 53 decimal. As the current does not have decimal resolution , the read value will be 5,3 A.

11.1.3.4

Function 05 - Write Single Coil

This function is used to write a value to an only digital output. The output value is represented by two bytes, where FF00h represents the bit equal to 1, and 0000h represents the equal to 0 (zero). Please note that the output 1 has the address 0, and so on up to output 6, which address is 5. This function has following structure (the values are always hexadecimal values, and every field represents one byte):
Request (Master) Slave address Function Bit Address (byte high) Bit Address (byte low) Bit Value (byte high) Bit Value (byte low) CRCCRC+ Response (Slave) Slave address Function Bit address (byte high) Bit address (byte low) Bit Value (byte high) Bit Value (byte low) CRCCRC+

77

RTU - Modbus Protocol in the PLC1

Example: enable the digital output 2 of the PLC at address 1:
Resquest (Master) Field Slave Address Fucntion Number of bit (high) Number of bit (low) Value of the bit (high) Value of the bit (low) CRCCRC+ Value 01h 05h 00h 01h FFh 00h DDh FAh Response (Slave) Field Slave Address Function Number of bit (high) Number of bit (low) Value of the bit (high) Value of the bit (low) CRCCRC+ Value 01h 05h 00h 01h FFh 00h DDh FAh

In this function, the slave response is copy identical to the request mad by the master.

11.1.3.5

Function 06 - Write Single Register

This function is used to write a value to an only parameter. This function has the following structure (the values are always hexadecimal values, and each field represents one byte):
Response (Slave) Slave address Function Parameter address (byte high) Parameter address (byte low) Parameter value (byte high) Parameter value (byte low) CRCCRC+

Request (Master) Slave address Function Parameter address (byte high) Parameter address (byte low) Parameter value (byte high) Parameter value (byte low) CRCCRC+

Example: write of the speed reference equal to 900 rpm, in an user parameter (P800) in the address 1.
Resquest (Master) Field Slave Address Function Parameter (high) Parameter (low) Value (high) Value (low) CRCCRC+ Response (Slave) Field Slave Address Function Parameter (high) Parameter (low) Value (high) Value (low) CRCCRC+

Value 01h 06h 03h 20h 03h 84h 88h D7h

Value 01h 06h 03h 20h 03h 84h 88h D7h

In this function, the slave response is again an identical copy of the maste4r request. The parameters are addressed directly to its number, in the example above P800 = 0320h.

11.1.3.6

Function 15 - Write Multiple Coils

This function allows writing values to a digital output group of the PLC. This values must be in numerical sequence. This function can also be used for writing to an only output (the values are always hexadecimal, values and each field represents one byte).

78

RTU - Modbus Protocol in the PLC1

Request (Master) Slave address Function Address of the initial bit (byte high) Address of the initial bit (byte low) Number of bits (byte high) Number of bits (byte low) Field Byte Count (umber of data bytes) Byte 1 Byte 2 Byte 3 etc... CRCCRC+

Response (Slave) Slave address Function Address of the initial bit (byte high) Address of the initial bit (byte low) Number of bits (byte high) Number of bits (byte low) CRCCRC+

Every bit value that is being written is put in a position of the data bytes sent by the slave. The first byte, bits 0 to 7, receives the first 8 bits by starting with the initial address indicated by the master. The other bytes (when the number of read bits is higher than 8) remains in sequence. If the number of the written is higher than 8, remain in sequence. If the number of the written bits is not multiple of 8, the remaining bits of the last byte must be filled out with 0 (zero). Example: connecting the digital outputs 4 and 5 to the PLC, in address 1:
Resquest (Master) Field Slave Address Function Initial Bit (byte high) Initial Bit (byte low) Number of bits (byte high) Number of bits (byte low) Byte Count Value for the bits CRCCRC+ Response (Slave) Field Slave Address Function Initial Bit (byte high) Initial Bit (byte low) Number of bits (byte high) Number of bits (byte low) CRCCRC+

Value 01h 0Fh 00h 03h 00h 02h 01h 03h BAh 96h

Value 01h 0Fh 00h 03h 00h 02h 24h 0Ah

As only two bits are being written, the master needed only 1 byte for the data transfer. The transmitted values are in the least significant bits of the byte that contains the values for the bits. The other bits of this byte have the values 0 (zero).

11.1.3.7

Function 16 - Write Multiple Registers

This function allows writing values to a parameter group that must be in numerical sequence. This function may be also used for writing one only parameter (the values are hexadecimal values an each field represents one byte).

79

RTU - Modbus Protocol in the PLC1

Request (Master) Slave address Function Address of the initial parameter (byte high) Address of the initial parameter (byte low) Number of parameters (byte high) Number of parameters (byte low) Field Byte Count (number of data bytes) Data 1 (high) Data 1 (low) Data 2 (high) Data 2 (low) etc... CRCCRC+

Response (Slave) Slave address Function Address of the initial bit (byte high) Address of the initial parameter (byte low) Number of parameters (byte high) Number of parameters (byte low) CRCCRC+

Example: writing of the acceleration time (P100) = 1,0 s and of the deceleration time (P101) = 2,0s, of a CFW-09 in the address 20:
Resquest (Master) Field Slave Address Function Initial Register (high) Initial Register (low) Number of Register (high) Number of Register (low) Byte Count P100 (high) P100 (low) P101 (high) P101 (low) CRCCRC+ Response (Slave) Field Slave Address Function Initial Register (high) Initial Register (low) Number of Register (high) Number of Register (low) CRCCRC+

Value 14h 10h 00h 64h 00h 02h 04h 00h 0Ah 00h 14h 91h 75h

Value 14h 10h 00h 64h 00h 02h 02h D2h

As both parameters have a decimal resolution for writing 1.0 and 2.0 seconds, so must be transmitted the respective values 10 (000Ah) e 20 (0014h).

11.1.3.8 Function 43 - Read Device Identification

This auxiliary function allows reading of the product manufacturer, model, and firmware version. This function has following structure:

80

RTU - Modbus Protocol in the PLC1

Request (Master) Slave address Function MEI Type Read code Object number CRCCRC+

Response (Slave) Slave address Function MEI Type Conformity Level More Follows Next object Number of objects Object Code* Object size* Object value* CRCCRC+

The field is repeated according o the number of object.. This function allows the reading of the information categories: Basic, Regular and Extended. Each category is formed by an group of objects. Each object is formed by a sequence of ASCII characters. For the PLC are made available only basic information, formatted by three objects; Object 00 - VendorName: Always ‘WEG’. Object 01 - ProductCode: Formed by the product code (PLC1.01) where 01 indicates the hardware version. Object 02 - MajorMinorRevision: indicates the PLC firmware version in ‘VX.XX’ format. The read code indicates the information categories that are being read and indicated if the objects that are being accessed are in sequence of are individually . In this case, the PLC supports the code 01 (basic information in sequence and the code 04 (individual access to the objects). Example: read of the basic information in sequence, starting from the object 00 of a PLC in the address:
Resquest (Master) Field Slave Address Function MEI Type Read Code Object Number CRCCRC+ Response (Slave) Field Value Slave Address 01h Function 2Bh MEI Type 0Eh Read Code 01h Conformity Level 81h More Follows 00h Next Object 00h Number of Objects 03h Object Code 00h Object Size 03h Object Value ‘WEG’ Object Code 01h Object Size 07h Object Value ‘PLC1.01’ Object Code 02h Object Size 05h Object Value ‘V1.40’ CRC6Fh CRC+ 5Fh

Value 01h 2Bh 0Eh 01h 00h 70h 77h

81

RTU - Modbus Protocol in the PLC1

In this example, the object value has not been represented as hexadecimal value, but it has been represented by using corresponding ASCII characters. For instance, for the object 00, ‘WEG’ value, has been transmitted by means of three ASCII characters, which in hexadecimal values are 57h (W), 45h (E) and 47h (G).

11.1.4 Comunnication Erros

Errors may occur during the telegram transmission through the network. These errors may also be already present in the received telegram contents. Depending on the error type, the PLC may or not answer to the Master. When the master sends a message to a board configured at determined address, this board will not answer to the master when: An Error occurs in the CRC. When Time out between the transmitted bytes has been detected (3.5X the time required for transmitting a 11 bit word). If the reception has been successful during the telegram processing, the PLC can still detect any problem and so send an error s=message, indicating the detected problem: Function is not valid (error code = 1): the requested function has not bee implemented or the PLC. Data address is not valid (error code = 2): the data address (parameter or digital I/O) does not exist. The data value is not valid (error code = 3): this error occurs in the following situations: Value is out of allowed range Writing attempt in data that cannot be changed (read-only register, register does not allow data changing with enabled inverter, or bits in logic status). Write has been made as function of the logic command function that has not been enabled via serial.

11.1.4.1 Error Messages

Then the slave must return a message, indicating the occurred error type. Errors that occur during the message processing for the PLC, are errors of non-valid function (Code 01), non-valid data address (Code 2) and novalid data value (Code 03). TThe messages sent by the slave have following structure;

Response (Slave) Slave Address Function Code(with the most significant bit set to 1) Error Code CRCCRC+

82

Sign up to vote on this title
UsefulNot useful