CODESYS - User Parameters - ABB Ltd · Title: CODESYS - User Parameters Author: APR/AD Subject:...
Transcript of CODESYS - User Parameters - ABB Ltd · Title: CODESYS - User Parameters Author: APR/AD Subject:...
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 1
CoDeSys ExerciseUser Parameters
DCS800
DC Drives
Note:This module is an exercise without a speaker!
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 2
Objectives
Create new parameters
After completing this module, you will be able to
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 3
Create new parameters
Read parameter
Write parameterfor internal scaling
Cyclic readingfrom parameter
Write parameterProtect parameteror group
Overview about DCS800 parameter blocks
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 4
Exercise 3: User defined parameters
With DCS800 and CoDeSys it is possible to create user defined parameters
Parameter groups 60 ... 69 are reserved for user defined parameters
It is possible to create texts for the user defined parameters and set their range and units
The user defined parameters are shown in DriveWindow (DW), DriveWindow Light (DWL) and on the DCS800 panel
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 5
User defined parameters
The actual speed must be scaled due to an attached gearbox
The adapted speed shall be written to the user defined parameterP61.05 and to Auxiliary speed parameter P23.13
The gear ratio is 1 : 2 (can be selected by variable Ratio)
Example: Scaling of speed actual and writing to the user defined parameter (61.05) and P23.13
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 6
Start CoDeSys and create a new project
Select CFC as language (PLC_PRG)
Insert following boxes:DriveState: Used to read the actual speed (P1.04)
MulDiv: Used to scale the speed
ParSet: Used to write to a system parameter
Build a new program
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 7
Build the program
Define a new parameter 61.05 to set the gear ratio (Ratio)
Define a new parameter 61.06 to get the signal CalcSpeed
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 8
Create global variables
User defined parameter variables must beGlobal Variables
The following variables must be declared as global ones:CalcSpeed
Ratio
Select tab Resources and double click onGlobal Variables
Note:Global Variables can used in several programs!
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 9
1. Select tab Resources
1.
2.
2. Double click on Parameter Manager
Create user defined parameter groups
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 10
Create user defined parameter groups
Open window Insert listInsert List…
Select Variables as TypeAdd a name for the user defined parameter group and confirm with OK. This name will also be shown as parameter group name in the parameter list.
Attention:It is not possible to choose Parameters, Template, Instance or System parameters!
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 11
Create user defined parameters
Create a new line for the parameterInsert Line
A second line for the next parameter can be created by means of
Insert Line after
16#0 is Hex format. It can be changed withExtras Format Dec/Hex
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 12
Setting of user defined parameters
Insert the settings of the user defined parameter
Group Parameter groups 60 … 69 are reserved for user defined parameters
Index CoDeSys will later display values of group and index in HEX
Name Names will be displayed in the parameter lists
Var If the variable is declared as global, insert a dot before the name
Def Min Max Default, minimum and maximum value of the parameter
Unit => No (desired unit)
DispTyp => integer (displayed unit)
DecPt => 0 (decimal point)
Readonly => unselect (parameter has to be written)
NoSav => unselect (parameter has to be saved)
OFF => unselect (parameter can be written w/o Off-Status)
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 13
Test the program
Build your project (F11)
Configure the communication to the DCS800Port: COM xBaudrate: 38400 Parity: Odd StopBits: 1 Motorola byteorder: Yes Flux control: No
Set the task configuration
Login and test your program
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 14
User defined parameter Gear_Speed (61.05) can be seen in DriveWindow light
…in DriveWindow or on the DCS800 panel
Test the application program by changing the gear ratio and have a look at CalcSpeed and P23.13 (auxiliary speed)
Test the program
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 15
Summary
Generation of new parameters
Key points of this module
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 16
Additional information
Links to related information3S-software.com
DC-Drive-News (Intranet)
Additional referencesApplication Manual (3ADW 000 199)
Firmware Manual (3ADW 000 193)
Hardware Manual (3ADW 000 194)
Training Material
©C
opyr
ight
3/1
3/20
08 A
BB
. All
right
s re
serv
ed.
CO
DE
SYS
_04R
0101
. pag
e 17
Glossary
CoDeSysController Development System (software tool)
Memory CardFlash memory
DriveWindow LightSoftware Tool for commissioning and maintenance using AC/DC
TargetInterface between Drive and CoDeSys tool
Control BuilderWhole system with software and hardware
PLC_PRGMain program which is used in all applications
POUProgram Organization Unit
LibraryIt includes function blocks which are given or designed by other users