Cartão PLCControlador Programável
Controlador Programable
Programmable Controller
PLC Board
Tarjeta PLC
User´sguide
Guia delusuario
Manualdo usuário
PLC1 Software: V1.4X
WLP Software: V3.4X
0899.4794 E/2
MANUAL
PLC1.01 BOARD
PROGRAMMABLE IN LADDER LANGUAGE
BY WLP SOFTWARE
04/2004
Summary of Revisions
The table below describes all revisions made to this manual.
Revision Description Section
1 First Edition -
Summary
1 Quick Parameter Reference ......................................................... 072 Fault Messages ........................................................................... 26
CHAPTER 1Introduction
CHAPTER 2Safety Notices
CHAPTER 3General Information
CHAPTER 4General Characteristics of the PLC1
CHAPTER 5Connector Description
CHAPTER 6Configuration of the CFW-09 Converter
with PLC Board
CHAPTER 7Board Installation into the Converter
CHAPTER 8Detailed Parameter Description
CHAPTER 9WLP
CHAPTER 10WLP Blocks
CHAPTER 11RTU - Modbus Protocol in the PLC1
PLC - QUCIK PARAMETER REFERENCE
4
QUICK PARAMETER REFERENCE, FAULT MESSAGES
Software: V1.4XApplication:Model:Serial Number:Responsible:Date: / / .
1. PARAMETERS
Parameter Function Adjustable RangeFactory
Unit PageSettingP750 PLC1 firmware version Read
P751Scan cycle in
Read x100µs100µs unitsP752 (*) Resets the retentive markers 0...1 0
P753 (*)Loads factory settings ,
0..65535 0if =1234
P754Position reference
Read rot(rotations)
P755Position reference
Read degrees / 10 (fraction of rotation)
P756Position signal
Read0 = negative1 = positive
P757 Real position (rotations) Read rotP758 Real position (fraction of rot.) Read degrees / 10
P760Kp: proportional
0...200 50position gainP761 Ki: Integral position gain 0...200 0P762 Max. lag error 0...65535 0 degrees / 10
P763Disables user
0...1 0program if =1P764 (*) PLC address at netwrok 1...247 1
P765 (*) Baud rate of RS232
1 = 1200bps
4 bits/second2 = 2400bps3 = 4800bps4 = 9600bps5 = 19200bps
P766 Status of the Digital Inputs Read
P767 (*)Synchronou speed
0...10000 1800 RPMof the motor in RPMP768 (*) Encoder pulse number 0...65535 1024 ppr
P769 (*)Encoder zero pulse
0...3599 0 degrees / 10position
The parameter range starts from 750 up to 899, totalizing 150 parameters. The first 50 parameters are predefinedby the system or are reserved parameters. The 100 remaining parameters are for general use and may be set by theuser.
Please find below a description of the parameters defined by the system.
(*) IMPORTANT: to enable the system to operate according the parameter seeting, the system must be reset afterone or more parameters have been changed.
PLC - QUCIK PARAMETER REFERENCE
5
Parameter Function Adjustable RangeFactory
Unit PageSetting
P772 CAN Baudrate
0=1Mbit/s
0 bits/second
1=Reserved2=500 Kbit/s
3=250 Kbit/s
4=125 Kbit/s
5=100 Kbit/s
6=50 Kbit/s
7=20 Kbit/s
8=10 Kbit/s
P773 Bus off recovery0=Manual1=Automatic
P775 CAN Status Read
P776Counter of received Readtelegrams
P777Counter of trasmitted Read
telegrams
P778 Counter of detected erros Read
PLC - QUCIK PARAMETER REFERENCE
6
Display Description Note
E50 Lag errorFatal Error, it disables the converter.Refer to Parameter P762.
E51Error during Reset the systems andprogram saving try again.
E52
Two or more Check the user program logicmovementsenabledsimultaneously
E53Movement data are Perhaps some speed, accelerationnot valid value, etc. was reset to zero.
E54 Inverter disabledAttempt to execute some movementwith disabled inverter
E55
Incompatible program Check program and install it again.or out of memory This error also occurs when there islimits no program installed in the PLC
(PLC powered-up first time).E56 Wrong CRC Transmit it again.
E57Shaft has not been Before an absolut movement ,referenced to absolute you must set the machinemovement movement to zero position.
E58Master Reference
Fatal Error: after enabled initial
Faultcommunication, between master andslave, by any cause has beendisabled.
E61 Bus off
Bus off has been detected on the CANbus due to a high number of transfererros. These erros may be causeddue to bus problems or due toimproper installation.
2. Error Messages
Note: In fatal erros, E50 and E58, the inverter is disabled and need restart.
7
INTRODUCTION
The PLC1 board adds important PLC (Programmable Logical Controller)functions to the CFW-09, enabling the execution of complex linkageprogram by using the digital board inputs and outputs as well as thedigital and analog inputs and outputs of the own inverter which can beaccessed by the user´s program.
Among the several available functions we can mention simple contactsand 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-passfilters, saturation, comparison. All these functions operate with floatingpoint.
Besides the functions mentioned above, the PLC1 provides blocks formotor speed and motor position control, that is a trapezoidal-profilepositioning and a S-profile positioning, speed reference generation withtrapezoidal acceleration ramp, etc. (Note: when positioning functionsused, the coupling of an encoder on motor shaft is required).
All functions can interact with the user through the 100 programmableparameters that can be acessed directly through the inverter HMI. Thetexts and user units of the programmable parameters can be customizedby the WLP.
ATTENTION!The CFW-09 inverter software version should be the version V2.40 orlater.
CHAPTER 1
8
CHAPTER 2
SAFETY NOTICES
This Manual contains all necessary information for the correct installationand operation of the PLC1 with the CFW-09 Variable Frequency Drive.
The PLC1 Manual has been written for qualified personnel with suitabletraining of technical qualifications to operate this type of equipment
Only qualified personnel should plan or implement the installation, start-up, operation and maintenance of the CFW-09 and associated equipment.
The personnel must follow all safety instructions included in this Manualand/or defined by the local regulations.
Failure to comply with these instructions may result in personnel injuryand/or equipmrnt damage.
NOTE!In this Manual, qualified personnel are defined as people that are trainedto:
1. Install, ground, power up and operate the CFW-09, as well as the PLC1board, 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 electricalcomponent inside the inverter.
Many components are charged with high voltages, even after the incomingAC power supply has been disconnected or switched OFF. Wait at least10 minutes for the total discharge of the power capacitors.
Always connect the frame of the equipment to the ground (PE) at thesuitable connection point.
ATTENTION!All electronic boards have components that are sensitive to electrostaticdischarges. Never touch any of the electrical components or connectorswithout following proper grounding procedures. If necessary to do so, touchthe properly grounded metallic frame or use a suitable ground strap.
NOTE!Read this entire Manual carefully and completely before installing oroperating PLC1 board with the CFW-09.
9
CHAPTER 3
GENERAL INFORMATION
This chapter defines the contents and purpose of this manual
This manual describes the basic procedures required for the WLPinstallation, the creation of projects and provides a general view on theblock existing in the PLC1.Chapter 1- IntroductionChapter 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 asdescribed in this Manual. As the PLC1 can be applied in several ways, itis impossible to describe here all application possibilities of this board.WEG does not assume any responsibility when the PLC1 is not usedaccording to this manual.
No part of this Manual may be reproduced in any form, without writtenconsent of WEG.
3.1 ABOUT THIS MANUAL
10
GENERAL CHARACTERISTICS OF THEPLC1
9 isolated digital inputs, bi-directional, 24VDC3 digital relay output 250V x 3A3 digital optocoupled outputs, bi-directional, 48VDC x 500mA1 isolated encoder input, with external supply between 18 and30VDCEncoder supply - 15VDC x 300mA1 serial communication interface – RS-232C (standard Protocol:MODBUS-RTU)All sizes compatible with CFW-09User programming in Ladder language, with specific blocks forpositioning and PLC functionsIt permits the use of digital and analog inputs/ouputs of the CFW-09,comprising 15 digital inputs, 9 digital outputs, 2 analog inputs and 2analog outputs, accessed by the ladder.
The Parameter Range comprises the parameter from 750 to 899, totaling150 parameters. The 50 first parameters are predefined by the systemor are reserved parameters. The other 100 remaining parameters arefor general use, i. e., they may be programmed by the user and can beused for the most different functions, as contactors, timers, speed,acceleration and position references, etc.BIT and volatile WORD type Markers (initialized at zero) and retentiveand volatile FLOAT type markers.The board programming is performed through the WLP 3.3 program orlater, in Ladder language.
4.1 Hardware
CHAPTER 4
4.2 Software
11
CONNECTOR DESCRIPTION
CHAPTER 5
Connector XC21: Relay outputs and digital inputs
Connector XC211
DO123
DO245
DO367 NC8 NC9 DI610 DI711 DI812 DI913
COM DI
Function
Digital relay outputs
Not connectedNot connected
Isolated digital Inputs
Common to the inputsDI6...DI9
SpecificationContact capacity:
3A250VAC
Input voltage:15...30VDCInput current:11mA @ 24VDC+-+-
CONNECTOR DESCRIPTION
12
Connector XC22: 24V transistor outputs and digital inputs
Connector XC2214 NC15 COM DO
16 DO617 DO518 DO419 NC20 NC21 DI122 DI223 DI324 DI425 DI526 COM DI
FunctionNot connectedCommon to the digitaloutputs DO4, DO5 e DO6
Bipolar optocoupled digitaloutputs
Not connectedNot connected
Isolated digital inputs
Common to inputsDI1...DI5
Specification
Max. voltage: 48VDCCurrent capacity: 500mA
Input voltage:15...30VDCInput current: 11mA @24VDC+-
Conector XC3: Profibus of the HMS Board
Enable PLC communication Profibus Network.
Conector XC7: RS-232CConnector XC7
1 5VCC
2 RTS3 GND4 RX5 GND6 TX
Function
5VDC supply
Request to sendReferenceReceivesReferenceTransmits
SpecificationCurrent capacity:50mA
Connector XC8: Externa 24VDC input and CANopen network
Connector XC821 CAN GND22 24Vcc
23 CAN L24 GND ENC25 CAN H26 NC27 CAN
24Vcc28 NC
FunctionCAN GND
Supply for encoder inout
CANL24VDC encoder referenceCANHNot connectedNetwork supplyCANopenNot connected
Specification
18..26VDCDrawn current: 25mA + theencoder current.
18..26VDC50mA @ 24VDC
+-
+-
+- Load
CONNECTOR DESCRIPTION
13
Connector XC9: Incremental Encoder
Applications that require more speed or positioning accuracy, a speedfeedback of the motor shaft by means of incremental encoder is required.The inverter connection is realized through the XC9 (DB9) connector of thePLC1 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 flexiblecoupling, but without torsional flexibility);
Both motor shaft and metallic encoder frame must be isolated electricallyagainst motor (min. spacing: 3 mm);Use flexible couplings of high quality to prevent mechanical oscillationor “backlash”;
For electrical connection use shielded cable and lay it separately(spacing >25cm) from the oher wirings (power, controle cables, etc). Ifpossible, install it inside a metallic conduit.
During commissioning, program parameter P202 - control type = 4 (Vectorwith encoder) to operate the system through speed feedback by incrementalencoder..
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 encodermodels are used, check the correct connection to meet the required sequence.
red
blueyellowgreen
rosewhitebrown
grey
loop
15Vdiferencial
Encoder
Max. recommended length: 100m
Board PLC1
Encoder connect.***
A AH AB BI B
C ZJ ZD +VE
F COM
E NCG
Connector XC9 Description
3 A2 A Encoder signal1 B9 B
8 Z7 Z4 +VE Source*
6 COM Reference 0V**
5 Ground
NOTE!The max. permitted encoder frequency is 100kHz.
CONNECTOR DESCRIPTION
14
Jumper XC10: Firmware download
Jumper XC10Open Normal Operation
Closed Firmware download
Jumper XC11: Encoder error
Jumper XC11Open Enables encoder error generation
Closed Does not generate encoder error
Required sequence for encoder signals:
Motor is running clockwise
B t
A t
15
CONFIGURATION OF THE CFW-09CONVERTER WITH PLC BOARD
CHAPTER 6
Control type (P202):
For the blocks that generate speed reference (JOG and SETSPEED),you can use the converter in ‘Sensorless’ (P202=3) mode. Please considerthat in this operation mode there is no high precision at low speed. Inaddition, the position gain Kp (P760) should be reset to zero to preventinstability when the motor is disabled. For the position blocks (TCURVEand 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 speedreference;Check the correct setting of the P161 and P162 parameters that are theproportional speed gain and the integral speed gain, respectively. Thecorrect setting of these parameters are very important for a good inverterperformance.
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 setto ‘PLC’ (P221=11), i. e., the speed reference will be given by the PLCboard.
Local Run/Stop Selection (P224)
To enable the PLC to control the converter through the run/stop optionsand 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), setP251=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), setP253=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 andthey are read by the PLC, independent of the functions programmed atthe parameters P263...P268.
CONFIGURATION OF THE CFW-09 CONVERTER WITH PLC BOARD
16
Digital Relay Outputs DO101...DO103, P277, P279and P280:
These Parameters correspond to the RL1...RL3 drive outputs. To enablethe PLC to control these outputs, you must set these parameters tothe function ‘PLC’, i. e. P277=27, P279=27 and P280=27.
17
BOARD INSTALLATION INTO THE INVERTER
CHAPTER 7
NOTE!When size 1 is used, remove the plastic side cover to insert the PLCcorrectly.
PLC Board
CC9 Board
Screw M3 x 8Torque 1Nm CFW-09 - Size 1 and 2
CFW-09 - Size 3 to 10
18
DETAILED PARAMETER DESCRIPTION
Range[Factory Setting]
Parameter Unit Description / NotesP750 -Firmware Version [ - ]of the PLC board -
Read parameter.Example: version 1.30. At the parameter you can read 130.
P751 -Scan cycle of the [ - ]User Program x100 µs
P752 0...1Resets retentive [ 0 ]markers -
Read parameter.It shows the duration of the user program cycle. Each unit correspondsto 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 cycleis 79 ÷ 10 = 7,9ms.
It reset the retentive markers, both bit type and word type.Set the parameter to 1 (one) and restart the system. The value ofthis parameter returns to 0 (zero) automatically.
P753 0...65535Loads default [ 0 ]settings, if =1234 -
It loads the factory setting to the system parameters (750...P799).Set this parameter to 1234 and reset the system.
P754 -Position reference [ - ](rotations) rot
It shows the position reference in rotations. The position referencestarts at zero and after the movement has been concluded, it returnsto zero.
P755 -Position reference [ - ](fraction of turn) degrees/10
It shows the fraction of the revolution of the reference position intenth of degree. The position reference starts at zero and after themovement has been concluded, it returns to zero.
P756 -Position signal [ - ]
-
Signal of the real position shown at Parameters P757 and P758.1 = positive and 0 = negative.
P757 -Real position (rotations) [ - ]
rot
It shows the real position in rotations.
P758 -Real position [ - ](fraction of turn) degrees/10
It shows the fraction of revolution of the real position in tenth of degree.
P760 0...200Proportional position [ 50 ]gain (Kp) -
Increase this gain to speed up the answer to a position error anddecrease this gain when system vibrates or becomes unstable.
P761 0...200Integral position [ 0 ]gain (Ki) -
It has the function to reset eventual position errors. In general, thisgain is zero and may cause a position overshoot, i.e. to go beyoudthe desired position and return.
CHAPTER 8
DETAILED PARAMETER DESCRIPTION
19
Range[Factory Setting]
Parameter Unit Description / NotesP762 0...65535Max. lag error [ 0 ]
degrees/10
This is the max. permitted positioning error, i. e., the max. permitteddifference between reference position and the real position, in degrees.The parameter and the lag values are divided by 10. For instance 10at P762 means that the max. following error is 1 degree. WhenP762 = 0 (default setting), the lag error will not be checked.
P763 0...1Desables user [ 0 ]program, if=1 -
P765 1...5Baud rate of RS232 [ 4 (= 9600bps) ]
-
When this Parameter is set to 1, it disables the user program. Thissetting should be used in any abnormal condition only, where theprogram is causing some error type, for instance, when it preventsthe communication with the serial interface. In this case, disable theprogram and install the new corrected version and then enable itagain.
Sets the baud rate of the serial interface.The permitted settings are:
P766 -Satus of the [ - ]Digital Inputs -
It shows the status of the 15 digital inputs: 9 digital inputs of thePLC1 and 6 digital inputs of the inverter.The read number should be converted to binary value, thus obtaininga direct read of the status of each input.
P767 0...10000Synchronous motor [ 1800 ]speed rpm
For instance, a 4 pole motor - 50 Hz, has a synchronous speed of1500RPM.
P768 0...65535Encoder resolution [ 1024 ]
ppr
It shows the number of pulses per encoder revolution.
P769 0...3599Position of the encoder [ 0 ]zero pulse degrees/10
The input value should be in tenth of degree. This value can be usedto search for the machine zero and so set the zero position.
P76512345
Baud-Rate (bps)1200240048009600
19200
BIT14 BIT13 BIT12 BIT11 BIT10 BIT9 BIT8DI101 DI102 DI103 DI104 DI105 DI106 DI9
BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 BIT0DI8 DI7 DI6 DI5 DI4 DI3 DI2 DI1
The DI101 to DI106 represents the status of the 6 digital inputs of thedrive and the DI1 to DI9 represents the status of the 9 digital inputs ofthe PLC1.
P764 1...247PLC adrres [ 1 ]at network -
When, for instance, the MODBUS network connection is used throughserial interface RS 485 (inverter RS232-RS485), this parameter defi-nes the address at the network board.
DETAILED PARAMETER DESCRIPTION
20
Range[Factory Setting]
Parameter Unit Description / NotesP772 0...8CAN Baudrate [ 0 ]
bit/second
Adjust CAN baudrate. Accept Values:
P775 0...5CAN Status [ - ]
-
Read ParameterInform CAN Status:0=Disabled1=Reserved2=CAN enabled3=Warning (some telegrams with error)4=Error Passive (Much telegrams with error or is the only networkdevice with enabled CAN transmitting telegrams).5=Bus Off (number of detected errors exceeded the internal devicelimit and the communication has been disabled)
P772
012345678
Description
1 Mbit/sReservado500 Kbit/s250 Kbit/s125 Kbit/s100 Kbit/s50 Kbit/s20 Kbit/s10 Kbit/s
MaximumCable Length
25 m-
100 m250 m500 m600 m
1000 m1000 m1000 m
P773 0...1Bus off Recovery [ 0 ]
-
This parameter allows the PLC1 action selection when a bus offerror occurs. The permitted values are:
P7730
1
DescriptionManual
Automatic
NoteAfter the bus off error has been detected,the device displays E61, the CANcommunication will be disabled and thedevice must be reset manually to returnto network operation.The communication will be restartautomatically after bus off error has beendetected.
P776 0...65535Counter of received [ - ]telegrams -
Read parameterCyclic counter is incremented at each CAN telegram received withsuccess. Counting is restart each time the counter reaches to upperlimit.
P777 0...65535Counter of [ - ]transmitted -telegrams
Read parameterCyclic counter is incremented at each CAN telegram received withsuccess. Counting is restart each time the counter reaches to upperlimit.
P778 0...65535Counter of [ - ]detected errors -
Read parameterCyclic counter is incremented each time an error is detected (warning,error passive or bus off). Counting is restart each time the counterreaches to upper limit.
21
WLPWLP is a software for Windows ambient used to program the PLC1 boardin Ladder language. Its installation and programming in a PC isvery easy.
This Manual describes the basic procedures required for the WLPinstallation and for the creation of new projects and gives a general view ofthe blocks existing in the PLC1.
1. Insert the disk into the CD-ROM2. 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. Open the WLP.2. Select the option “New Project”.3. Enter a name for the project.4. Start programming by using the commands of the Edition Bar.5. After programming has been concluded, press <F7> (menu-
construct - compile) to compile the project and to correct eventualerrors.
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 “WithoutParity”
8. Transmit the programm by keying <F8> (menu-communication-transmit 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 unitmay be editted in the WLP through the parameter editor (Alt+G), andafterwards transmitted to the PLC1 board.
CHAPTER 9
9.1 WLP Installation
9.2 Programming Starting
9.4 General Condiderationabout ProgrammableBlocks
9.4.1 Position / Offset -SCURVE, TCURVE,HOME:
The position / offset comprised three parts:signalnumber of revolutionsFraction of revolution
Signal:Depending on the data type that has been chosen, the signal comprisesa data type and an address or a constant value,
The data type of signal be:constantuser parameterbit markerdigital input
For the data type, the value may be:positivenegative
9.3 Parameter settable by user
WLP
22
Number of Revolutions:Depending on the chosen data type, the number of revolutions consists ina data type and an address or a constant value.
The data type may be:constantuser parameterword marker
For the constant data type, the value must be programmed according tothe unit that has been configured in the project, and the configuration ofthe field “Fraction of Revolution” is not required.
For the user parameters and the word markers, should be considered forthis field the number of revolutions.
Fraction of Revolution:The fraction of revolution consists only in an address, since it shares thesame data type of the field “Number of Revolutions”.
When the data type is constant, this value is ignored and only the constantconfigured in the field "Number of Revolutions" is valid.
For the user parameters and the word markers, the considered unit forthis field is the pulse number, which may vary between 0 to 65535 pulses,and is equivalent to a range from 0 to 359,9945068359375º.
Depending on the chosen data type, the speed consists in a data typeand an address or a constant value.
The speed data type may be:constantuser parameterword marker
For the constant data type, the value should be programmed according tothe unit configured in the project.
For the user parameters and the word marker, the unit to be consideredfor this field is the RPM (rotation per minute).
Depending on the chosen data type, the acceleration/deceleration consistsin a data type and an address or constant value.
The acceleration data type may be:constantuser parameterword marker
For the constant data type, the value should be programmed according tothe unit configured in the project.
For the user parameters and the word marker, the unit to be consideredfor this field is the RPM/s (rotation per minute per second).
Depending on the chosen data type, the jerk consists in a data type andan address or constant value.
9.4.2 Velocidade - INBWG,SCURVE, TCURVE,HOME, JOG,SETSPEED:
9.4.3 Acceleration/Deceleration -SCURVE, TCURVE,HOME, STOP, JOG,SETSPEED:
9.4.4 Jerk - SCURVE:
WLP
23
For the user parameters and the word marker, the unit to be consideredfor this field is the RPM/s² (rotation per minute per second to the square).
The mode is always constant.
Here there are two options:relativeabsolute
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 thesignal, i. e., clocwise direction of rotation when positive and counter-clockwise direction of rotation, when negative.
The aboslute mode refers to the machine zero position, but this zeroposition may be used only when a zero search has been effected previously.
The direction of rotation is always constant.
Here there are two options:clockwisecounter-clockwise.
Depending on the chosen data type, the total part consists in a data typeand an address or constant value.
The data type of the total part may be:constantword markeruser parameter
ATTENTION!When the total part refers to an output result of any block, the constantdata type is not allowed.
The fractional part consists in a data type and an address.
The data type of the fractional part may be:constantword markeruser parameter
ATTENTION!When the fractional part refers to an output result of any block, the constantdata type is not allowed.
The jerk data type may be:constantuser parameterword marker
For the constant data type, the value should be programmed according tothe unit configured in the project.
9.4.5 Mode - SCURVE,TCURVE:
9.4.6 Direction of Rotation -INBWG, HOME, JOG,ETSPEED:
9.4.7 Total Part - INT2FL,FL2INT:
9.4.8 Farctional Part -INT2FL, FL2INT:
WLP
24
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 constantdata type is not allowed.
The float limits are:max. presentation = 3.402823466e+38Fmin. positive value = 1.175494351e–38F
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)
TypeRetentive Bit markers
Volatile Bit MarkersRetentive Word markers
Volatile Word MarkersSystem Markers
Volatile Float MarkersUser Parameters
Digital InputsDigital Drive Inpiuts
Digital OutputsDigita Drive OutputsAnalog 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,
Quantity672
1308300800
1100100
966322
9.4.9 Float - INT2FL, FL2INT,MATH, COMP, PID, SAT,FUNC, FILTER:
9.4.10 Limits - PID, SAT:
9.4.11 Input Values/Output Values - SAT,FUNC, FILTER:
9.5 Address Range
25
WLP BLOCKS
CHAPTER 10
10.1 Normally OpenContact (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 markerdigital inputdigital outputuser parameter
NOTE!In the user parameter option, the even values correspond to 0, while theodd values correspond to 1.
Operation:When its argument value is 1, it transfers the signal contained in its inputto 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 marker1000. Otherwise, write 0.
WLP Blocks
26
10.2 Normally ClosedContact(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 markerdigital inputdigital outputuser parameter
NOTE!In the user parameter option, the even values correspond to 0, while theodd values correspond to 1.
Operation:When its argument value is 0, it transfers the signal contained in its inputto 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 marker1000. Otherwise, write 0.
WLP Blocks
27
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 markerdigital outputuser parameter
NOTE!In the user parameter option, the current value is not saved in the E2PROMmemory, i. e. the last value is not recovered. In addition, the even valuescorrespond 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 marker1000. Otherwise, write 0.
WLP Blocks
28
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 markerdigital outputuser parameter
NOTE!In the user parameter option, the current value is not saved in the E2PROMmemory, i. e. the last value is not restored. In addition, the even valuescorrespond 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 parameter800 is 0, write 1 to the digital output. Otherwise, write 1.
WLP Blocks
29
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 markerdigital outputuser parameter
NOTE!In the user parameter option, the current value is not saved in the E2PROMmemory, i. e. the last value is not recovered. In addition, the even valuescorrespond to 0 and the odd values correspond to 1.
Operation:The argument is set, when the input signal is 1.The argument will be resetonly 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 thedigital input 1 is 1 and the user parameter 800 is 0, it sets the digitaloutput 1. Otherwise, the output value is maintained.
WLP Blocks
30
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 markerdigital outputuser parameter
NOTE!In the user parameter option, the current value is not saved in the E2PROMmemory, i. e., the last value is not recovered. In addition, the even valuescorrespond to 0 and the odd values correspond to 1.
Operation:When the input signal is 1, the argument is reset. The argument will beset 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, theparameter value is maintained.
WLP Blocks
31
10.7 Positive TransitionCoil (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 markerdigital outputuser parameter
NOTE!In the user parameter option, the current value is not saved in the E2PROMmemory, i. e., the last value is not recovered. In addition, the even valuescorrespond 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 isset during the scan cycle. Then the argument is reset, even if its inputremains at 1.
Chart:
POSITIVE TRANSTION COIL
Example:
When the digital input 1 commutates from 0 to 1, write 1 for 1 scan cycleinto the bit marker 2000.
1 SCAN CYCLE
WLP Blocks
32
10.8 Negative TransitionCoil (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 markerdigital outputuser parameter
NOTE!In the user parameter option, the current value is not saved in the E2PROMmemory, i. e., the last value is not restored. In addition, the even valuescorrespond 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 isset during the scan cycle. Then the argument is reset, even if its inputremains at 0.
Chart:
NEGATIVE TRANSITION COIL
Example:
When the digital input 1 commutates from 1 to 0, write 1 for 1 scan cycleinto the bit marker 2000.
1 SCAN CYCLE
WLP Blocks
33
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 theprogrammed one and if the motor speed is higher or equal to theprogrammed value.
Operation:If the EN input is 0, the block will not be executed and the ENO outputcommutates to 0.
If the EN input is 1, the block compares the speed and the motor directionof rotation with the programmed speed arguments an the direction ofrotation.
If the motor is running in the same programmed argument direction ofrotation and the motor speed is higher or equal to the programmed speedargument, then it is transferred 1 to the ENO output. Otherwise, 0 istransferered to the ENO output.
Flow chart:
direction of rotation =programmed direction of
rotation ?
speed >=programmed speed?
WLP Blocks
34
INBWG
Example:
The INBWG block will be activated, while the digital input 1 is 1. In thiscase, if the motor is running clockwise and its speed is higher or equal to1500 rpm, it writes 1 to the digital output 1. Otherwise, it writes 0.
Chart:
PROGRAMMED SPEED
EFFECTIVE SPEED
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)
WLP Blocks
35
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 outputchanges to 0.
If there is at least one pulse at the EN input during the scan cycle andthere 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 duringthe scan cycle and later returns to 0.
Important: This block operates with position loop, and and it remains inthis function even after the process has been ended.
Flowchart:
is there onepositioning active?
is this block?
did positioning finish?
in this scan cycle? finish the block
start positioning
WLP Blocks
36
SCURVE
Chart:
AT MIN. 1 SCAN CYCLESPEED
ACCELERATION
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
EN
JERK
ENO
WLP Blocks
37
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 outputchanges to 0.
If there is at least one pulse during one scan cycle at the EN input, and ifthere is no other positioning block active, a positioning with trapezoidalprofile will be exceuted, based on the arguments programmedcharacteristics.
After the positioning has been ended, the ENO input changes to 1 duringone scan cycle and then returns to 0 again.
Important: This block operates in positioning loop and remains at thisfunction even after the process has been terminated.
Example:
When a transition from 0 to 1 is captured at the digital input 1 when it'striggered a positioning with 20.5 revolution at a speed of 2000 rpm, withan acceleration of 50000 rpm/s and a jerk of 230000 rpm/s², in the clockwisedirection of rotation, since the mode is relative and the positioning signalis positive. After the positioning process has been ended it writes 1 during1 scan cycle to the digital output 1.
Remember that the jerk is the derivative from the acceleration as timefunction. Thus we can conclude that the max. acceleration will be reachedat 50000 rpm/s / 230000 rpm/s² = 0.22 seconds.
10.11 Block of the TrapezoidalCurve (TCURVE)
Figure:
WLP Blocks
38
Flowchart:
Chart:
TCURVE
SPEED
ACCELERATION
AT MIN. 1 SCAN CYCLE
1 SCAN CYCLE
EN
ENO
is there onepositioning active?
is this block?
is positioningfinished?
in this scan cycle? finish the block
start positioning
WLP Blocks
39
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 positioncommand is triggered to the absolute position, configured with the signalof the user parameter 800, with the number of revolutions of the userparameter 801 and with the fraction of revolution of the user parameter802, with the speed of the user parameter 803 and with an accelerationbased on the user parameter 904 in rpm/s. Thus is required that a machinezero search has been executed previously. When finished, it writes 1during a scan cycle at the digital output 1.
10.12 Search Block forMachine Zero (HOME)
Figure:
Description:It is formed by 1 EN input, 1 ZEROSW input, 1 ENO output and4 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 zeromachine position has been reached.
The ENO output informs the moment when the block has been finished.
WLP Blocks
40
Operation:
If the EN input is 0, the block is not executed and the ENO output remainsat 0.
If there is less than one pulse during a scan cycle at the EN input, and noother positioning block is active, the zero search is enabled with trapezoidalprofile based on the characteristics of the programmed arguments.
At the moment when there is at minimum one pulse during one scancycle at the ZEROSW input, the search for the zero pulse is started. Assoon as the zero pulse is found, the stop process is started and then thereturn to the position of the zero pulse is executed.
Now the block is finished and the ENO output changes to 1 during onescan cycle and then returns to 0.
NOTE!Assuming that this block is enabled and the ZEROSW input is 1, thesearch is started in the opposite direction as programmed until theZEROSW input changes to 0. At this moment, the block reverses thedirection of rotation and repeats the step described in the item above.
As this block is finished, the found position will be referenced to theprogrammed offset value that generally is zero. If we program a negativeoffset with 25 revolutions and we execute a relative positioning with 50revolutions with positive signal, the reached position would be of 25revolutions and 0 fraction of revolution with positive signal. However is thepositioning would be absolute, the end position would be of 50 revolutionsand 0 fraction of revolution with positive signal and executing in fact 75revolutions in clockwise direction of rotation.
NOTE!Depending on the value of the Parameter 769, the position may show anoffset that causes a position advance relating to the zero pulse.In this case, the stop will be the value of the tenth degrees of parameterP769 before the zero pulse.
ATTENTION! After the machine zero search, the control remains in position loop.
WLP Blocks
41
Flowchart:
Chart:Normal condition - ZEROSW = 0
HOME
SPEED
ZERO PULSE
AT MIN., 1 SCAN CYCLE
1 SCAN CYCLE
ZEROSW
Depends on thevalue of P769
is there onepositioning active?
is this block?
was there a positivetransition on ZEROSW
input?
zero pulse reached?
return to zero position?
position is positioningfinished
in this scancycle?
finish theblock
start positioning
WLP Blocks
42
Excepting - ZEROSW = 1
SPEED
ZERO PULSE
AT MIN., 1 SCAN CYCLE
1 SCAN CYCLE
ZEROSW
HOME
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 machinezero search, since the marker of the bit 2001 is enabled at 0. The searchfor the zero pulse is started, when the input 2 changes to 1. The motordecelerates and returns to the found zero pulse position plus the value ofP769, as soon as the zero pulse is found. The marker 2001 is set as soonas the positioning process has been concluded and now a new search isenabled.
WLP Blocks
43
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, astop with trapezoidal profile is executed, based on the characteristicsprogrammed at the arguments.
As the stop has been concluded, the ENO output changes to 1 during onescan 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. Assoon as the input EN changes to 0, the previous active positioning blockis restored, provided the current position is not higher or equal to thedesired position by the previous active positioning. This can occur if thedeceleration of the stop block is too slow.
The cancel mode does not restore the previous positioning when the ENinput is 0.
Note: If use to stop the machine zero search, the stop mode will be alwayscancelled, even when programming has been set to interrupt.
Important: This block does not change the control way, indifferent if it is inposition loop or in speed loop.
WLP Blocks
44
Flowchart:
Chart:
SPEED AT MIN., 1 SCAN CYCLE
1 SCAN CYCLE
STOP - INTERRUPT
run stop
stopped
in this scan cycle
was there oneprevious positioning?
interrupt is mode?
restore positioning
finish the block
WLP Blocks
45
Please note that in this case, after the EN input changes to 0, a S-curveis started, since this S-curve was being executed before the stop commandwas given.
SPEED AT MIN., 1 SCAN CYCLE
1 SCAN CYCLE
STOP - CANCELL
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 thepositioning interruption. After stopping, the digital output 1 of the drive 1 iswritten during one scan cycle. As soon as the digital input 2 returns to 0,the positioning of 100 revolutions is completed.
WLP Blocks
46
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 at0.
If the EN input is 1 and no other positioning block is active, the blockexecutes a trapezoidal profile based on the characteristics programmedin 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 beenfinished, the ENO output changes to 1 during one scan cycle ant thenreturns to 0.
NOTE!The JOG speed is not used online, i.e., even when the programmed speedis changed, the speed of this block will not be changed.
Important: This block work in speed loop, and remains in this status evenafter the block has been finished.
WLP Blocks
47
Flowchart:
CHART:
SPEED AT MIN., 1 SCAN CYCLE
1 SCAN CYCLE
JOG
has it been run?
stopped?
in this scan cycle?
is there onepositioning active?
is this block?
finish the block
run the block
WLP Blocks
48
Example:
When the digital input 1 of the drive is 1, the digital output 1 is set and atthe same time JOG is enabled at a speed of 0,3 rps. When the input 1returns to 0, at the moment when the block ends, i. e., when it stopscompletely, 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 programmedspeed.
Operation:
If the EN input is 0, the block is not executed and the ENO output remainsat 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 onthe characteristics programmed in the arguments and never are finished.However othe blocks Set Speed may be enabled online, thus changingthe 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 blockreaches the programmed speed. Otherwise it is always 0.
Important: This block works in speed loop and remains in this status evenafter it has been concluded.
WLP Blocks
49
Flowchart:
Chart:
SPEED AT MIN., 1SCAN CYCLE
1 SCAN CYCLE
SETSPEED
is this block active?
previous EN = 0 ?previous EN = 0 ?
is there onepositioning active?
is a setspeed?
initialize theblock
continue run
did reach theprogrammed speed?
in this scan cycle?
WLP Blocks
50
Example:
During the transition from 0 to 1 of the digital input 1 of the drive, the blockwith speed of 500 rpm in clockwise direction of rotation is triggered. Assoon 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 blockwith speed of 1000 rpm in counter-clockwise direction of rotation is triggeredand the digital output 1 is reset. If the digital input 1 is driven any one ofthe two previous movements that is active is cancelled and the motorstops and both outputs 1 and 2 are reset.
10.16 Timer Block(TON)
Description:This block is formed by 1 IN input, 1 Q input and 2 arguments, being:
PT – preset timeET – 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 constantvalue, depending on the chosen data type.
The signal data type may be:constantuser parameterword marker
For the constant data type, the max. permitted value is 30.000 ms.
Figure:
WLP Blocks
51
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 parameterword marker
NOTE!In the option User Parameter, the current value is not saved in the E2PROMmemory, i. e., this last value is not restored.
Operation:
If the IN input is 0, the elapsed time argument is reset and the Q outputchanges to 0.
If the IN input is 1, the elapsed time is incremented till the value on theargument 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 inputchanges to 0.
Flowchart:
did reach the presettime?
Initialize
WLP Blocks
52
Chart:
TON
Example:
When the digital input 1 of the drive is 1, a positioning based on the userparameter 800 to 803 is enabled. After this positioning has been concluded,the digital output 1 is set and the timer is enabled. After the programmed2000 ms have been elapsed, the digital output 1 is reset.
10.17 Incremental CounterBlock (CTU)
Figure:
WLP Blocks
53
Description:
It is formed by 1 CU input, 1 R input, 1 Q output and 2 arguments, being:
PV – desired countingCV – 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 datatype and an address or a constant value.
O The counting data type may be:constantuser parameterword 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 parameterword marker
NOTE!In the User Parameter option, the current value is not saved in the E2PROMmemory, i. e., this last value is not restored.
Operation:
When the CU input changes from 0 to 1, the elapsed counter value isincremented, 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 outputis 0.
While R input is 1, the counter value is reset and the counting is notincremented.
WLP Blocks
54
Flowchart:
Chart :
previous CU = 0 ?
did reach the presetvalue?
incrementcounter value
reset countervalue
WLP Blocks
55
Example:
If there is a transition from 0 to 1 at the digital input, or the bit 100 markeris 1, and the digital output 1 is 0, a TCURVE positioning is enabled.After conclusion, marker 1000 changes to 1, thus enabling the CTU blockto make a counting and starting again the positioning, provided the digitalinput 1 is 0. After the counter has detected 50 positive transitions in themarker 1000, i.e., it has realized 50 positionings, the digital output 1changes to 1, and makes impossible a new positioning before the digitalinput 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, beingSRC – source dataDST – 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 adata type and an address or a constant value:
The source data type may be:constantfloat constantbit markerword markerfloat markersystem markeruser parameterdigital inputdigital outputanalog input
WLP Blocks
56
DST (Destination data):
The destination data is formed by data type and an address and it is thelocal where is saved the source data value.
The destination data type may be:bit markerword markerfloat markersystem markeruser parameterdigital inputdigital output
NOTE!In the option User Parameter , the current value is not saved in the E2PROMmemory, 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 istransferred to the destination data. Otherwise no operation is realized.
Please consider the compatibility of the source data type and thedestination data.Example:
The digital input 1 set to 1, enables the TRANSFER. Thus the valuecontained in the analog input 1 is shown at the user parameter 800.
An useful application of the TRANSFER block is its use for enabling themotor start, for instance, through a digital input. So SRC will have a digitalinput as value, and DST a %SW0 system marker. Please consider thatthe motor is enabled only if it has been already enabled in the CFW-09inverter. This may be programmed, for instance, at the digital input 1 of thedrive.
WLP Blocks
57
10.19 Integer to Floating PointConverter Block(INT2FL)
Figure:
Description:
This block is formed by 1 EN input, 1 ENO output and 3 arguments, beingentire 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 fractionalword 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. Afractional word represents a decimal number always positive between0.0 to 0.9999847.
Example: The conversion of an entire word, equal to 3, and a fractionalword, 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 marker9000. Please consider that the parameter 800 represents the entire partand the parameter 801 represents the fractional part.
10.20 Floating Point toInteger 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.
WLP Blocks
58
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 tothe entire word and to the fractional word.
The entire word and to the fractional word represent a number in 16.16format. The entire word represents an integer number and may varybetween -32768 and 32767. The fractional word represents a decimalnumber, 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 anda 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 userparameters 800 and 801, where the parameter 800 will be 3, and theparameter 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:operatorfloat 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, werecommend to use the blocks INT2FL and FL2INT.
WLP Blocks
59
Operator:
The operator is always constant.
There are following options:SumSubtractionMultiplicationDivision
Operation:
The EN input transfers always its value to the ENO output.
While the EN input is 1, the mathematic operation programmed betweenthe arguments float 1 and float 2 is executed and the results are transferredto 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 saturatedto the max. and min. float values, depending if the value of the numeratoris higher or lower than 0. For saturated signal effects, zero is consideredwith positive signal.
Example:
At every pulse given at the digital input 1, the value of the user parameter800 and 801 is incremented by 1.5. Please remember that the value of theparameter 800 represents the entire part and the value of the parameter801 represents the fractional part.
WLP Blocks
60
10.23 Comparator Block(COMP)
Figure:
Description:This block is formed by 1 EN input, 1 ENO output and 4 arguments,being:
operatorfloat 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, werecommend to use the blocks INT2FL and FL2INT.
Operator:
The operator is always constant.
There are following options:Equal toDiffrent fromHigher thanHigher than or equal toLower thanLower than or equal to
Operation:
When EN input is 0, the block is not executed and the ENO output changesto 0.
While the EN input is 1 and the comparison [float 1] [operator] [float 2] istrue, the ENO output changes to 1. Otherwise it changes to 0.
WLP Blocks
61
Example:
In this example, if the value contained in the analog input 1 of the drive ishigher 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 switchedOFF.
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, werecommend to use the blocks INT2FL and FL2INT.
WLP Blocks
62
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 arereset.
ATTENTION!At maximum, two PID blocks may be active simultaneously. When a thirdblock is present, no one will be executed, even when they are active at theEN input.
Blockdiagram:
Reference
Feedback
Kd.s
Kp
Kis
SATControl
+
+
++
-
Example:
WLP Blocks
63
As explanation one can say that the reference value is given by the userparameter 800 and then converted to the float marker 9000. The value ofthe feedback signal is given by the value contained at the analog input 1of the drive, which is transferred to the word marker 6000 and convertedto the float marker 9001. The control output of the of the PID block is themarker 9002 which is converted to the word markers 6001 and 6002. Thevalue contained in the word marker 6002 is transferred to the analog output2 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, werecommend to use the blocks INT2FL e FL2INT.
Operation:
If the EN input is 0, the block is not executed and the ENO output changesto 0.
While the EN input is 1, the block is executed. The ENO output changesto 1 only, if there is any saturation. Otherwise the ENO output remainsat 0.
The function of this block is to transfer the input data to the output, providedthey are within the programmed limits. When these values are higher orlower that the maximum and the minimum programmed ones, the outputvalue is saturated with these values.Example:
WLP Blocks
64
The value contained at the analog inout of the drive is transferred to theword 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. TheSAT block causes that on the float marker 9001 is read a value onlybetween 10000 e 20000.
10.26 Mathematic FunctionBlock (FUNC)
Figure:
Description
This block is formed by 1 EN input, 1 ENO output and 2 types of arguments,being:
functionvalues (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, werecommend to use the blocks INT2FL and FL2INT.
Function:
The function is always constant.
There are following options:absolute (module)negativesquare rootsinecosinetangentsine arccosine arctangent 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 radianscosine: [output] = cos([input]) → [input] in radianstangent: [output] = tag([input]) → [[input] in radianssine arc: [output] = asin([input]) → [output] in radianscosine arc: [output] = acos([input] ) → [output] in radianstangent arc: [output] = atag([input]) → [output] in radians
WLP Blocks
65
Example:
During the transition from 0 to 1 at the digital input 1, the user parameters800 and 801 are converted to the float marker 9000. Then the square rootis calculated from the value contained in the float marker 9000 and theresult is saved in the float marker 9001. Then the value of the float marker9001 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 typefloat – 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, werecommend to use the blocks INT2FL and FL2INT.
Type:
The filter type is a constant and may be:low-pass filterhigh-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 argumentsare reset.
WLP Blocks
66
NOTE! The time constant is given in seconds.
ATTENTION!At maximum 2 filter blocks may be active each time. When three filterblocks are present, no one will be executed, even they are active at its ENinput.
Block Diagram:
1τ.s + 1
OutputInput
Low-pass filter
τ.sτ.s + 1
OutputInput
High-pass filter
Example:
The value contained at the analog input of the drive 1 is transferred to theword 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, resultinginto the floar marker 9001.
output = input time constant * s + 1
for low-pass filters:
output = input * time constant * s time constant * s + 1
for high-pass filters:
The filter transfer function is given by:
WLP Blocks
67
10.28 Follow Figure:
Description:
It is formed by 1 EM input, 1 ENO output and 2 argument, being:DirectionSynchronism ratio
The EN input enables the Slave to follow the Master according to the datareceived 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 orconstants. Depending on the selection, the data type may be:
constantuser parameterword marker
The addresses or constants are destined for the master relation or slaverelation.
Operation:
If the Master Drive is sending the data via CAN Network and the EM inputof the Follower block is active, the slave motor follows the master motoraccording to the values of the speed loop synchronism ratio
The ENO output will be set only after the salve motor reaches the specificratio of the master motor.
Example:
If the Master is sending the data via CAN network, the slave motor runs at50% of the master motor speed.
WLP Blocks
68
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 speedand 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 speedreference and position via CAN network.
NOTE!If this block has not been enabled in the master design, the slave will notfollow the master.
Example:
The CAN communication is enabled automatically and the PLC board startsthe transmission of the speed and the position reference to the slave.
69
RTU–MODBUS PROTOCOL IN THE PLC1
Please find below an explanation about the operation of the PLC1 board inthe RTU- Modbus.
The baud rate is defined at the parameter 765. Following transfer rates arepossible:
1 – 1200bps2 – 2400bps3 – 4800bps4 – 9600bps (Factory Setting)5 – 19200bps
The communication is made through RS-232C, without parity, 8 bits and 2stop 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 canbe set between 1 and 247 (0 is the broadcast address). The factory settingis 1.
What can be programmed with the PLC1 when the RTU-Modbusprotocol 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 writethe board parameters (P750...P899) in addition to the parameters of theown inverter (P000...P413). This programming can be carried out in onlyone 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 operationcan be carried out in only one digital input/output and in a parametergroup.Note: If the user program uses any PLC digital output, this program willhave priority over the write operation through the Modbus, i. e., the userprogram 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, suchas, manufacturer (WEG), model (PLC1.01, for example and the firmwareversion (V1.40, for example).
Detailed Protocol Description:
CHAPTER 11
RTU - Modbus Protocol in the PLC1
70
11.1 MODBUS-RTU
11.1.1 Introduction to Modbus-RTU Protocol
The Modbus protocol has been developed in 1979. Currently this protocolis a disclosed protocol and used widely by several equipmentmanufacturers. The RTU-Modbus communication for the PLC1 board hasbeen 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 elementsthat are part of the Modbus network, as well as the services (or functions)that are available via network and how these elements exchange the datavia network.
11.1.1.1 Trasmission Mode
In the RTU transmission mode, each byte is transmitted as being oneonly word with it value as hexadecimal value. The PLC used thistransmission mode only for the communication, and does not allow thecommunication in the ASCII mode.
11.1.1.2 Message Structure inthe RTU-Mode
The RTU-Modbus network operates in the Master-Slave system, wherecan be available up to 247 slaves, but only one master can be connected.Every communication starts with the master requesting the salve and theslave answering to the master what has been requested. The structure isthe same in both telegrams (request and answer): address, Function Code,Data and CRC. Depending on the request, only the data field may havevariable length.
Master Request MessageAddress (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
Start B0 B1 B2 B3 B4 B5 B6 B7 Parity or Stop Stop
During the protocol specification you can chose between two transmissionmodes: ASCII or RTU. These modes define how the message bytes aretransmitted. You can not use the two transmission modes in the samenetwork.
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, whenparity bit is not used). Thus the bit sequence for the transmission of onebyte is following:
RTU - Modbus Protocol in the PLC1
71
11.1.1.2.1 Address Master starts the communication by sending a byte with the slave addressto which the message should be sent. For the response, the salve alsostarts the message with its own address. The Master can also send amessage to the address 0 (zero), which means that this message isdestined to all slaves of the network (broadcast). However in this case noslave will answer to the master.
11.1.1.2.2 Function Code This filed also contains an only byte, where the master specifies theservice of function requested from the slave (read. write, etc.). Accordingto the protocol, each function is used for accessing one specific datatype.
11.1.1.2.3 Data Field Field with variable length. The format and content depend on the usedfunction and on the transmitted values. This field is described in thefunction description (see Item 8.14.3).
11.1.1.2.4 CRC The last part of the message is the field for checking the transmissionerrors. The used Method is the CRC-16 (Cycling Redundancy Check).This field is formed by two bytes. The least significant byte (CRC-) istransmitted first, only then is transmitted the most significant byte (CRC+).The CRC calculation is started by loading a 16 bit variable (referencedfrom now on as CRC variable) with the value FFFFh. After that, proceedaccording 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 8least significant bits of the CRC variable, by returning the result to theown CRC variable.
2. Then the CRC variable is displace by on position to right, in thedirection to the least significant bit and so the position of the mostsignificant bit is filled out with 0 (zero).
3. After the displacement, the flag bit (the bit that has been displacedoutside 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 XORlogic with a A001h constant value and the result is returned to theCRC variable.
4. Repeat the step 2 and 3 until the eight displacements have been carriedout.
5. Repeat the steps 1 to 4, by using the next message byte until thewhole message has been processed.
The end content of the CRC variable is the value of the CRC field that istransmitted at the end of the telegram. The least significant part istransmitted first (CRC-). Then is transmitted the most significant part(CRC+).
RTU - Modbus Protocol in the PLC1
72
11.1.1.2.5 Time BetweenMessages
There is no specific character in the RTU-mode that indicates the beginor the end of a telegram. The interruption of the data transmission duringa time longer than 3,5 times required for transmitting a data word (11bits) is the only indication of the begin or the end of the message. Thus ifa telegram transmission is started only after this minimum time hasbeen elapsed, the network elements assume that the received characterrepresents the begin of a new telegram. In the same way, the networkelements will assume that the telegram transmission has ended afterthis time has elapsed again.If during the transmission of a telegram , the time between the bytetransmission is longer that this minimum established time, the telegramwill be considered as a invalid telegram, this the PLC will disregard thealready received bytes and will assemble a new telegram with the bytesthat are being transmitted.
The table below shows the times for three different communication rates.
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).
Transfer Rate T 11 bits T 3.5x
9600 bits/seg 1.146 ms 4.010 ms
19200 bits/seg 573 µs 2.005 ms
TransmitionSignal
Time T11 bits
T3.5 x Tbetween bytes T3.5 x
Telegram
11.1.2 PLC1 Operation in theModbus-RTU
The PLC boards operate as Slaves at the Modbus-RTU network. Thecommunication starts with the Master in the network requesting any serviceto a network address. If the PLC has been configured for the correspondingaddress, it processes the request and responses to the master asrequested.
11.1.2.1 Interfaces Description The PLC boards use a serial interface for the Modbus-RTU networkcommunication. There are two possibilities for the physical connectionbetween the master in the network an a LPC:
RTU - Modbus Protocol in the PLC1
73
11.1.2.1.1 RS-232
11.1.2.1.2 RS-485
11.1.2.1.3 Configuration at theModbus-RTU
11.1.2.1.4 PLC Address at theNetwork
11.1.2.1.5 Transfer Rate
11.1.2.2 Access to the PLCand Inverter Data
11.1.2.2.1 Available Functionsand Response Times
This interface is used for the point-to-point connection (between anonly 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.
This interface is available through the MIW-02 converter connected tothe PLC RS-232.This interface is used for the multipoint connection (several salves andone 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 networkand 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 slaveaddress 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 transferrate and the same parity.
All PLC and inverter parameters, as well as the PLC digital inputs andoutputs, can be accessed through the network
The parameters have been defined In the PLC as holding type registers. Inaddition to these registers, you can also access the digital board inputsand outputs directly by using the bit type functions of the Modbus. Followingservices (or functions) have been made available for accessing these bitsand registers). In addition to these registers, you can also access directlythe digital inputs and outputs of the board by using the bit type function ofthe Modbus. Following services (or functions) are available for accessingthese bits and register:
Read CoilsDescription: read of the internal bit blocks or coils.Function: it reds the PLC digital outputsFunction code: 01.Broadcast: not supported.Response time: 5 to 10 ms.
Read Holding RegistersDescription: Read of the holding type register blockFunction: it reads the PLC digital outputs.Function code: 03 or 04.Broadcast: not supported.Response time 5 to 10 ms.
RTU - Modbus Protocol in the PLC1
74
Write Single CoilDescription: 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 RegisterDescription: 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 CoilsDescription: write in an internal bit block or coilsFunction: it writes in several PLC digital outputs.Function code: 15.Broadcast: not supported.Response time 5 to 10 ms.
Write Multiple RegistersDescription: 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 IdentificationDescription: Device identification.Function: it reads the PLC model and the firmware versionFunction code: 15.Broadcast: not supported.Response time: 5 to 1o ms
Note: The slaves of the Modbus-RTU network are addressed from 1 to247. The master uses the address 0 (zero) to send a common messageto all slaves (broadcast).
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. Theparameters, as well as the digital inputs/outputs are made available fromthe address 0 (zero) on.
11.1.2.2.2 Data Addressing
... ... ...
... ... ...
Parameters
Parameter Number Modbus Address Decimal Hexadecimal
P000 0 00hP100 100 064h
P800 800 320h
RTU - Modbus Protocol in the PLC1
75
... ... ...
Digital Inputs Modbus Address
Decimal HexadecimalIX1 0 0hIX2 1 1h
IX9 8 8h
Number of theDigital Input
... ... ...
Digital Outputs Modbus Address
Decimal HexadecimalQX1 0 0hQX2 1 1h
QX6 5 5h
Bit Number
11.1.3 Detailed Description ofthe Functions
This item presents a detailed description of the functions that are availablein the PLC for the Modbus-RTU communication. For the telegrampreparation, please note following:
The values are always transmitted as hexadecimal values.The data address, the data number and the register value are alwaysrepresented in 16 bits. Thus it is required for transmitting these fieldsby using two bytes (high and low). The bit accessing and the form torepresent a bit depend on the used function.The telegrams, both the request telegrams and the answer telegramscannot be longer than 128 bytes.
This function read the content of a digital output group of the PLC, whichmust be in numerical sequence. Please note that the output 1 must havethe address 0, and so on up to output 6, which address is 5. This functionhas the following structure for the read and response telegrams (the valuesare always hexadecimal, and each field represents one byte):
11.1.3.1 Function 01 - ReadCoils
Resquest (Master)Slave Address
FunctionAddress oh the initial bit (byte high)Address oh the initial bit (byte low)
Number of bits (byte high)Number of bits (byte low)
CRC-CRC+
Response (Slave)Slave Address
FunctionField Byte Count (number of the data bytes)
Byte 1Byte 2Byte 3etc...CRC-CRC+
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 initialaddress indicated by the master.
The other bytes (when the number of read bits is higher than 8) remains insequence. If the number of the read bits is not multiple of 8, the remainingbits of the last byte must be filled out with 0 (zero).
Example: reading of the digital outputs, DO1 to DO6 at the address 1:
RTU - Modbus Protocol in the PLC1
76
Resquest (Master)Field Value
Slave Address 01hFunction 01h
Initial Bit (high) 00hInitial Bit (low) 00h
Number of bits (high) 00hNumber of bits (low) 06h
CRC- BChCRC+ 08h
Response (Slave)Field Value
Slave Address 01hFunction 01h
Byte Count 01hStatus of the outputs 1 to 6 02h
CRC- D0hCRC+ 49h
11.1.3.2 Function 02 - ReadInputs Status
This function reads the content of a digital input group of the PLC thatmust be in a numerical sequence. Please note that the input 1 has theaddress 0, and so on up to input 9 that must have address 8. This functionhas following structure for the read and response telegrams (the valuesare always hexadecimal values, and each field represents a byte):
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 initialaddress indicated by the master. The other bytes (when the number ofread bits is higher than 8) remains in sequence. If the number of the readbits is not multiple of 8, the remaining bits of the last byte must be filledout with 0 (zero).
Example: reading of the digital inputs, DI2 to DI7 at the address 1:
Resquest (Master)Slave address
FunctionAddress of the initial bit (byte high)Address of the initial bit (byte low)
Number of bits (byte high)Number of bits (byte low)
CRC-CRC+
Response (Slave)Slave address
FunctionField Byte Count (number of data bytes)
Byte 1Byte 2Byte 3etc...CRC-CRC+
Resquest (Master)Field Value
Slave Address 01hFunction 02h
initial Bit (high) 00hinitial Bit (low) 01h
Number of bits (high) 00hNumber of bits (low) 06h
CRC- A9hCRC+ C8h
Response (Slave)Field Value
Slave Address 01hFunction 02h
Byte Count 01hStatus of the inputs 2 to 7 15h
CRC- 60hCRC+ 47h
As in the example the number of the read bits is lower the 8, the slaveneeded 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 readbits is equal to 6, only the 6 least significant bits which have the valuesof the digital inputs 2 to 7 are of interest, The other bits, as they did nothave been requested are filled out with 0 (zero).
RTU - Modbus Protocol in the PLC1
77
11.1.3.3 Function 03 - ReadHolding Register eFunction 04 - ReadInput Register
This function reads the content of a parameter group that must be in anumerical sequence. This function has following structure for the readand response telegrams (the values are always hexadecimal values, andeach field represents a byte):
Request (Mater)Slave address
FunctionAddress of the initial register (byte high)Address of the initial register (byte low)
Number of register (byte high)Number of register (byte low)
CRC-CRC+
Response (SlaveSlave address
FunctionField Byte Count
Data 1 (high)Data 1 (low)Data 2 (high)Data 2 (low)
etc...CRC-CRC+
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 Value
Slave Address 01hFunction 03h
Inicial Register (high) 00hInicial Register (low) 02h
Number of Register (high) 00hNumber of Register (low) 02h
CRC- 65hCRC+ CBh
Response (Slave)Field Value
Slave Address 01hFunction 03h
Byte Count 04hP002 (high) 03hP002 (low) 84hP003 (high) 00hP003 (low) 35h
CRC- 7AhCRC+ 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 nothave 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 be5,3 A.
This function is used to write a value to an only digital output. The outputvalue is represented by two bytes, where FF00h represents the bit equalto 1, and 0000h represents the equal to 0 (zero). Please note that theoutput 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 hexadecimalvalues, and every field represents one byte):
11.1.3.4 Function 05 - WriteSingle Coil
Request (Master)Slave address
FunctionBit Address (byte high)Bit Address (byte low)Bit Value (byte high)Bit Value (byte low)
CRC-CRC+
Response (Slave)Slave address
FunctionBit address (byte high)Bit address (byte low)Bit Value (byte high)Bit Value (byte low)
CRC-CRC+
RTU - Modbus Protocol in the PLC1
78
11.1.3.6 Function 15 - WriteMultiple Coils
Resquest (Master)Field Value
Slave Address 01hFucntion 05h
Number of bit (high) 00hNumber of bit (low) 01h
Value of the bit (high) FFhValue of the bit (low) 00h
CRC- DDhCRC+ FAh
Response (Slave)Field Value
Slave Address 01hFunction 05h
Number of bit (high) 00hNumber of bit (low) 01h
Value of the bit (high) FFhValue of the bit (low) 00h
CRC- DDhCRC+ FAh
11.1.3.5 Function 06 - WriteSingle Register
In this function, the slave response is copy identical to the request madby the master.
This function is used to write a value to an only parameter. This functionhas the following structure (the values are always hexadecimal values,and each field represents one byte):
Request (Master)Slave address
FunctionParameter address (byte high)Parameter address (byte low)Parameter value (byte high)Parameter value (byte low)
CRC-CRC+
Response (Slave)Slave address
FunctionParameter address (byte high)Parameter address (byte low)Parameter value (byte high)Parameter value (byte low)
CRC-CRC+
Example: write of the speed reference equal to 900 rpm, in an userparameter (P800) in the address 1.
Resquest (Master)Field Value
Slave Address 01hFunction 06h
Parameter (high) 03hParameter (low) 20h
Value (high) 03hValue (low) 84h
CRC- 88hCRC+ D7h
Response (Slave)Field Value
Slave Address 01hFunction 06h
Parameter (high) 03hParameter (low) 20h
Value (high) 03hValue (low) 84h
CRC- 88hCRC+ D7h
In this function, the slave response is again an identical copy of the maste4rrequest. The parameters are addressed directly to its number, in theexample above P800 = 0320h.
This function allows writing values to a digital output group of the PLC.This values must be in numerical sequence. This function can also beused for writing to an only output (the values are always hexadecimal,values and each field represents one byte).
Example: enable the digital output 2 of the PLC at address 1:
RTU - Modbus Protocol in the PLC1
79
Request (Master)Slave address
FunctionAddress 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 1Byte 2Byte 3etc...CRC-CRC+
Response (Slave)Slave address
FunctionAddress of the initial bit (byte high)Address of the initial bit (byte low)
Number of bits (byte high)Number of bits (byte low)
CRC-CRC+
Every bit value that is being written is put in a position of the data bytessent by the slave. The first byte, bits 0 to 7, receives the first 8 bits bystarting with the initial address indicated by the master.The other bytes (when the number of read bits is higher than 8) remains insequence. 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 ofthe 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 Value
Slave Address 01hFunction 0Fh
Initial Bit (byte high) 00hInitial Bit (byte low) 03h
Number of bits (byte high) 00hNumber of bits (byte low) 02h
Byte Count 01hValue for the bits 03h
CRC- BAhCRC+ 96h
Response (Slave)Field Value
Slave Address 01hFunction 0Fh
Initial Bit (byte high) 00hInitial Bit (byte low) 03h
Number of bits (byte high) 00hNumber of bits (byte low) 02h
CRC- 24hCRC+ 0Ah
11.1.3.7 Function 16 - WriteMultiple Registers
As only two bits are being written, the master needed only 1 byte for thedata transfer. The transmitted values are in the least significant bits of thebyte that contains the values for the bits. The other bits of this byte havethe values 0 (zero).
This function allows writing values to a parameter group that must be innumerical sequence. This function may be also used for writing one onlyparameter (the values are hexadecimal values an each field representsone byte).
RTU - Modbus Protocol in the PLC1
80
Request (Master)Slave address
FunctionAddress 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...CRC-CRC+
Response (Slave)Slave address
FunctionAddress of the initial bit (byte high)
Address of the initial parameter (byte low)Number of parameters (byte high)Number of parameters (byte low)
CRC-CRC+
Example: writing of the acceleration time (P100) = 1,0 s and of thedeceleration time (P101) = 2,0s, of a CFW-09 in the address 20:
Resquest (Master)Field Value
Slave Address 14hFunction 10h
Initial Register (high) 00hInitial Register (low) 64h
Number of Register (high) 00hNumber of Register (low) 02h
Byte Count 04hP100 (high) 00hP100 (low) 0AhP101 (high) 00hP101 (low) 14h
CRC- 91hCRC+ 75h
Response (Slave)Field Value
Slave Address 14hFunction 10h
Initial Register (high) 00hInitial Register (low) 64h
Number of Register (high) 00hNumber of Register (low) 02h
CRC- 02hCRC+ D2h
As both parameters have a decimal resolution for writing 1.0 and 2.0seconds, so must be transmitted the respective values 10 (000Ah) e 20(0014h).
This auxiliary function allows reading of the product manufacturer, model,and firmware version. This function has following structure:
11.1.3.8 Function 43 - ReadDevice Identification
RTU - Modbus Protocol in the PLC1
81
Request (Master)Slave address
FunctionMEI Type
Read codeObject number
CRC-CRC+
Response (Slave)Slave address
FunctionMEI Type
Conformity LevelMore FollowsNext object
Number of objectsObject Code*Object size*
Object value*CRC-CRC+
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 thePLC are made available only basic information, formatted by threeobjects;
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 versionin ‘VX.XX’ format.
The read code indicates the information categories that are being readand indicated if the objects that are being accessed are in sequenceof are individually . In this case, the PLC supports the code 01 (basicinformation in sequence and the code 04 (individual access to theobjects).Example: read of the basic information in sequence, starting from theobject 00 of a PLC in the address:
Resquest (Master)Field Value
Slave Address 01hFunction 2BhMEI Type 0Eh
Read Code 01hObject Number 00h
CRC- 70hCRC+ 77h
Response (Slave)Field Value
Slave Address 01hFunction 2BhMEI Type 0Eh
Read Code 01hConformity Level 81h
More Follows 00hNext Object 00h
Number of Objects 03hObject Code 00hObject Size 03h
Object Value ‘WEG’Object Code 01hObject Size 07h
Object Value ‘PLC1.01’Object Code 02hObject Size 05h
Object Value ‘V1.40’CRC- 6FhCRC+ 5Fh
RTU - Modbus Protocol in the PLC1
82
11.1.4 Comunnication Erros
In this example, the object value has not been represented as hexadecimalvalue, but it has been represented by using corresponding ASCIIcharacters. For instance, for the object 00, ‘WEG’ value, has beentransmitted by means of three ASCII characters, which in hexadecimalvalues are 57h (W), 45h (E) and 47h (G).
Errors may occur during the telegram transmission through the network.These errors may also be already present in the received telegramcontents. Depending on the error type, the PLC may or not answer to theMaster. When the master sends a message to a board configured atdetermined 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, thePLC 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 notbee implemented or the PLC.Data address is not valid (error code = 2): the data address (parameteror digital I/O) does not exist.The data value is not valid (error code = 3): this error occurs in thefollowing situations:
Value is out of allowed rangeWriting attempt in data that cannot be changed (read-only register,register does not allow data changing with enabled inverter, or bitsin logic status).Write has been made as function of the logic command functionthat has not been enabled via serial.
Then the slave must return a message, indicating the occurred error type.Errors that occur during the message processing for the PLC, are errorsof non-valid function (Code 01), non-valid data address (Code 2) and no-valid data value (Code 03). TThe messages sent by the slave have followingstructure;
11.1.4.1 Error Messages
Response (Slave)Slave Address
Function Code(with the most significantbit set to 1)Error Code
CRC-CRC+