ADVERTISEMENT

S7_AppSample_v3__Tia_Portal_.zip

Siemens S7-1200 + Serwo Lenze - Komunikacja Profinet <-> Ethernet

Dodałem w załączniku dokładną instrukcję z przykładami co do komunikacji 9400 po Profinecie (TiaPortal). Switch nie przeszkadza w działaniu.


Download file - link to post
  • S7_AppSample_v3__Tia_Portal_.zip
    • STEP_7_20.zip
    • TIA_V30.zip
    • NOTE_TIA_V13.pdf





S7_AppSample_v3__Tia_Portal_.zip > Lenze.TCIProjectInfo.{1052700-13129}.xml

C:\Users\Admin\Documents\Engineer Projekte\S7-1212


S7_AppSample_v3__Tia_Portal_.zip > NOTE_TIA_V13.pdf

Note: TIA Portal Version V13
With the TIA Portal Version V13 our Lenze Parameter function blocks from the Library Lenze
DriveCommunication are not been running automatically. Siemens has change the System
function blocks SFB WRREC version from 1.0 to 1.1 at TIA V13. The Lenze Library Lenze
DriveCommunication was compiled with the V1.0 from this SFB WRREC.

Nr.
1

Action
Note
You became an error message at compiling: ‘xxxx password is missing xxxx’ , if
the library version SFB WRREC V1.1

2

You have to set the library version from the SFB WRREC back
to Version 1.0. Open any function block with the Editor.
Navigate at the right side menu under Instructions = &amp; gt;
Extended Instructions = &amp; gt; Distributed I/O = &amp; gt; DP &amp; PROFINET
= &amp; gt; WRREC – Write Dataset.

3

Change the Library version to 1.0

Seite 1 von 1




S7_AppSample_v3__Tia_Portal_.zip > 141099_1.txt

™ D00CD55E48284D2FAEA93CC5A14ED884ž 8AB61F8E55864A8F8AE2E32343AE3074 &amp; lt; $ B593D75DAFAD44568D553C5AFBC225D9¬ 06E67DEB38F0461A8CE75D483379BDC2³ 1381CCABA3304514B3DAFFEB902A8FA0¬ 90116F9E96044DCA819AB237E1AA5761³ B152ABC7A30E4B4CA51AA446D12301B1¬ 8CA405CD778B4669A2E6D7EA3F753288³ AB49421A2F0147CD906F43A7382DDEB9î CCD0977D824E465B8B82ABD74010D28DÅ
33658D4033224DB6A31A8ECFF6E4A761î 6E53147670B349F38F46D9C7D5F6BE9BÅ A45E6F9B0C964CD8A43AA5AC63B4BD06î 71D182991CCB46E98A1EF5357DB32F48Å A2F623D76C1247E2B5BBE558DAE6D7CB=$ 1E31A9576D7E47C8BA3FE94CC50A7B68 &amp; gt; $ 732FAD4E6E724A22BF61EBE5B5E81158?$ BB65438C85954C6799EECDD6E89DECBDÄ C26E1E56BD0B44018D9BC59159593F07í
016C139E686C4A4E90EE0FD29F4D0A53î BE409E7BE523443E80FC74C49EF8C1ABÄ 5E32D98014A647198ED7AEE23CD34438í 6FEA233DAB9A443DAB91D8FC269DDDD0î 358D10D08FE14A76896767021829CE94Ä 80414E16F2A644A7A56DF1470D9D99A9í EB5919FC66054B04B24036DE2CF9D744î 452F42A5A35D44899EEA2D0AAB7C0A52Ń 3CDFC804AFC9485095922B4C6FDDF0BE¬^ E7ECC9FA4A7E461A9F7DCCD64225AA59³` E239C8DC04E242B0919BA9B4F7CB3B14îˆ 926E39A8F5BE44A0868269C90FDEDA47Ä A9DCF97C20B8446981255B2B6CD2F72Aʼn 56287FAA0735409DAD32E54D0CDEA78CîŽ C736430307A4474AAAEAEC876DE8223AÊ 9FDDB84C660F4731999DA43CCEDAD7F1ŏ 1D43EFEADB2643A18849F23DC672E7C3î” AA6E449AC6D641328B0AB24FD39F9B0DÐ 1C8333053AB24CE1A63CB5288DD91797Å• 388BE743F32647AE98DA1BF4A0D88413îš 1AD6E436C96649E394022D63AFB5FD99Ö E1A8AA3BB97947AE9D2DF54375BA434DÅ› E346C4AEFF9C4D80A3243DBA7F79039F




S7_AppSample_v3__Tia_Portal_.zip > S7_Lenze_Application_Sample_V3-0_EN.pdf

Engineering tools

Engineer/
STEP 7/TIA Portal

13456363

Ä.Nòòä

Application Sample _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Software Manual

EN

L

Contents
________________________________________________________________

1

About this documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

1.1

Document history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

1.2

Conventions used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

1.3

Notes used. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

2

Safety instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

3

What does the Lenze S7/TIA Portal Application Sample contain? . . . . . . . . . . . . . . . . . . . . . . .

10

3.1

Overview: Sample projects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

3.2

Supported components: Principal system structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

3.3

Components of the Lenze »STEP 7«/»TIA Portal« Application Sample. . . . . . . . . . . . . . .

12

The sample projects in the Application Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

13

4.1

Open the sample project in the Siemens »SIMATIC« Manager. . . . . . . . . . . . . . . . . . . . . .

14

4.2

Open the sample projects in Siemens »TIA Portal«: Standard procedure . . . . . . . . . . . .

15

4.3

Open the sample projects in the Lenze »Engineer« . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

15

The Siemens sample programs in detail. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

18

5.1

Sample programs in »STEP 7« . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.1 Sample program: TA &quot; Actuator Speed &quot; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.2 Sample program: TA &quot; TablePositioning &quot; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.3 Sample program: 3_Parameter communication . . . . . . . . . . . . . . . . . . . . . . . . . . .

18
18
23
28

5.2

Sample programs in »TIA Portal« . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

28

5.3

Sample program in the »TIA Portal«: 1_Lenze_TA_Actuator_Speed . . . . . . . . . . . . . . . .

29

5.4

Sample program in the »TIA Portal«: 2_Lenze_TA_Table_Positioning . . . . . . . . . . . . . .

32

5.5

Sample program in »TIA Portal«: 3_Lenze_Parameter_communication. . . . . . . . . . . . .

36

Implementing the Lenze libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38

6.1

Overview - Lenze function libraries in »STEP 7«/»TIA Portal« . . . . . . . . . . . . . . . . . . . . . . .

38

6.2

The LenzeLogicControlBasic library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

39

6.3

The LenzeDataConversion library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

40

6.4

The LenzeDriveCommunication library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

40

6.5

Install the Lenze libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.5.1 In»STEP 7« . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.5.2 In»TIA Portal« . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

40
40
41

Lenze LogicControlBasic/DriveControlBasic - controlling and calculating . . . . . . . . . . . . . . . .

42

7.1

Overview of the functions and function blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

43

7.2

In »TIA Portal«: The &quot; LenzeDriveControlBasic library - &quot; TIA_S7_300_400 &quot; . . . . . . . . . . .

44

7.3

LCB_GenericDrive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

45

7.4

LCB_9400Drive. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

46

4

5

6

7

2

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Contents
________________________________________________________________

7.5

48
51
52

7.6

LCB_ActuatorSpeed_V3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.6.1 Input data of the Lenze devices (port assignment) - TA &quot; Actuator Speed &quot; V3.
7.6.2 Output data of the Lenze devices (port assignment) - TA &quot; Actuator Speed &quot; V3

53
56
57

7.7

LCB_TablePositioning_V2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
58
7.7.1 Input data of the Lenze devices (port assignment) - TA &quot; TablePositioning &quot; V2 62
7.7.2 Output data of the Lenze devices (port assignment) - TA &quot; TablePositioning &quot; V2 63

7.8

LCB_TablePositioning_V3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
64
7.8.1 Input data of the Lenze devices (port assignment) - TA &quot; TablePositioning &quot; V3 68
7.8.2 Output data of the Lenze devices (port assignment) - TA &quot; TablePositioning &quot; V3 70

7.9

LCB_8400Drive16Word. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

71

7.10 LCB_8400Drive4Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

73

7.11 LCB_8400Drive8Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

74

7.12 LCB_8400Drive12Word. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

76

7.13 LCB_SetAxisData - machine parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

78

7.14 SFC 14 DPRD_DAT DP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

79

7.15 SFC 15 DPWR_DAT DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

79

7.16 LCB_Norm_nToSpeed_s - signal converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

80

7.17 LCB_Speed_sToNorm_n - signal converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

81

7.18 LCB_Speed_sToSpeed_v - signal converter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

82

7.19 LCB_Speed_vToSpeed_s - signal converter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

82

7.20 LCB_Norm_aToNorm_n - signal converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

83

7.21 LCB_Norm_nToNorm_a - signal converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

84

7.22 LCB_Speed_nToNorm_r - signal converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

84

7.23 LCB_Speed_rToNorm_n - signal converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

85

7.24 LCB_PosToUnit - conversion block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

85

7.25 LCB_UnitToPos - conversion block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

86

7.26 LCB_UnitToSpeed - conversion block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

87

7.27 LCB_SpeedToUnit - conversion block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

88

The LenzeDriveCommunication library - accessing parameters . . . . . . . . . . . . . . . . . . . . . . . . .

89

8.1

Overview of the functions and function blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

89

8.2

DCO_ReadDriveParameter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

92

8.3

DCO_WriteDriveParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

94

8.4

8

LCB_ActuatorSpeed_V2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.5.1 Input data of the Lenze devices (port assignment) - TA &quot; Actuator Speed &quot; V2.
7.5.2 Output data of the Lenze devices (port assignment) - TA &quot; Actuator Speed &quot; V2

DCO_ReadDriveArray8b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

96

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

3

Contents
________________________________________________________________

8.5

97

8.6

DCO_ReadDriveArray32b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

100

8.7

DCO_ReadDriveParamString. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

102

8.8

DCO_WriteDriveArray8b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

103

8.9

DCO_WriteDriveArray16b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

105

8.10 DCO_WriteDriveArray32b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

106

8.11 DCO_R_W_n_DrivePar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

108

8.12 FC307 CONCAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

111

8.13 SFB4 TON IEC_TC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

111

8.14 SFB52 RDREC DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

111

8.15 SFB53 WRREC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

112

8.16 Error information (wErrorCode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9

DCO_ReadDriveArray16b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

112

The LenzeDataConversion library - convert data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
9.1

114

9.2

FC206 DAC_GetBitOfByte - conversion block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

115

9.3

FC207 DAC_GetBitOfWord - conversion block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

116

9.4

FC208 DAC_GetBitOfDWord - conversion block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

117

9.5

FC209 DAC_SetBitOfByte - bit operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

118

9.6

FC210 DAC_SetBitOfWord - bit operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

119

9.7

FC211 DAC_SetBitOfDWord - bit operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

120

9.8

FC212 DAC_ResetBitOfByte - bit operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

121

9.9

FC213 DAC_ResetBitOfWord - conversion block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

122

9.10 FC214 DAC_ResetBitOfDWord - conversion block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

123

9.11 FB200 DAC_ByteToBits - bit demultiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

124

9.12 FB201 DAC_WordToBits - bit demultiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

124

9.13 FB202 DAC_DWordToBits - bit demultiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

125

9.14 FC203 DAC_BitsToByte - bit multiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

125

9.15 FC204 DAC_BitsToWord - bit multiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

126

9.16 FC205 DAC_BitsToDWord - bit multiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

126

9.17 FB203 DAC_DWordTo2Words - type converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

127

9.18 FB204 DAC_DWordTo4Bytes - type converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

128

9.19 FB205 DAC_WordTo2Bytes - type converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

129

9.20 FC215 DAC_2BytesToWord - type converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

130

9.21 FC216 DAC_2WordsToDWord - type converter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

131

9.22 FC217 DAC_4BytesToDWord - type converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

Overview of the functions and function blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

132

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Contents
________________________________________________________________

Your opinion is important to us. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

135

5

About this documentation
Document history
________________________________________________________________

1

About this documentation
This documentation describes the commissioning steps of a Lenze automation system on the basis
of a simple example application. The automation system used consists of a PLC for the control
technology and drive components connected (via a bus system).



Please read the mounting instructions supplied with the controller before you start
working!
The mounting instructions contain safety instructions that must be observed!

 Tip!
Information and tools regarding the Lenze products can be found in the download area
under: http://www.Lenze.com

Target group
This documentation is intended for persons who want to configure and parameterise Lenze devices
with the »Engineer« engineering software by Lenze and SIMATEC »STEP 7« with Totally Integrated
Automation Portal (»TIA Portal«) by Siemens.
Screenshots/application examples
All screenshots in this documentation are application examples. Depending on the firmware
version of the Lenze devices and software version of the installed engineering tools »Engineer«/
SIMATEC »STEP 7«/»TIA Portal« , the illustration examples may deviate from the actual screen
display.
Information regarding the validity
This documentation describes the S7-Application Sample V3 and applies to the following software:
Software

From version

Lenze»Engineer«

V5.5 SP1

Siemens »TIA Portal«

1.1

2.15 SP1

Siemens »STEP 7«

V12 SP1

Document history
Version

Description

1.0

TD11 First edition

08/2012

TD11 Updated for the S7-Application Sample V2: New software version.

3.0

6

04/2011

2.0

04/2014

TD11 Updated version V3: Sample projects added in »TIA Portal«.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

About this documentation
Conventions used
________________________________________________________________

1.2

Conventions used
This documentation uses the following conventions to distinguish between different types of
information:
Type of information

Writing

Examples/notes

Spelling of numbers
Decimal separator

Point

The decimal point is always used.
For example: 1234.56

Text
Version information

Blue text colour

Program name

»«

Window

italics

Variable names

All information that applies to from a certain software
version of the drive onwards are marked accordingly in this
documentation.
Example: This function extension is available from software
version V3.0!
»Engineer«...
The Message window... / the Options dialog box...
By setting bEnable to TRUE...

Control element

bold

Sequence of menu
commands

The OK... button / The Copy... command / The Properties...
tab / The Name ... input field
If the execution of a function requires several commands in
a row, the individual commands are separated by an arrow:
Select FileOpen to...

Shortcut

&amp; lt; bold &amp; gt;

Use &amp; lt; F1 &amp; gt; to open the online help.
If a key combination is required for a command, a &quot; + &quot; is
placed between the key identifiers: With &amp; lt; Shift &amp; gt; + &amp; lt; ESC &amp; gt; ...

Hyperlink

Underlined

Optically highlighted reference to another topic. It is
activated with a mouse-click in this online documentation.

Icons
Page reference
Step-by-step instructions

( 7)

Optically highlighted reference to another page. In this
online documentation activated via mouse-click.



Step-by-step instructions are indicated by a pictograph.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

7

About this documentation
Notes used
________________________________________________________________

1.3

Notes used
The following signal words and symbols are used in this documentation to indicate dangers and
important information:
Safety instructions
Layout of the safety instructions:



Pictograph and signal word!
(characterise the type and severity of danger)
Note
(describes the danger and gives information about how to prevent dangerous
situations)

Pictograph

Signal word

Meaning



Danger!

Danger of personal injury through dangerous electrical voltage
Reference to an imminent danger that may result in death or serious
personal injury if the corresponding measures are not taken.



Danger!

Danger of personal injury through a general source of danger
Reference to an imminent danger that may result in death or serious
personal injury if the corresponding measures are not taken.



Stop!

Danger of property damage
Reference to a possible danger that may result in property damage if the
corresponding measures are not taken.

Application notes
Pictograph

Signal word

Meaning



Note!

Important note to ensure trouble-free operation



Tip!

Useful tip for easy handling



8

Reference to another document

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Safety instructions
________________________________________________________________

2

Safety instructions
Please observe the following safety instructions when you want to commission a controller or
system using the »Engineer«.



Read the documentation supplied with the controller or the individual components of
the system carefully before you start to commission the devices with the »Engineer«!
The device documentation contains safety instructions which must be observed!



Danger!
According to today's scientific knowledge it is not possible to ensure absolute freedom
from defects of a software.
If necessary, systems with built-in controllers must be provided with additional
monitoring and protective equipment complying with the relevant safety regulations
(e.g. law on technical equipment, regulations for the prevention of accidents) in each
case, so that an impermissible operating status does not endanger persons or facilities.
During commissioning persons must keep a safe distance from the motor or the
machine parts driven by the motor. Otherwise there would be a risk of injury by the
moving machine parts.



Stop!
If you change parameters in the »Engineer« while the controller is connected online, the
changes will be directly accepted by the controller!
A wrong parameter setting can cause unpredictable motor movements. By an
unintended direction of rotation, too high speed, or jerky operation, the driven machine
parts may be damaged!

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

9

What does the Lenze S7/TIA Portal Application Sample contain?
Overview: Sample projects
________________________________________________________________

3

What does the Lenze S7/TIA Portal Application Sample contain?

3.1

Overview: Sample projects
The Lenze S7 Application Sample contains sample projects for the following devices:
Siemens I/O controller/CPU

Siemens software

S7_app_20.zip

»STEP 7«

CPU 315 PN/DP

S7_300_400_AppSample_V30_TIA.zip

»TIA Portal«

CPU 12xx PN/DP

S7_1200_AppSample_V30_TIA.zip

»TIA Portal«

CPU 15xx PN/DP

3.2

Sample project/file name

CPU 315 PN/DP

S7_1500_AppSample_V30_TIA.zip

»TIA Portal«

Supported components: Principal system structure

ü

[3-1]

Sample configuration: Lenze »STEP 7« Application Sample with Siemens I/O controller and Lenze inverters

In order to use the Lenze Application Samples, you need a PC with the Lenze »Engineer« software
and the Siemens »STEP 7« software, »TIA Portal«.
Supported components are: A Siemens controller (SIMATIC S7 3xx/4xx/12xx/15xx) with PROFIBUS
DP/PROFINET IO connection and Lenze inverter &quot; control cabinet &quot; Servo Drives 9400/Inverter Drives
8400 and Lenze inverter &quot; decentralised &quot; Inverter Drives 8400 motec/protec.
Engineering PC and Siemens controller
Engineering PC

Siemens controller

Hardware

PC/notebook

Siemens CPU 315-2 PN/DP FW 2.6
(optionally, a Siemens CPU 4xx can
be inserted into the sample project)

Operating system

Windows XP/7

Lenze software (Engineering tool)

»Engineer« HighLevel from V2.15 SP1

Siemens software

SIMATIC »STEP 7« Manager V5.5 SP1

-

»TIA Portal« V5.5 SP1 from V12 SP1

10

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

What does the Lenze S7/TIA Portal Application Sample contain?
Supported components: Principal system structure
________________________________________________________________
Field devices
Lenze device/device series

Version
(firmware)

Communication modules

Version
(firmware)

Servo Drives 9400 HighLine

from 01.51.0.0

PROFINET HW: VB

from 01.40

PROFIBUS HW: VA FW
PROFINET

from 01.00

Inverter Drives 8400
StateLine C from 11.00.0.0
HighLine C
TopLine C 01.00.0.0
motec from 03.01.00.00 PROFIBUS E84DGFCPxNx

from 02.00.00.09

PROFINET PROFIBUS E84DGFCRxNx
protec 8400 StateLine from 06.00.00

PROFIBUS E84DxxxxxxxxxP

from 02.00

protec 8400 HighLine from 06.00.00



from 02.03.00.00

PROFINET E84DxxxxxxxxxR

from 02.00

More information can be found in the »Engineer« online help.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

11

What does the Lenze S7/TIA Portal Application Sample contain?
Components of the Lenze »STEP 7«/»TIA Portal« Application Sample
________________________________________________________________

3.3

Components of the Lenze »STEP 7«/»TIA Portal« Application Sample
The S7-Application Sample consists of ...
• ... sample projects for the Lenze software »Engineer« and
• ... sample projects for the Siemens software SIMATIC »STEP 7«/»TIA Portal«
The »STEP 7« sample project and the »TIA Portal« sample projects contain the following libraries.
The blocks and functions contained in the libraries are described in the respective chapter of this
documentation.
Library

Description

The LenzeDataConversion library - Contains blocks for converting data (example: WordToBits).
convert data ( 114)
Contains blocks for acyclic (DP-V1) parameter communication.
The LenzeDriveCommunication
library - accessing parameters ( 89)
Lenze LogicControlBasic/
DriveControlBasic - controlling and
calculating ( 42)



This library contains ...
... blocks for controlling a technology application (TA): TA &quot; speed actuating
drive &quot; ( &quot; Actuator Speed &quot; ) and TA &quot; table positioning &quot; ( &quot; Table Positioning &quot; ).
These related function blocks can be used for the following Lenze
controllers:
• 9400 Highline, 8400 Topline, Highline and protec
• 8400 Stateline and Motec (only TA &quot; Actuator Speed &quot; )
... blocks for converting signals and data types.

Note!
• These blocks of the supplied Lenze libraries are protected by Lenze and cannot be
edited.
• Some blocks are also available as &quot; generic &quot; blocks. The blocks can be edited.

• The process data blocks TA &quot; Actuator Speed &quot; and TA &quot; Table Positioning &quot; are implemented and
described in detail in the application sample.
• Both blocks require a certain assignment of the control/status word of the Lenze controller. For
this purpose, use the enclosed »Engineer« project that contains already preconfigured
constellations between the TAs and the respective Lenze devices (9400, 8400, 8400motec,
8400protec).

12

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The sample projects in the Application Sample
________________________________________________________________

4

The sample projects in the Application Sample
The predefined sample projects already contain the Lenze controllers supported by the Application
Sample.
Optionally both sample projects can be extended. This serves to use them as a basis for your
individual drive solution.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

13

The sample projects in the Application Sample
Open the sample project in the Siemens »SIMATIC« Manager
________________________________________________________________

4.1

Open the sample project in the Siemens »SIMATIC« Manager
This section describes the »STEP 7« TA &quot; Actuator Speed &quot; sample program. Further information on
the device-independent function libraries can be found in the following section:
Lenze LogicControlBasic/DriveControlBasic - controlling and calculating ( 42)
The LenzeDriveCommunication library - accessing parameters ( 89)
General procedure

 How to proceed:
1. Unpack the S7_App_sample_Vxx.zip sample project.
2. Open the »STEP 7« project in the »SIMATIC« Manager.

[4-1]

Illustration example: Lenze sample project in the »SIMATIC« manager version V2

1_TA_Actuator_Speed
In this »STEP 7« station, the FB LCB_Actuator_Speed_V2 for the TA &quot; Actuator Speed &quot; is
implemented. This FB can be controlled via the predefined LCB_ActuatorSpeedIntV2 variable table.
2_TA_Table_Positioning
In this »STEP 7« station, the FB LCB_TablePositioning_V2 for the TA &quot; Table Positioning &quot; is
implemented and can be controlled via the predefined IntV2 LCB_TablePos_IntV2 variable table.
3_Parameter Communication
In this »STEP 7« station, the FBs for a parameter communication are implemented.



Note!
The Lenze library contains various versions of the TA modules. Use the latest version to
make use of the extended functions.
From V2, for instance, a greater process data width and freely assignable variables are
available.

14

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The sample projects in the Application Sample
Open the sample projects in Siemens »TIA Portal«: Standard procedure
________________________________________________________________

4.2

Open the sample projects in Siemens »TIA Portal«: Standard procedure

 How to open the desired sample project in the »TIA Portal«:
1. Select the suitable sample project for the Controller/CPU.
2. Unpack the sample project: ProjectDearchive

[4-2]

Illustration example: Lenze Application Sample in »TIA Portal« V12

The program block folder contains the following sample projects: TA_ActuatorSpeed_V2,
TA_TablePositioning_V2 and Parameter_communication. Overview: Sample projects ( 10)

4.3

Open the sample projects in the Lenze »Engineer«

 Tip!
The »Engineer« sample projects are archived in ZIP format to allow you to send them for
instance by e-mail.
The »Engineer« supports project saving (FileSave archive) and project opening
(FileOpen archive) in ZIP format.



Further information on the general handling (example: &quot; go online &quot; ) of the »Engineer«
can be found in the online help for the »Engineer« which you can call with [F1].

 How to open the desired sample project in the »Engineer«:
1. Start »Engineer«.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

15

The sample projects in the Application Sample
Open the sample projects in the Lenze »Engineer«
________________________________________________________________
2. Open the desired sample project using the FileOpen archive command, depending on which
technology application you want to use:
• Application &quot; Speed actuating drive &quot; : LCB_ActuatorSpeed_Vxx.zip
• Application &quot; Table positioning &quot; : LCB_TablePositioning_Vxx.zip
3. Insert the desired motor into the configuration:
• Highlight controller, select the desired motor with the command Insert a component on the
Motors tab:

• By clicking Complete, insert the selection in the »Engineer« project.

16

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The sample projects in the Application Sample
Open the sample projects in the Lenze »Engineer«
________________________________________________________________

• The »Engineer« projects contain
preconfigured examples for the supported
Lenze axes: 9400, 8400, 8400motec/
protec.
• Each Lenze axis is implemented for the
PROFIBUS and PROFIBUS bus systems each.
• Information on the used firmware versions
can be found in the following section:
Supported components: Principal
system structure ( 10)
• If you want to use Lenze devices with a
different firmware, adapt the »Engineer«
project accordingly.

[4-3]

The »Engineer« project with the application
&quot; Speed actuating drive &quot; :
LCB_ActuatorSpeed_S7_V20

[4-4]

The »Engineer« sample project with the
application &quot; Table positioning &quot; :
LCB_TablePositioning_S7_V20

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

17

The Siemens sample programs in detail
Sample programs in »STEP 7«
________________________________________________________________

5

The Siemens sample programs in detail

5.1

Sample programs in »STEP 7«
The sample programs in »STEP 7« contain the following program structures each:
Sample program: TA &quot; Actuator Speed &quot; ( 18)
Sample program: TA &quot; TablePositioning &quot; ( 23)
Sample program in »TIA Portal«: 3_Lenze_Parameter_communication ( 36)

5.1.1

Sample program: TA &quot; Actuator Speed &quot;
In the »HW config« of the S7 station 1_TA_Actuator Speed, the supported Lenze axes are
implemented in the PROFIBUS and PROFINET IO bus system each.

[5-1]

Siemens »STEP 7«- »HW config«: TA Actuator Speed



Note!
The Lenze FB LCB_ActuatorSpeed_V2 requires a process data configuration with a least
consistent process data words in the »HW config«.

Process data addresses»HW config«
Lenze field device

PROFIBUS

PROFINET IO

Inputs/outputs

Inputs/outputs

protec

280 - 287

312 - 319

motec

272 - 279

304 - 311

StateLine/HighLine/TopLine

264 - 271

296 - 303

HighLine

256 - 263

288 - 295

8400

9400

The FC 1 function calls the FB LCB_ActuatorSpeed_V2.

18

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The Siemens sample programs in detail
Sample programs in »STEP 7«
________________________________________________________________
• The FB always requires an instance data block, in this example: Block DB 415.
• Optionally, all input and output signals can be controlled via the instance data block. For this
purpose, the xEnableInternalControl input bit has to be set to the value TRUE.
Assignment of the FBs LCB_ActuatorSpeed
• The instance data block DB 415 has the
symbolic name
DB_LCB_ActuatorSpeed_V2.
• Further information on the FB can be
found in the following section:
LCB_ActuatorSpeed_V2 ( 48)

[5-2]

Graph (inputs/outputs) of the FB LCB_ActuatorSpeed_V2

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

19

The Siemens sample programs in detail
Sample programs in »STEP 7«
________________________________________________________________

 Tip!
The FUP display in »STEP 7« can be set under the ExtraSettings menu item: Tab KOP/FUP.
The width of the blocks can be set in the address field width area:

Variable table LCB_ActuatorSpeedIntV2
The »STEP 7« sample project contains a predefined variable table for the instance data block DB 415.
• The variable table contains all inputs and
outputs of the FB LCB_ActuatorSpeed_V2.

[5-3]

Variable table LCB_ActuatorSpeedIntV2 (offline)

 How to proceed:
1. Go online with the variable table.

20

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The Siemens sample programs in detail
Sample programs in »STEP 7«
________________________________________________________________

2. Set the inputs described in the table to let the motor rotate.

Identifier/data type
iFirstPeripherieADR
xEnableInternalControl
iDriveType

xDriveEnable
xEnableSpeedSetpoint

rSpeedSetpoint

Value to be set
INT
BOOL
INT

BOOL
BOOL

REAL

I/O address of the node (assigned in »HW config«).
TRUE
Select Lenze controller
• 1: 8400 motec
• 2: 8400 (protec/StateLine/HighLine/TopLine)
• 11: 9400 HighLine
TRUE: Deactivate controller inhibit (inverted)
TRUE: Enable setpoint generator
• xJog1Set activates jog speed 1
• If no jog speed has been selected, rSpeedSetpoint is active
Select setpoint for the speed in [%].

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

21

The Siemens sample programs in detail
Sample programs in »STEP 7«
________________________________________________________________

 Tip!
In order to use the FB LCB_ActuatorSpeed_V2 several times, you can copy/paste the
variable table.
• In the pasted variable table, the previous number of the block has to be replaced by
the number of the other instance data block:

22

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The Siemens sample programs in detail
Sample programs in »STEP 7«
________________________________________________________________

5.1.2

Sample program: TA &quot; TablePositioning &quot;
In the »HW config« of the S7 station 2_TA_Table_Positioning, the supported Lenze axes are
implemented in the PROFIBUS and PROFINET IO bus system each.

[5-4]

Siemens »STEP 7«- »HW config«: TA Table Positioning



Note!
The Lenze library contains various versions of the TA modules. Use the latest version to
make use of the extended functions.
From V2 onwards, for instance, a greater process data width and freely assignable
variables are available.



Note!
The Lenze FB LCB_TablePositioning _V2 requires the following process data
configuration in the »HW config«:
• 9400 Highline: Seven consistent process data words
• 8400 protec/HighLine/TopLine: Six consistent process data words
The 9400 HighLine requires (compared to the 8400 device series) one process data word
more for selecting the profile number.
In case of the 8400 device series, the profile number can be set bit-coded via the control
word.

Process data addresses»HW config«
Lenze field device

PROFIBUS

PROFINET IO

Inputs/outputs

Inputs/outputs

protec

282 - 293

320 - 331

HighLine/TopLine

270 - 281

308 - 319

HighLine

256 - 269

294 - 307

8400

9400

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

23

The Siemens sample programs in detail
Sample programs in »STEP 7«
________________________________________________________________
The FC 1 function calls the FB LCB_TablePositioning_V2.
• The FB always requires an instance data block. In this example, it is the
DB 417 block.
• Optionally, all input and output signals can be controlled via the instance data block. For this
purpose, the xEnableInternalControl input bit has to be set to the value TRUE. Additionally, the
FB LCB_SetAxisData with the corresponding DB 443 instance data block is required.
Assignment of the FB LCB_SetAxisData
• With this FB the machine parameters of a
higher-level drive can be mapped.
• The FB conditions the machine
parameters, which you specify in the
physical units of the machine via
parameters, for the internal
representation.
• Further information on the FB can be
found in the following section:
LCB_SetAxisData - machine parameters
( 78)

[5-5]

24

Graph (inputs/outputs) of the FB LCB_SetAxisData

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The Siemens sample programs in detail
Sample programs in »STEP 7«
________________________________________________________________
Assignment of the FB LCB_TablePositioning
• At the AxisData input of the FB
LCD_TablePositioning_V2, enter the
instance data block of the FB
LCD_SetAxisData. In this chapter, it is the
DB 443.
• The instance data block DB 417 has the
symbolic name
DB_LCB_TablePositioning_V2.
• Further information on the FB can be
found in the following section:
LCB_TablePositioning_V2 ( 58)

[5-6]

Illustration example: Graph (inputs/outputs) of the FB LCB_TablePositioning_V2

 Tip!
The FUP view in »STEP 7« can be set under the ExtraSettings menu item: Tab KOP/FUP.
• The width of the FUP blocks can be set in the operand field width:

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

25

The Siemens sample programs in detail
Sample programs in »STEP 7«
________________________________________________________________
Variable table LCB_TablePos_IntVxx
The »STEP 7« sample project contains a predefined variable table for the instance data block DB 417.
• The variable table contains all inputs and
outputs of the FB
LCB_TablePositioning_V2.

[5-7]

Illustration example: Variable table LCB_TablePos_Internal (offline)

 How to proceed:
1. Go online with the variable table.

2. Set the inputs described in the table to let the motor rotate.

Identifier/data type
iFirstPeripherieADR
xEnableInternalControl

26

Value to be set
INT
BOOL

I/O address of the node (assigned in »HW config«).
TRUE: Deactivate all inputs of the block.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The Siemens sample programs in detail
Sample programs in »STEP 7«
________________________________________________________________

Identifier/data type
iDriveType

xDriveEnable
xManualPos
xManualNeg
xHomingSet
xProfileStart

Value to be set
INT

BOOL
BOOL
BOOL
BOOL

Select Lenze controller
• 2: 8400 (protec/HighLine/TopLine)
• 11: 9400 HighLine
TRUE: Deactivate controller inhibit (inverted)
TRUE: Manual jog in positive direction (CW rotation)
TRUE: Manual jog in negative direction (CCW rotation)
TRUE: Set home position

Start/stop positioning
BOOL TRUE
Start/restart positioning
• The profile with the profile number selected via
wProfileNumberSet is executed.
• Note: During an active positioning process, another profile can
already be defined via wProfileNumberSet which will be executed
after the restart (renewed state change &quot; 0 &quot; to &quot; 1 &quot; ).
• A previously cancelled positioning process is continued.
FALSE

xProfilePosStop
wProfileNumberSet

BOOL
WORD

FALSE

• Cancel the active positioning process.
Positive edge. Stop function of the running positioning process.
• When xProfileStart = TRUE: Restart of a profile.

Profile number of the profile to be executed of the profile data management
• 9400 (1...75)
• 8400 (3..15),

 Tip!
In order to use the FB LCB_TablePositioning_V2 several times, you can copy/paste the
variable table.
• In the pasted variable table, the previous number of the block has to be replaced by
the number of the other instance data block:

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

27

The Siemens sample programs in detail
Sample programs in »TIA Portal«
________________________________________________________________

5.1.3

Sample program: 3_Parameter communication
In the »HW config« of the S7 station 3_TA_Parameter Communication, the supported Lenze axes
are implemented in the PROFIBUS and PROFINET IO bus system each.

[5-8]

Siemens »STEP 7«- »HW config«: Parameter Communication

The diagnostic addresses of the Lenze axes from the »HW config« are important for the parameter
communication.
Diagnostic addresses »HW config«
Lenze field device

PROFIBUS

PROFINET IO

protec

2040

2027

motec

2041

2031

StateLine/HighLine/TopLine

2042

2035

HighLine

2043

2039

8400

9400

The following blocks are implemented exemplarily in the FC 1 for parameter communication:
DCO_ReadDriveParameter ( 92) / DCO_WriteDriveParameter ( 94) / DCO_ReadDriveArray8b ( 96)
DCO_ReadDriveArray16b ( 97) DCO_ReadDriveArray32b ( 100) / DCO_ReadDriveParamString ( 102)
DCO_WriteDriveArray8b ( 103) / DCO_WriteDriveArray16b ( 105) / DCO_WriteDriveArray32b ( 106)
DCO_R_W_n_DrivePar ( 108)

A variable table for controlling the FBs is available for each block.

5.2

Sample programs in »TIA Portal«
The sample programs in the »TIA Portal« contain the following program structures each:
Sample program in the »TIA Portal«: 1_Lenze_TA_Actuator_Speed ( 29)
Sample program in the »TIA Portal«: 2_Lenze_TA_Table_Positioning ( 32)
Sample program in »TIA Portal«: 3_Lenze_Parameter_communication ( 36)

28

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The Siemens sample programs in detail
Sample program in the »TIA Portal«: 1_Lenze_TA_Actuator_Speed
________________________________________________________________



Note!
The Siemens »TIA Portal« contains separate blocks for programming the different
Siemens control systems SIMATIC S7-300/S7-400, S7-1200 and S7-1500.
• A block designed for the PLC SIMATIC S7-300/S7-400, for instance, cannot be used
with a different Siemens Controller.
• The Lenze Application Samples contain different libraries for the »TIA Portal«, suitable
for the prevailing PLC type.

The table shows which Application Sample is suitable for which PLCs, Lenze controllers and bus
systems:
Lenze Application Sample

Implemented in the project Bus system

S7_300_400_AppSample_V30_TIA

SIMATIC S7-300
SIMATIC S7-400

SIMATIC 315 2 PN/DP

PROFIBUS

S7_1200_AppSample_V30_TIA

SIMATIC S7-1200

SIMATIC S7-1212

PROFINET

S7_1500_AppSample_V30_TIA

5.3

Suitable for Siemens-PLC

SIMATIC S7-1500

SIMATIC S7-1511

PROFINET

Sample program in the »TIA Portal«: 1_Lenze_TA_Actuator_Speed
Example: The »TIA Portal« Application Sample &quot; S7_1200_AppSample_V30_TIA &quot;
The general procedure applies to all »TIA Portal« Application Samples. The functional range is
identical for all three »TIA Portal« sample projects.
The SIMATIC S7-1212 PLC Siemens Controller is implemented with the PROFINET interface &quot; on
board &quot; and eight subordinate Lenze inverters in Devices &amp; networks:

• The four Lenze inverters in the upper PROFINET phase have been prepared for process data
communication with the &quot; speed actuating drive &quot; technology application.
• The controllers in the lower PROFINET phase are intended for the &quot; table positioning &quot; technology
application.
Lenze device

PROFINET inputs

PROFINET outputs

8400
motec

84 - 91

84 - 91

protec

92 - 99

92 - 99

StateLine/HighLine/TopLine

76 - 83

76 - 83

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

29

The Siemens sample programs in detail
Sample program in the »TIA Portal«: 1_Lenze_TA_Actuator_Speed
________________________________________________________________

Lenze device

PROFINET inputs

PROFINET outputs

9400
HighLine

68 - 75

68 - 75

 Tip!
Accessing process data
»TIA Portal« accesses the process data of the devices via automatically created PLC
variables, »STEP 7« directly accessed the process data via the I/O addresses.

The function FC 1 calls the FB LCB_ActuatorSpeed_V2.

LCB_ActuatorSpeed_V2

The FB LCB_ActuatorSpeed_V2 requires...
• ...a process data configuration of at least four consistent process data words
• ...always an instance data block, in this example: Block DB 415
Optionally, all input and output signals can be controlled via the instance data block. For this
purpose, the xEnableInternalControl input bit has to be set to the value TRUE.
• The instance data block DB 415 has
the symbolic name
DB_LCB_ActuatorSpeed_V2.
• More information on the FB:
LCB_ActuatorSpeed_V2 ( 48)

30

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The Siemens sample programs in detail
Sample program in the »TIA Portal«: 1_Lenze_TA_Actuator_Speed
________________________________________________________________

[5-9]

Variable table in the »TIA Portal«

• The sample project in the »TIA Portal« contains a predefined variable table for the instance data
block: Monitoring table

LCB_ActuatorSpeedIntV2

• The variable table contains all inputs and outputs of the FB LCB_ActuatorSpeed_V2.

 How to proceed:
Go online with the variable table by clicking

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

:

31

The Siemens sample programs in detail
Sample program in the »TIA Portal«: 2_Lenze_TA_Table_Positioning
________________________________________________________________
Set the inputs described in the following table to let the motor rotate.
Identifier/data type
iFirstPeripherieADR
xEnableInternalControl
iDriveType

xDriveEnable
xEnableSpeedSetpoint

rSpeedSetpoint

5.4

Value to be set
INT
BOOL
INT

BOOL
BOOL

REAL

I/O address of the node (assigned in »HW config«).
TRUE
Select Lenze controller
• 1: 8400 motec
• 2: 8400 (protec/StateLine/HighLine/TopLine)
• 11: 9400 HighLine
TRUE: Deactivate controller inhibit (inverted)
TRUE: Enable setpoint generator
• xJog1Set activates jog speed 1
• If no jog speed has been selected, rSpeedSetpoint is active
Select setpoint for the speed in [%].

Sample program in the »TIA Portal«: 2_Lenze_TA_Table_Positioning
The SIMATIC S7-1212 PLC Siemens Controller is implemented with the PROFINET interface &quot; on
board &quot; and eight subordinate Lenze inverters in Devices &amp; networks:

• The four Lenze inverters in the lower PROFINET phase have been prepared for process data
communication with the &quot; table positioning &quot; technology application.



Note!
The FB LCB_TablePositioning_V2 requires the following process data configuration in
the »HW config«:
• 8400 protec/HighLine/TopLine: Six consistent process data words of at least four
consistent process data words. The profile number can be set bit-coded via the control
word.
• 9400 HighLine: Seven consistent process data words. Compared to the 8400 Inverter
Drives, an additional process data word is required for selecting the profile number.

32

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The Siemens sample programs in detail
Sample program in the »TIA Portal«: 2_Lenze_TA_Table_Positioning
________________________________________________________________

Lenze device

PROFINET inputs

PROFINET outputs

8400
motec

126 - 137

126 - 137

protec

138 - 149

138 - 149

StateLine/HighLine/TopLine

114 - 125

114 - 125

HighLine

100 - 113

100 - 113

9400

 Tip!
Accessing process data
»TIA Portal« accesses the process data of the devices via automatically created PLC
variables, »STEP 7« directly accessed the process data via the I/O addresses.

The FB always requires an instance data block, in this example: Block DB 417.
Optionally, all input and output signals can be controlled via the instance data block. For this
purpose...
• ...the xEnableInternalControl input bit has to be set to the value TRUE and
• ...the FB LCB_SetAxisData with the corresponding DB 443 instance data block is required.
FB LCB_SetAxisData - assignment
• This FB maps the machine
parameters of a higher-level drive.
• The FB provides the parameters of
the machine which you specify in
the physical units of the machine via
parameters.
• Further information on the FB can
be found in the following section:
LCB_SetAxisData - machine
parameters ( 78)

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

33

The Siemens sample programs in detail
Sample program in the »TIA Portal«: 2_Lenze_TA_Table_Positioning
________________________________________________________________
FB LCB_TablePositioning - assignment
• Further information on the FB can
be found in the following section:
LCB_TablePositioning_V2 ( 58)

[5-10] FB LCB_TablePositioning_V2: Graphical presentation in »TIA Portal«

The »TIA portal « sample project contains a predefined variable table for the instance data block DB
417.
Variable table LCB_TablePos_IntVxx
The »TIA portal « sample project contains a predefined variable table for the instance data block DB
417 in the Monitoring and force tables.
• The variable table contains all inputs and
outputs of the FB
LCB_TablePositioning_V2.

34

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The Siemens sample programs in detail
Sample program in the »TIA Portal«: 2_Lenze_TA_Table_Positioning
________________________________________________________________

 How to proceed:
Go online with the variable table by clicking

:

Set the inputs described in the following table to let the motor rotate.
Identifier/data type

Value to be set

iFirstPeripherieADR

INT

xEnableInternalControl
iDriveType

xDriveEnable
xManualPos
xManualNeg
xHomingSet
xProfileStart

BOOL
INT

BOOL
BOOL
BOOL
BOOL

I/O address of the node (assigned in »HW config«).
TRUE: Deactivate all inputs of the block.
Select Lenze controller
• 2: 8400 (protec/HighLine/TopLine)
• 11: 9400 HighLine
TRUE: Deactivate controller inhibit (inverted)
TRUE: Manual jog in positive direction (CW rotation)
TRUE: Manual jog in negative direction (CCW rotation)
TRUE: Set home position

Start/stop positioning
BOOL TRUE
Start/restart positioning
• The profile with the profile number selected via
wProfileNumberSet is executed.
• Note: During an active positioning process, another profile can
already be defined via wProfileNumberSet which will be executed
after the restart (renewed state change &quot; 0 &quot; to &quot; 1 &quot; ).
• A previously cancelled positioning process is continued.
FALSE

xProfilePosStop
wProfileNumberSet

BOOL
WORD

FALSE

• Cancel the active positioning process.
Positive edge. Stop function of the running positioning process.
• When xProfileStart = TRUE: Restart of a profile.

Profile number of the profile to be executed of the profile data management
• 9400 (1...75)
• 8400 (3..15),

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

35

The Siemens sample programs in detail
Sample program in »TIA Portal«: 3_Lenze_Parameter_communication
________________________________________________________________

5.5

Sample program in »TIA Portal«: 3_Lenze_Parameter_communication
The SIMATIC S7-1212 PLC Siemens Controller with PROFINET interface &quot; on board &quot; is implemented
in Devices &amp; networks:

• The four Lenze inverters in the PROFINET phase have been prepared for process data
communication with the &quot; table positioning &quot; technology application.
• The diagnostic addresses of the Lenze axes from the »HW config« are important for the
parameter communication.
• A variable table for controlling the FBs is available for each block
Diagnostic addresses &quot; Devices &amp; networks &quot;
Lenze device

TA &quot; Actuator Speed &quot;

TA &quot; Actuator Positioning &quot;

motec

289

326

8400
protec

297

335

StateLine/HighLine/TopLine

281

317

HighLine

272

308

9400

The following blocks are implemented exemplarily in FC 4 for parameter communication:
DCO_ReadDriveParameter ( 92) / DCO_WriteDriveParameter ( 94) / DCO_ReadDriveArray8b ( 96)
DCO_ReadDriveArray16b ( 97) DCO_ReadDriveArray32b ( 100) / DCO_ReadDriveParamString ( 102)
DCO_WriteDriveArray8b ( 103) / DCO_WriteDriveArray16b ( 105) / DCO_WriteDriveArray32b ( 106)
DCO_R_W_n_DrivePar ( 108)



Note!
In order to be able to use the DCO_R_W_n_DrivePar block, you need the PLC data type
Drive Parameter from the »TIA Portal« library.

 How to proceed:
1. Copy the

36

Drive Parameter data type into the PLC data types directory:

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The Siemens sample programs in detail
Sample program in »TIA Portal«: 3_Lenze_Parameter_communication
________________________________________________________________
2. In the sample project, the
types directory.

Drive Parameter data type is already available in the PLC data

3. Each parameter block can be controlled via a separate variable table.

The variable table contains all inputs and outputs of the FB DCO_ReadDriveParameter.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

37

Implementing the Lenze libraries
Overview - Lenze function libraries in »STEP 7«/»TIA Portal«
________________________________________________________________

6

Implementing the Lenze libraries

6.1

Overview - Lenze function libraries in »STEP 7«/»TIA Portal«
The table shows function libraries which can be used for bus-independent implementation of Lenze
controllers.
Siemens software
Library/function block
Folder name

For the
Siemens
Controllers

»STEP 7«
Lenze LogicControlBasic/DriveControlBasic - controlling and
S7_300_400_V2 calculating
The LenzeDriveCommunication library - accessing parameters
The LenzeDataConversion library - convert data

SIMATIC S7-300
SIMATIC S7-400

»TIA Portal« V12
Lenze LogicControlBasic/DriveControlBasic - controlling and
TIA_300_400_V3 calculating
The LenzeDriveCommunication library - accessing parameters

SIMATIC S7-300
SIMATIC S7-400

»TIA Portal« V12
Lenze LogicControlBasic/DriveControlBasic - controlling and
TIA_1200_V3 calculating
The LenzeDriveCommunication library - accessing parameters

SIMATIC S7-1200

»TIA Portal« V12
Lenze LogicControlBasic/DriveControlBasic - controlling and
TIA_1500_V3 calculating
The LenzeDriveCommunication library - accessing parameters

SIMATIC S7-1500

Library/function block

Description

Lenze LogicControlBasic/
DriveControlBasic - controlling and
calculating

Functions for device-independent activation of Lenze controllers at the logic
bus:
• Axis data structure
• Interface blocks
• Scaling FB for converting machine units

The LenzeDriveCommunication
library - accessing parameters

General functions for communicating with a Lenze controller: SDO functions

The LenzeDataConversion library - Functions for converting data.
convert data

General information on the libraries:
• The initials &quot; FCxxx &quot; indicate functions.
• The initials &quot; FBxxx &quot; indicate function blocks.
• The initials &quot; SFxxx &quot; indicate system functions.

38

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Implementing the Lenze libraries
The LenzeLogicControlBasic library
________________________________________________________________

6.2

The LenzeLogicControlBasic library
In order to be able to activate the implemented Lenze controllers at the bus system in the PLC
application, the LenzeLogicControlBasic library provides interface blocks.
Siemens software/function blocks

Description/Further information

»STEP 7«

»TIA Portal«

FB410
LCB_GenericDrive

LCB_300_GenericDrive
LCB_12x__GenericDrive
LCB_15x_GenericDrive

Activation of a Lenze device with any application.
LCB_GenericDrive

FB412
LCB_9400Drive

LCB_300_9400Drive
LCB_12x_9400Drive
LCB_15x_9400Drive

Activation of a Lenze 9400 controller.
LCB_9400Drive

FB415
LCB_ActuatorSpeed_V2

LCB_300_ActuatorSpeed_V2
LCB_12x_ActuatorSpeed_V2
LCB_15x_ActuatorSpeed_V2

Activation of a Lenze device with the &quot; speed
actuating drive &quot; application sample.
LCB_ActuatorSpeed_V2
Open the sample projects in the Lenze »Engineer«
( 15)

FB416
LCB_ActuatorSpeed_V3

LCB_300_ActuatorSpeed_V3
LCB_12x_ActuatorSpeed_V3
LCB_15x_ActuatorSpeed_V3

Controlling a Lenze device with the &quot; speed actuating
drive &quot; application.
LCB_ActuatorSpeed_V3

FB417
LCB_TablePositioning_V2

LCB_300_TablePositioning_V2 Activation of a Lenze device with the &quot; table
LCB_12x_TablePositioning_V2 positioning &quot; application sample.
LCB_TablePositioning_V2
LCB_15x_TablePositioning_V2
Open the sample projects in the Lenze »Engineer«
( 15)

FB418
LCB_TablePositioning_V3

LCB_300_TablePositioning_V3 Activation of a Lenze device with the &quot; table
LCB_12x_TablePositioning_V3 positioning &quot; application.
LCB_TablePositioning_V3
LCB_15x_TablePositioning_V3

FB420
LCB_8400Drive16Word

LCB_300_8400Drive16Word
LCB_12x_8400Drive16Word
LCB_15x_8400Drive16Word

Activation of a Lenze 8400 controller with any
application each providing a different process data
width. Number of process data words: 16
LCB_8400Drive16Word

FB421
LCB_8400Drive12Word

LCB_300_8400Drive12Word
LCB_12x_8400Drive12Word
LCB_15x_8400Drive12Word

Number of process data words: 12.
LCB_8400Drive12Word

FB422
LCB_8400Drive8Word

LCB_300_8400Drive8Word
LCB_12x_8400Drive8Word
LCB_15x_8400Drive8Word

Number of process data words: 8.
LCB_8400Drive8Word

FB423
LCB_8400Drive4Word

LCB_300_8400Drive4Word
LCB_12x_8400Drive4Word
LCB_15x_8400Drive4Word

Number of process data words: 4 .
LCB_8400Drive4Word

FB443
LCB_SetAxisData

LCB_300_SetAxisData
LCB_12x_SetAxisData
LCB_15x_SetAxisData

Instance block of the FB LCB_SetAxisData.
LCB_SetAxisData - machine parameters

• The function blocks in »STEP 7« are designed for the SIMATIC S7 300/400 target systems.
• The »TIA Portal« provides CPU-specific FBs: LCB_300_ for the SIMATIC S7 300/400 target
systems, LCB_12x_: Target system: SIMATIC S7 12xx/LCB_15x_: Target system: SIMATIC S7
15xx.
• The interface blocks ...
• ... are device-independent and optimised for the corresponding application.
• ... are independent of the bus system used.
• ... can be used with any application (15 process data words).
• ... all use the ports available by default in the »Engineer«.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

39

Implementing the Lenze libraries
The LenzeDataConversion library
________________________________________________________________

6.3

The LenzeDataConversion library
The LenzeDataConversion library contains functions
LenzeDataConversion library - convert data ( 114)

6.4

for

converting

data.

The

The LenzeDriveCommunication library
The LenzeDriveCommunication library contains blocks for bus-independent parameter
communication. The LenzeDriveCommunication library - accessing parameters ( 89)

6.5

Install the Lenze libraries

6.5.1

In»STEP 7«

 How to proceed:
1. Copy the library projects LenzeDat (Lenze Data Conversion) and LenzeLog (Lenze Logic
Control Basic) into the »STEP 7« library inventory,
example: C:\Program Files\Siemens\Step7\S7LIBS
• Optionally, you can store the library
projects in any folder and then open them
once in the
»SIMATIC« Manager to record them.
• After a restart of the »SIMATIC« Manager,
the libraries are available in the editors.

[6-1]

40

Lenze libraries in the »SIMATIC« manager

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Implementing the Lenze libraries
Install the Lenze libraries
________________________________________________________________

6.5.2

In»TIA Portal«

 How to proceed:
1. Go to the »TIA Portal« and open the Libraries navigation interface:

• Optionally, you can store the library projects in any folder and then open them once in
the»SIMATIC« Manager to record them.
• After a restart of the »SIMATIC« Manager, the libraries are available in the editors.
2. Click

to open a global library.

3. Select the desired Lenze S7 Application Sample library:

Example: TIA library for the SIMATIC S7 1200 target system

The library selected before is visible in Global libraries.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

41

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
The libraries contain function blocks ...
• ... for controlling predefined technology applications &quot; speed actuating drive &quot; and &quot; table
positioning &quot; .
• ... for controlling Generic Drives (any Lenze controller with bus system/any drive interface).
• ... for calculating drive-specific process data.
The functions and function libraries of the LenzeLogicControlBasic library are divided into different
groups.
Directory/group
Logic Drives

FBs for controlling the defined technology applications &quot; actuating drive
speed &quot; and &quot; table positioning &quot; and open blocks for a generic process data
assignment.

Data converter

FBs with functions for converting drive-specific signals.

Signal conversion

42

... contains

FBs with functions for converting speed and position values.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.1

Overview of the functions and function blocks
The libraries &quot; Lenze LogicControlBasic &quot; and &quot; Lenze DriveControlBasic &quot; are available for
the Siemens software »STEP 7« and »TIA Portal«. The contents of both libraries is identical.
In »STEP 7«: The &quot; LenzeLogicControlBasic &quot; library - TIA_S7_300_400
Use the library for the following target systems: SIMATIC S7 300/S7 400.
LogicDrives
FB410

LCB_GenericDrive ( 45)

FB412

LCB_9400Drive ( 46)

FB415

LCB_ActuatorSpeed_V2 ( 48)

FB416

LCB_ActuatorSpeed_V3 ( 53)

FB417

LCB_TablePositioning_V2 ( 58)

FB418

LCB_TablePositioning_V3 ( 64)

FB420

LCB_8400Drive16Word ( 71)

FB421

LCB_8400Drive12Word ( 76)

FB422

LCB_8400Drive8Word ( 74)

FB423

LCB_8400Drive4Word ( 73)

FB443

LCB_SetAxisData - machine parameters ( 78)

SFC 14 DPRD_DAT DP ( 79)
SFC 15 DPWR_DAT DP ( 79)
Data converter
FB432

LCB_Norm_nToSpeed_s - signal converter ( 80)

FB435

LCB_Speed_sToNorm_n - signal converter ( 81)

FB436

LCB_Speed_sToSpeed_v - signal converter ( 82)

FB437

LCB_Speed_vToSpeed_s - signal converter ( 82)

FC430

LCB_Norm_aToNorm_n - signal converter ( 83)

FC431

LCB_Norm_nToNorm_a - signal converter ( 84)

FC433

LCB_Speed_nToNorm_r - signal converter ( 84)

FC434

LCB_Speed_rToNorm_n - signal converter ( 85)

Signal conversion
FB441

LCB_PosToUnit - conversion block ( 85)

FB442

LCB_SpeedToUnit - conversion block ( 88)

FB443

LCB_UnitToPos - conversion block ( 86)

FB445
[7-1]

LCB_SetAxisData - machine parameters ( 78)

FB444

LCB_UnitToSpeed - conversion block ( 87)

Example: The LenzeLogicControlBasic library in »STEP 7«

• The initials &quot; FBxxx &quot; indicate function blocks.
• The initials &quot; FCxxx &quot; indicate functions.
• The initials &quot; SFCxxx &quot; indicate system functions.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

43

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.2

In »TIA Portal«: The &quot; LenzeDriveControlBasic library - &quot; TIA_S7_300_400 &quot;
The library is available for the following target systems: SIMATIC S7 300/400, S7 12xx, S7 15xx
Applies to the following libraries/target systems:
• TIA_12SP1_AppSample_Lib_300_400, target system: SIMATIC S7 300/400
• TIA_12SP1_AppSample_Lib_1200, target system: SIMATIC S7 12xx
• TIA_12SP1_AppSample_Lib_1500, target system: SIMATIC S7 15xx
Function blocks
LCB_8400Drive4Word ( 73)
LCB_8400Drive8Word ( 74)
LCB_8400Drive12Word ( 76)
LCB_8400Drive16Word ( 71)
LCB_9400Drive ( 46)
LCB_ActuatorSpeed_V2 ( 48)
LCB_ActuatorSpeed_V3 ( 53)
LCB_GenericDrive ( 45)
LCB_Norm_aToNorm_n - signal converter ( 83)
LCB_Norm_nToNorm_a - signal converter ( 84)
LCB_Norm_nToSpeed_s - signal converter ( 80)
LCB_PosToUnit - conversion block ( 85)
LCB_SetAxisData - machine parameters ( 78)
LCB_Speed_nToNorm_r - signal converter ( 84)
LCB_Speed_rToNorm_n - signal converter ( 85)
LCB_Speed_sToNorm_n - signal converter ( 81)
LCB_Speed_sToSpeed_v - signal converter ( 82)
LCB_Speed_vToSpeed_s - signal converter ( 82)
LCB_SpeedToUnit - conversion block ( 88)
LCB_TablePositioning_V2 ( 58)
LCB_TablePositioning_V3 ( 64)
LCB_UnitToPos - conversion block ( 86)
LCB_UnitToSpeed - conversion block ( 87)

The contents of the libraries TIA_S7_300_400, TIA_S7_1200 and TIA_S7_1500 is identical. Use the
library which matches the desired target system.
The libraries contain the same function blocks as the LenzeDriveControlBasic, thus, the inputs/
outputs of the function blocks and the operating mode are identical.

44

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.3

LCB_GenericDrive
This description applies to the following FBs:
• »STEP 7«: FB410 LCB_GenericDrive
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_GenericDrive
Function library:

LenzeLogicControlBasic

This FB controls any Lenze controller.
LCB_GenericDrive
⎯ EN

ENO ⎯

INT ⎯ iFirstPeripherieADR
ARRAY [1..4] OF WORD ⎯ awTxData

awRxData ⎯ ARRAY[1..4] OF WORD
xInternalControlActive ⎯ BOOL

BOOL ⎯ xEnableInternalControl

xCommunicationOK ⎯ BOOL
xError ⎯ BOOL
iReadError ⎯ INT
iWriteError ⎯ INT

Inputs
Identifier/data type
iFirstPeripherieADR

Information/possible settings
INT

I/O address of the node (assigned in »HW config«).

awTxData
Process data to be transmitted to the controller
ARRAY[1..4] OF WORD
xEnableInternalControl

BOOL

TRUE: Deactivate all inputs of the block.
• This serves to directly control the block ...
• ... via the variables of the instance data block or
• ... via the variable table.

Outputs
Identifier/data type

Information/possible settings

awRxData
Process data to be received by the controller
ARRAY[1..4] OF WORD
xInternalControlActive

xCommunicationOk

TRUE: The output signalises that the xEnableInternalControl input has been
activated.
• This enables default values via the variable table.
• This serves to control the controller via the visualisation.
BOOL

Status of bus communication
FALSE No bus communication active
TRUE Bus communication available

xError
iReadError
iWriteError

BOOL
INT
INT

TRUE: Error of POU active
Error code from the SFC block 14.

SFC 14 DPRD_DAT DP ( 79)

Error code from the SFC block 15.

SFC 15 DPWR_DAT DP ( 79)

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

45

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.4

LCB_9400Drive
This description applies to the following FBs:
• »STEP 7«: FB412 LCB_9400Drive
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_9400Drive
Function library:

LenzeLogicControlBasic

This FB controls the controller of the 9400 device series with an optional application.



Note!
For a trouble-free function of the FB, the port configuration of the application on the
controller must be maintained! No ports must be deleted or shifted.

LCB_9400Drive
⎯ EN

ENO ⎯

INT ⎯ iFirstPeripherieADR

xError ⎯ BOOL

BOOL ⎯ xEnableInternalControl

iReadError ⎯ INT

WORD ⎯ wLPortAxisIn1_wControl

iWriteError ⎯ INT

INT ⎯ iLPortAxisIn1_nIn1

xInternalControlActive ⎯ BOOL

DINT ⎯ diLPortAxisIn1_dnIn2

xCommunicationOK ⎯ BOOL

WORD ⎯ wLPortControl1

wLPortAxisOut1_wStatus ⎯ WORD

WORD ⎯ wLPortControl2

iLPortAxisOut1_nOut1 ⎯ INT

DINT ⎯ diLPort32In1

diLPortAxisOut1_dnOut2 ⎯ DINT

DINT ⎯ diLPort32In2
DINT ⎯ diLPort32In3

wLPortStatus1 ⎯ WORD
wLPortStatus2 ⎯ WORD

INT ⎯ iLPort16In1

diLPort32Out[1...3] ⎯ DINT

INT ⎯ iLPort16In2

iLPort16Out[1...3] ⎯ INT

INT ⎯ iLPort16In3

Inputs
Identifier/data type

Information/possible settings

iFirstPeripherieADR

INT

xEnableInternalControl

BOOL

I/O address of the node (assigned in »HW config«).
TRUE: Deactivate all inputs of the block.
• This serves to directly control the block ...
• ... via the variables of the instance data block or
• ... via the variable table.

wLPortAxisIn1_wControl
LPortAxisIn1.wControl interface of the 9400 controller
WORD
iLPortAxisIn1_nIn1
diLPortAxisIn1_dnIn2
wLPortControl1

46

INT
DINT
WORD

LPortAxisIn1.nIn1 interface of the 9400 controller
LPortAxisIn1.dnIn2 interface of the 9400 controller
LPortControl1 interface of the 9400 controller

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

Identifier/data type
wLPortControl2

Information/possible settings
WORD

diLPort32[In1...In3]

iLPort16[In1...In3]

LPortControl2 interface of the 9400 controller

LPort32In1 interface of the 9400 controller
DINT LPort32In2 interface of the 9400 controller
LPort32In3 interface of the 9400 controller
LPort16In1 interface of the 9400 controller
INT LPort16In2 interface of the 9400 controller
LPort16In3 interface of the 9400 controller

Outputs
Identifier/data type
xError

Information/possible settings
BOOL

Status signal &quot; Fault &quot;
FALSE Conversion carried out without errors
TRUE Error during the conversion

iReadError
iWriteError
xEnableInternalControl

xCommunicationOK

INT
INT
BOOL

BOOL

Error code from the SFC block 14.

SFC 14 DPRD_DAT DP ( 79)

Error code from the SFC block 15.

SFC 15 DPWR_DAT DP ( 79)

TRUE: Deactivate all inputs of the block.
• This serves to directly control the block ...
• ... via the variables of the instance data block or
• ... via the variable table.
Status of bus communication
FALSE No bus communication active
TRUE Bus communication available

wLPortAxisOut1_wStatus
LPortAxisOut1 interface of the 9400 controller
WORD
iLPortAxisOut1_nOut1

INT

diLPortAxisOut1_dnOut2
DINT
wLPort[Status1/Status2]
LPortControl1 interface of the 9400 controller
WORD LPortControl2 interface of the 9400 controller
diLPort32[Out1...Out3]

iLPort16[Out1...Out3]

LPort32Out1 interface of the 9400 controller
DINT LPort32Out2 interface of the 9400 controller
LPort32Out3 interface of the 9400 controller
LPort16Out1 interface of the 9400 controller
INT LPort16Out2 interface of the 9400 controller
LPort16Out3 interface of the 9400 controller

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

47

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.5

LCB_ActuatorSpeed_V2
This description applies to the following FBs:
• »STEP 7«: FB415 LCB_ActuatorSpeed_V2
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_ActuatorSpeed_V2
Function library:

LenzeLogicControlBasic

This FB controls the controllers 9400 Highline, 8400 protec/motec/StateLine/HighLine/TopLine in
the speed control mode.
For a correct function of the FB, load the matching device application on the controller using the
»Engineer«. The matching application is included in the S7-Application Sample.
• Communication with the devices is possible via the bus systems PROFIBUS or PROFINET. Process
data width: Four words
• Free binary inputs/outputs: 4
• Free word input/output: 1



Note!
The FB needs a process data configuration of at least four consistent process data words.

Further information on the device applications can be found in the following section:
projects in the Application Sample ( 13)

The sample

LCB_ActuatorSpeed_V2
⎯ EN
INT ⎯ iFirstPeripherieADR
BOOL ⎯ xEnableInternalControl
INT ⎯ iDriveType

ENO ⎯
xInternalControlActive ⎯ BOOL
xError ⎯ BOOL
xCommunicationOK ⎯ BOOL

BOOL ⎯ xDriveEnable

xDriveError ⎯ BOOL

BOOL ⎯ xDriveSetQSP

xDriveWarning ⎯ BOOL

BOOL ⎯ xResetError
BOOL ⎯ xEnableSpeedSetpoint

xDriveReady ⎯ BOOL
xDriveEnabled ⎯ BOOL

BOOL ⎯ xJog1Set

xDriveQSPActive ⎯ BOOL

BOOL ⎯ xJog2Set

xSpeedEqZero ⎯ BOOL

BOOL ⎯ xInvertDirectionSet
REAL ⎯ rSpeedSetpoint
BOOL ⎯ xFreeCtrl_[1...4]
WORD ⎯ wFreeCtrl_1

xDirectionCCW ⎯ BOOL
rSpeedActual ⎯ REAL
iReadError ⎯ INT
iWriteError ⎯ INT
xFreeState_[1...4] ⎯ BOOL
wFreeState_1 ⎯ WORD

48

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________
Inputs
Identifier/data type

Information/possible settings

iFirstPeripherieADR

INT

xEnableInternalControl

iDriveType

INT

xDriveEnable

BOOL

xDriveSetQSP

BOOL

xResetError

BOOL

xEnableSpeedSetpoint

TRUE: Deactivate all inputs of the block.
• This serves to directly control the block ...
• ... via the variables of the instance data block or
• ... via the variable table.
Select Lenze controller
• 1: 8400 motec
• 2: 8400 (protec/StateLine/HighLine/TopLine)
• 11: 9400 HighLine
TRUE: Deactivate controller inhibit (inverted)
TRUE: Activate quick stop
TRUE: Reset error message (acknowledged)

xInvertDirectionSet

TRUE: Jog1 activated
• Speed setpoint 1 requested
• Active if xEnableSpeedSetpoint = &quot; TRUE &quot;
Activate TRUE: Jog1
• Speed setpoint 1 requested.
• Active if xEnableSpeedSetpoint = &quot; TRUE &quot;

BOOL

xJog2Set

BOOL

BOOL

xJog1Set

Activate TRUE: Jog2
• Speed setpoint 2 requested.
• Active if xEnableSpeedSetpoint = &quot; TRUE &quot;

TRUE: Invert the direction of rotation of the motor (clockwise rotation/counterBOOL clockwise rotation).

rSpeedSetpoint

REAL

xFreeCtrl_[1...4]
wFreeCtrl_1

BOOL

I/O address of the node (assigned in »HW config«).

Setpoint selection for speed in [%]. Is active if ...
• ... xEnableSpeedSetpoint = &quot; TRUE &quot; and
• ... xJog1Set = &quot; FALSE &quot; and
• ... xJog2Set = &quot; FALSE &quot;

Freely assignable bits. Information on bit assignment in the »Engineer« sample
BOOL project: Input data of the Lenze devices (port assignment) - TA &quot; Actuator Speed &quot; V2
( 51)
WORD

Outputs
Identifier/data type
xInternalControlActive

xError

Information/possible settings
TRUE: The output signals that the xEnableInternalControl input and the Internal
BOOL Control button of the visualisation have been activated.
• This serves to control the controller via the variable table.
BOOL

Status signal &quot; Fault &quot;
FALSE Conversion carried out without errors
TRUE Error during the conversion

xCommunicationOK

BOOL

Status of bus communication
FALSE No bus communication active
TRUE Bus communication available

xDriveError

BOOL

Status signal &quot; Error in controller &quot;

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

49

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

Identifier/data type
xDriveWarning
xDriveReady
xDriveEnabled
xDriveQSPActive
xSpeedEqZero
xDirectionCCW
xHW_[Input1...Input4]

rSpeedActual
iReadError
iWriteError
xFreeState_[1...4]
wFreeState_1

50

Information/possible settings
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL

REAL
INT
INT

TRUE: Controller is in &quot; Warning &quot; device state
Status signal &quot; controller is ready for operation &quot;
TRUE: Controller has been enabled
TRUE: &quot; Quick stop active &quot;
TRUE: Speed is zero.
Direction of rotation of the motor
• TRUE:CCW rotation is active
Digital input is active
• Input1: Digital input 1
• Input2: Digital input 2
• Input3: Digital input 3
• Input4: Digital input 4
Current speed in [%]
• Value range: -199.99...199.99%
Error code from the SFC block 14.

SFC 14 DPRD_DAT DP ( 79)

Error code from the SFC block 15.

SFC 15 DPWR_DAT DP ( 79)

Freely assignable bits. Information on bit assignment in the »Engineer« sample
BOOL project: Output data of the Lenze devices (port assignment) - TA &quot; Actuator Speed &quot;
V2 ( 52)
WORD

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.5.1

Input data of the Lenze devices (port assignment) - TA &quot; Actuator Speed &quot; V2

FB inputs

9400 HighLine

Identifier/data type

Process data

Port

xDriveEnable

WORD 1

LPortControl1

xDriveSetQSP

BOOL

8400
motec/protec
StateLine/HighLine/TopLine
Assignment
NOT Bit 0

Process data MCI

Assignment

WORD 1

Bit 0 and 3

LP_MciIn-W1

Bit 1

Bit 2

Bit 10

Bit 7

xEnableSpeedSetpoi
nt
BOOL

Bit 2

-

xJog1Set

Bit 3

Bit 12 and
xEnableSpeedSet
point

Bit 5

Bit 13 and
xEnableSpeedSet
point

xInvertDirectionSet
BOOL

Bit 5

Bit 15

xFreeCtrl_[1...4]
BOOL

Bit 6...9

WORD 2

LP_MciIn-W2

xResetError

xJog2Set

wFreeCtrl_1

BOOL
BOOL

BOOL

BOOL

WORD 2

LPort16In1

-

WORD 4

LP_MciIn-W4

rSpeedSetpoint
WORD 3
WORD WORD 4

LPort32In1

-

WORD 3

Bit 0...3

LP_MciIn-W3

WORD

Used input ports TA &quot; Actuator Speed &quot; V2 - 9400 HighLine
1. LPortControl1
2. LPort16In1
3. LPort32In1

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

51

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.5.2

Output data of the Lenze devices (port assignment) - TA &quot; Actuator Speed &quot; V2

FB inputs

9400 HighLine

Identifier/data type

Process data

Port

xDriveError

WORD 1

LPortStatus1

BOOL

xDriveWarning

8400
motec/protec
StateLine/HighLine/TopLine
Assignment
Bit 0

Process data MCI
WORD 1

LP_MciOut-W1

Assignment
Bit 13

Bit 12

Bit 12

Bit 15

Bit 15

NOT Bit 7

NOT Bit 7

xDriveQSPActive
BOOL

Bit 3

Bit 0

xSpeedEqZero

Bit 6

Bit 6

-

Bit 14

xDriveReady

BOOL
BOOL

xDriveEnabled

BOOL

BOOL

xDirectionCCW

BOOL

xFreeState_[1...2]
BOOL

Bit 4...5

xFreeState_[3...4]
BOOL

Bit 14...15

wFreeState_1
rSpeedActual

WORD 2

LPort16Out1

WORD 3
WORD WORD 4

LPort32Out1

WORD

-

WORD 2

LP_MciOut-W2

Bit 0...1
Bit 2...3

WORD 4

LP_MciOut-W4

WORD 3

LP_MciOut-W3

Used output ports TA &quot; Actuator Speed &quot; V2 - 9400 HighLine
1. LPortStatus1
2. LPort16Out1
3. LPort32Out1

52

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.6

LCB_ActuatorSpeed_V3
This description applies to the following FBs:
• »STEP 7«: FB416 LCB_ActuatorSpeed_V3
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_ActuatorSpeed_V3
This FB controls the controllers 9400 Highline, 8400 protec/motec/StateLine/HighLine/TopLine in
the speed control mode.
For a correct function of the FB, load the matching device application on the controller using the
»Engineer«. The matching application is included in the S7-Application Sample.
• Communication with the devices is possible via the bus systems PROFIBUS or PROFINET. Process
data width: Eight words
• Free binary inputs/outputs: 16
• Free words inputs/outputs: 4 (32-bit values for the 9400 device series are marked with _LW/
_HW).
The FB needs a process data width of 8 words.
LCB_ActuatorSpeed_V3
⎯ EN
INT ⎯ iFirstPeripherieADR

ENO ⎯
xInternalControlActive ⎯ BOOL

BOOL ⎯ xEnableInternalControl
INT ⎯ iDriveType

xError ⎯ BOOL
xCommunicationOK ⎯ BOOL

BOOL ⎯ xDriveEnable

xDriveError ⎯ BOOL

BOOL ⎯ xDriveSetQSP

xDriveWarning ⎯ BOOL

BOOL ⎯ xResetError
BOOL ⎯ xEnableSpeedSetpoint
BOOL ⎯ xJog1Set
BOOL ⎯ xJog2Set
BOOL ⎯ xInvertDirectionSet
REAL ⎯ rSpeedSetpoint

xDriveReady ⎯ BOOL
xDriveEnabled ⎯ BOOL
xDriveQSPActive ⎯ BOOL
xSpeedEqZero ⎯ BOOL
xDirectionCCW ⎯ BOOL
rSpeedActual ⎯ REAL

BOOL ⎯ xFreeCtrl_[1...16]

iReadError ⎯ INT

WORD ⎯ wFreeCtrl_[1...2]

iWriteError ⎯ INT

WORD ⎯ wFreeCtrl_3_LW

xFreeState_[1...16] ⎯ BOOL

WORD ⎯ wFreeCtrl_4_HW

wFreeState_[1...2] ⎯ WORD
wFreeState_3_LW ⎯ WORD
wFreeState_4_LW ⎯ WORD

Inputs
Identifier/data type
iFirstPeripherieADR
xEnableInternalControl

Information/possible settings
INT
BOOL

I/O address of the node (assigned in »HW config«).
TRUE: Deactivate all inputs of the block.
• This serves to directly control the block ...
• ... via the variables of the instance data block or
• ... via the variable table.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

53

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

Identifier/data type

Information/possible settings

iDriveType

INT

xDriveEnable

BOOL

xDriveSetQSP

BOOL

xResetError

BOOL

xEnableSpeedSetpoint

xInvertDirectionSet

TRUE: Reset error message (acknowledged)

BOOL

TRUE: Jog1 activated
• Speed setpoint 1 requested
• Active if xEnableSpeedSetpoint = &quot; TRUE &quot;
Activate TRUE: Jog1
• Speed setpoint 1 requested.
• Active if xEnableSpeedSetpoint = &quot; TRUE &quot;
Activate TRUE: Jog2
• Speed setpoint 2 requested.
• Active if xEnableSpeedSetpoint = &quot; TRUE &quot;

TRUE: Invert the direction of rotation of the motor (clockwise rotation/counterBOOL clockwise rotation).

rSpeedSetpoint

REAL

xFreeCtrl_[1...16]

wFreeCtrl_4_HW

TRUE: Activate quick stop

BOOL

xJog2Set

wFreeCtrl_3_LW

TRUE: Deactivate controller inhibit (inverted)

BOOL

xJog1Set

wFreeCtrl_[1...2]

Select Lenze controller
• 1: 8400 motec
• 2: 8400 (protec/StateLine/HighLine/TopLine)
• 11: 9400 HighLine

Setpoint selection for speed in [%]. Is active if ...
• ... xEnableSpeedSetpoint = &quot; TRUE &quot; and
• ... xJog1Set = &quot; FALSE &quot; and
• ... xJog2Set = &quot; FALSE &quot;

Freely assignable bit [1...4]. Information on bit assignment in the »Engineer« sample
BOOL project: Input data of the Lenze devices (port assignment) - TA &quot; Actuator Speed &quot;
V3 ( 56)
Freely assignable bits.
• LW: &quot; Low Word &quot;
• HW: &quot; High Word &quot;
Information on bit assignment: Output data of the Lenze devices (port
WORD
assignment) - TA &quot; Actuator Speed &quot; V3 ( 57)
WORD

WORD

Outputs
Identifier/data type
xInternalControlActive

xError

Information/possible settings
TRUE: The output signals that the xEnableInternalControl input and the Internal
BOOL Control button of the visualisation have been activated.
• This serves to control the controller via the variable table.
BOOL

Status signal &quot; Fault &quot;
FALSE Conversion carried out without errors
TRUE Error during the conversion

xCommunicationOK

BOOL

Status of bus communication
FALSE No bus communication active
TRUE Bus communication available

xDriveError
xDriveWarning

54

BOOL
BOOL

Status signal &quot; Error in controller &quot;
TRUE: Controller is in &quot; Warning &quot; device state

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

Identifier/data type
xDriveReady
xDriveEnabled
xDriveQSPActive
xSpeedEqZero
xDirectionCCW
xHW_[Input1...Input4]

rSpeedActual
iReadError
iWriteError
xFreeState_[1...16]
wFreeState_[1...2]
wFreeState_3_LW
wFreeState_4_HW

Information/possible settings
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL

REAL
INT
INT

Status signal &quot; controller is ready for operation &quot;
TRUE: Controller has been enabled
TRUE: &quot; Quick stop active &quot;
TRUE: Speed is zero.
Direction of rotation of the motor
• TRUE:CCW rotation is active
Digital input is active
• Input1: Digital input 1
• Input2: Digital input 2
• Input3: Digital input 3
• Input4: Digital input 4
Current speed in [%]
• Value range: -199.99...199.99%
Error code from the SFC block 14.

SFC 14 DPRD_DAT DP ( 79)

Error code from the SFC block 15.

SFC 15 DPWR_DAT DP ( 79)

Freely assignable bit. Information on bit assignment: Input data of the Lenze
BOOL devices (port assignment) - TA &quot; Actuator Speed &quot; V3 ( 56)
Freely assignable bits.
• LW: &quot; Low Word &quot;
• HW: &quot; High Word &quot;
Information on bit assignment: Output data of the Lenze devices (port
WORD
assignment) - TA &quot; Actuator Speed &quot; V3 ( 57)
WORD

WORD

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

55

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.6.1

Input data of the Lenze devices (port assignment) - TA &quot; Actuator Speed &quot; V3

FB inputs

9400 HighLine

Identifier/data type

Process data

Port

xDriveEnable

WORD 1

LPortControl1

xDriveSetQSP

BOOL

8400
motec/protec
StateLine/HighLine/TopLine
Assignment
NOT Bit 0

Process data MCI

Assignment

WORD 1

Bit 0 and 3

LP_MciIn-W1

Bit 1

Bit 2

Bit 10

Bit 7

xEnableSpeedSetpoi
nt
BOOL

Bit 2

-

xJog1Set

Bit 3

Bit 12 and
xEnableSpeedSet
point

Bit 5

Bit 13 and
xEnableSpeedSet
point

Bit 5

Bit 15

xResetError

xJog2Set

BOOL
BOOL

BOOL

BOOL

xInvertDirectionSet
BOOL
xFreeCtrl_[1...16]
WORD 5
BOOL

LPortControl2

wFreeCtrl_1

WORD 2

LP_MciIn-W2

Bit 0...15

WORD 2

LPort16In1

WORD 4

LP_MciIn-W4

LP_MciIn-W4

WORD 6

LPort16In2

WORD 5

LP_MciIn-W5

LP_MciIn-W5

wFreeCtrl_3_LW
WORD 7
WORD

LPort32In2

WORD 6

LP_MciIn-W6

LP_MciIn-W6

WORD 7

LP_MciIn-W7

LP_MciIn-W7

WORD 3

LP_MciIn-W3

LP_MciIn-W3

wFreeCtrl_2

WORD
WORD

wFreeCtrl_4_HW
WORD 8
WORD
rSpeedSetpoint
WORD 3
WORD WORD 4

LPort32In1

Bit 0...15

Used input ports TA &quot; Actuator Speed &quot; V3 - 9400 HighLine
1. LPortControl1
2. LPort16In1
3. LPort32In1
4. LPortControl2
5. LPort16In2
6. LPort32In32

56

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.6.2

Output data of the Lenze devices (port assignment) - TA &quot; Actuator Speed &quot; V3

FB inputs

9400 HighLine

Identifier/data type

Process data

Port

xDriveError

WORD 1

LPortStatus1

BOOL

xDriveWarning

8400
motec/protec
StateLine/HighLine/TopLine
Assignment
Bit 0

Process data MCI
WORD 1

LP_MciOut-W1

Assignment
Bit 13

Bit 12

Bit 12

Bit 15

Bit 15

NOT Bit 7

NOT Bit 7

xDriveQSPActive
BOOL

Bit 3

Bit 0

xSpeedEqZero

Bit 6

Bit 6

-

Bit 14

xDriveReady

BOOL
BOOL

xDriveEnabled

BOOL

BOOL

xDirectionCCW

BOOL

xFreeState_[1...16]
WORD 6
BOOL

LPortStatus2

Bit 0...15

WORD 2

LP_MciOut-W2

Bit 0...15

wFreeState_1

LPort16Out1

-

WORD 4

LP_MciOut-W4

-

wFreeState_2

WORD

WORD 2
WORD 5

WORD 5

wFreeState_3_LW
WORD 7
WORD

WORD 6

wFreeState_2_HW
WORD 8
WORD

WORD 7

rSpeedActual

WORD

WORD 3
WORD WORD 4

LPort32Out1

WORD 3

LP_MciOut-W3

Used output ports TA &quot; Actuator Speed &quot; V3 - 9400 HighLine
1. LPortStatus1
2. LPort16Out1
3. LPort32Out1
4. LPortStatus2
5. LPort16Out2
6. LPort32Out2

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

57

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.7

LCB_TablePositioning_V2
This description applies to the following FBs:
• »STEP 7«: FB417 LCB_TablePositioning_V2
• »TIAPortal«: LCB_300/LCB_12x/LCB_15x_TablePositioning_V2
Function library:

LenzeLogicControlBasic

This FB controls the controllers 9400 Highline and 8400 protec/HighLine/TopLine in the table
positioning mode.
For a correct function of the FB, load the matching device application on the controller using the
»Engineer«. The matching application is included in the S7-Application Sample.
• Free binary inputs/outputs: 8
• Free word input/output: 1
The required process data width depends on the device.
• Device series 8400: Six process data words
• Device series 9400: Seven process data words
Further information on the device applications can be found in the following section:
projects in the Application Sample ( 13)

The sample

LCB_TablePositioning_V2
⎯ EN
INT ⎯ iFirstPeripherieADR
DB ⎯ AxisData
BOOL ⎯ xEnableInternalControl
INT ⎯ iDriveType

ENO ⎯
xInternalControlActive ⎯ BOOL
xError ⎯ BOOL
xCommunicationOK ⎯ BOOL
xDriveError ⎯ BOOL

BOOL ⎯ xDriveEnable

xDriveWarning ⎯ BOOL

BOOL ⎯ xDriveSetQSP

xDriveReady ⎯ BOOL

BOOL ⎯ xResetError

xDriveEnabled ⎯ BOOL

BOOL ⎯ xManualPos

xDriveQSPActive ⎯ BOOL

BOOL ⎯ xManualNeg

xSpeedEqZero ⎯ BOOL

BOOL ⎯ xHomingSet

xHomingActive ⎯ BOOL

BOOL ⎯ xHomingStart

xHomingDone ⎯ BOOL

BOOL ⎯ xHomingReset

xHomePosAvailable ⎯ BOOL

BOOL ⎯ xProfileStart
BOOL ⎯ xProfileRestart
BOOL ⎯ xProfileReset
BOOL ⎯ xProfilePosStop
WORD ⎯ wProfileNumberSet
BOOL ⎯ xEnableSpeedOverride
REAL ⎯ rSpeedOverrideSet
BOOL ⎯ xEnablePositionTeach
REAL ⎯ rPositionSet
BOOL ⎯ xFreeCtrl[1...8]

58

xManualActive ⎯ BOOL
xProfileActive ⎯ BOOL
xProfileDone ⎯ BOOL
xProfileInTarget ⎯ BOOL
xHW_LimitSwitchPos ⎯ BOOL

xHW_LimitSwitchNeg ⎯ BOOL
rSpeedActual ⎯ REAL
rPosActual ⎯ REAL
iReadError ⎯ INT
iWriteError ⎯ INT

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

LCB_TablePositioning_V2
WORD ⎯ wFreeCtrl_1

xFreeState_[1...8] ⎯ BOOL
wFreeState_1 ⎯ WORD

Inputs
Identifier/data type

Information/possible settings

iFirstPeripherieADR

INT

AxisData

Instance block of the FB LCB_SetAxisData.
DB ( 78)

xEnableInternalControl

iDriveType

xDriveEnable
xDriveSetQSP
xResetError
xManualPos
xManualNeg
xHomingSet
xHomingStart
xHomingReset
xProfileStart

I/O address of the node (assigned in »HW config«).

BOOL

INT

BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL

TRUE: Deactivate all inputs of the block.
• This serves to directly control the block ...
• ... via the variables of the instance data block or
• ... via the variable table.
Select Lenze controller
• 2: 8400 (protec/HighLine/TopLine)
• 11: 9400 HighLine
TRUE: Deactivate controller inhibit (inverted)
TRUE: Activate quick stop
TRUE: Reset error message (acknowledged)
TRUE: Manual jog in positive direction (CW rotation)
TRUE: Manual jog in negative direction (CCW rotation)
TRUE: Set home position
Start homing
Reset home position

Start/stop positioning
BOOL TRUE
Start/restart positioning
• The profile with the profile number selected via
wProfileNumberSet is executed.
• Note: During an active positioning process, another profile can
already be defined via wProfileNumberSet which will be executed
after the restart (renewed state change &quot; 0 &quot; to &quot; 1 &quot; ).
• A previously cancelled positioning process is continued.
FALSE

xProfileRestart
xProfileReset
xProfilePosStop
wProfileNumberSet

LCB_SetAxisData - machine parameters

BOOL
BOOL
BOOL
WORD

• Cancel the active positioning process.

FALSE TRUE

Update of the profile data of a currently active profile considering
the distance already covered.

FALSE TRUE

A profile previously aborted cannot be continued.
• When xProfileStart = TRUE: Restart of a profile.

FALSE TRUE

Positive edge. Stop function of the running positioning process.
• When xProfileStart = TRUE: Restart of a profile.

Profile number of the profile to be executed of the profile data management
• 9400 (1...75)
• 8400 (3...15),

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

59

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

Identifier/data type

Information/possible settings

xEnableSpeedOverride

rSpeedOverrideSet

REAL

xEnablePositionTeach

wFreeCtrl_1

TRUE: Switch on speed &quot; override &quot; . &quot; Override &quot; means
changing profile parameters and their transfer during the
positioning process.
Value for speed override in [%]
• 0...199.99 %

TRUE: Activate &quot; Teach &quot; function to enable the transfer of the position default to the
BOOL variable table.

rPositionSet
xFreeCtrl_[1...8]

BOOL

REAL

Position selection in [Units]

Freely assignable bits.
• LW: &quot; Low Word &quot;
• HW: &quot; High Word &quot;
WORD Information on bit assignment: Input data of the Lenze devices (port assignment)
- TA &quot; TablePositioning &quot; V2 ( 62)
BOOL

Outputs
Identifier/data type
xInternalControlActive

xError

Information/possible settings
TRUE: The output signals that the xEnableInternalControl input and the Internal
BOOL Control button of the visualisation have been activated.
This serves to control the controller via the visualisation.
BOOL

Status signal &quot; Fault &quot;
FALSE Conversion carried out without errors
TRUE Error during the conversion

xCommunicationOk

BOOL

Status of bus communication
FALSE No bus communication active
TRUE Bus communication available

xDriveError
xDriveWarning
xDriveReady
xDriveEnabled
xDriveQSPActive
xSpeedEqZero
xHomingActive
xHomingDone
xHomePosAvailable
xManualActive
xProfileActive

60

BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL

Status signal &quot; Error in controller &quot;
TRUE: Controller is in &quot; Warning &quot; device state
Status signal &quot; controller is ready for operation &quot;
TRUE: Controller has been enabled
TRUE: &quot; Quick stop active &quot;
TRUE: Speed is zero.
Status signal &quot; Homing activated
Status signal &quot; Homing completed &quot;
Status signal &quot; Home position is known &quot;
Status signal &quot; Manual jog active &quot;
Status signal &quot; Positioning active &quot;

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

Identifier/data type
xProfileDone
xProfileInTarget
xHW_LimitSwitchPos
xHW_LimitSwitchNeg
rSpeedActual
rPositionActual
iReadError
iWriteError

Information/possible settings
BOOL
BOOL
BOOL
BOOL
REAL
REAL
INT
INT

xFreeState_[1...8]
wFreeState_1

WORD

Status signal &quot; Positioning completed &quot;
Status signal &quot; Target position reached &quot;
Positive hardware limit switch
Negative hardware limit switch
Current speed of the motor shaft in [%]
• Value range: -199.99...199.99%
Current position in [Units]
Error code from the SFC block 14.

SFC 14 DPRD_DAT DP ( 79)

Error code from the SFC block 15.

SFC 15 DPWR_DAT DP ( 79)

Freely assignable bits. Information on bit assignment in the »Engineer« sample
project: Output data of the Lenze devices (port assignment) - TA
&quot; TablePositioning &quot; V2 ( 63)

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

61

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.7.1

Input data of the Lenze devices (port assignment) - TA &quot; TablePositioning &quot; V2

FB inputs

9400 HighLine

Identifier/data type

Process data

Port

xDriveEnable

WORD 1

LPortControl1

BOOL

xDriveSetQSP

8400
motec/protec
StateLine/HighLine/TopLine
Assignment
NOT Bit 0

Process data MCI
WORD 1

Assignment

LP_MciIn-W1

Bit 3

Bit 1

Bit 15

Bit 10

Bit 11

Bit 14

Bit 12

Bit 15

Bit 13

Bit 12

Bit 10

Bit 3

Bit 8

Bit 4

Bit 14

Bit 5
Bit 6

Bit 2
Bit8

Bit 7

Bit 1

Bit 6
Bit 7

-

Bit 8

Bit 0
Bit 1
Bit 8

xEnableSpeedOverride
BOOL

Bit 9

Bit 9

xEnablePosTeach

Bit 2

Bit 2

-

Bit 4...7

BOOL

xResetError

BOOL

xManualPos

BOOL

xManualNeg

BOOL

xHomingSet

BOOL

xHomingStart

BOOL

xHomingReset

BOOL

xProfileStart

BOOL

xProfileRestart

BOOL

xProfileReset

BOOL

xProfilePosStop

BOOL

BOOL

wProfileNumberSet.Bit
[0...3]
BOOL
xFreeCtrl_[1...8]
rPositionSet

BOOL

WORD 6

LPortControl2

Bit 0...7

WORD 2

LP_MciIn-W2

-

WORD 3
WORD 4

LP_MciIn-dnIn34_p

WORD 3
WORD WORD 4

LPort32In1

rSpeedOverrideSet
WORD 2
WORD

LPort16In1

WORD 5

LP_MciIn-W5

rFreeCtrl_1

WORD 7

LPort16In3

WORD 6

LP_MciIn-W6

rProfilNumberSet
WORD 5
WORD

LPort16In2

Bit 0...7

WORD

-

-

Used input ports TA &quot; TablePositioning &quot; V2 - 9400 HighLine
1. LPortControl1
2. LPort16In1

62

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________
3. LPort32In1
4. LPort16In2
5. LPortControl2
6. LPort16In3

7.7.2

Output data of the Lenze devices (port assignment) - TA &quot; TablePositioning &quot; V2

FB inputs

9400 HighLine

Identifier/data type
xDriveError

BOOL

xDriveWarning

Process data
WORD 1

Port
LPortStatus1

8400
motec/protec
StateLine/HighLine/TopLine
Assignment
Bit 0

Process data
WORD 1

MCI

Assignment

LP_MciOut-W1

Bit 0

Bit 9

Bit 15

Bit 2

Bit 4

NOT Bit 1

NOT Bit 3

Bit 3

Bit 14

Bit 4

Bit 11

Bit 5

Bit 9

Bit 6

Bit 6

xHomePosAvailable
BOOL

Bit 7

Bit 10

xManualActive

Bit 8

-

Bit 10

Bit 9

Bit 11

Bit 7

Bit 12

Bit 8

xHW_LimitSwitchPos
BOOL

Bit 14

Bit 12

xHW_LimitSwitchNeg
BOOL

Bit 15

Bit 13

BOOL

xDriveReady

BOOL

xDriveEnabled

BOOL

xDriveQSPActive

BOOL

xSpeedEqZero

BOOL

xHomingActive

BOOL

xHomingDone

BOOL

BOOL

xProfileActive

BOOL

xProfileDone

BOOL

xProfileInTarget

BOOL

xFreeState_[1...8]
rPositionActual
rSpeedActual
wFreeState_1

WORD 6

LPortStatus2

Bit 0...7

WORD 2

LP_MciOut-W2

WORD 3
WORD WORD 4

LPort32Out1

-

WORD 3
WORD 4

LP_MciOut_dnOut34_p

WORD 2

LPort16Out1

WORD 5

LP_MciOut-W5

WORD 5

LPort16Out2

WORD 6

LP_MciOut-W6

BOOL

WORD
WORD

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Bit 0...7

-

63

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________
Used output port TA &quot; TablePositioning &quot; V2 - 9400 HighLine
1. LPortStatus1
2. LPort16Out1
3. LPort32Out1
4. LPort16Out2
5. LPortStatus2
6. LPort16Out3

7.8

LCB_TablePositioning_V3
This description applies to the following FBs:
• »STEP 7«: FB418 LCB_TablePositioning_V3,
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_TablePositioning_V3
This FB controls the controllers 9400 Highline and 8400 protec/HighLine/TopLine in the table
positioning mode with freely assignable variables. Communication is possible via the bus systems
PROFIBUS and PROFINET.
For a correct function of the FB, load the matching device application on the controller using the
»Engineer«. The matching application is included in the S7-Application Sample.
• Free binary inputs/outputs: 16
• Free word input/output: 5 (32-bit values for the 9400 device series are marked with _LW/_HW).
The required process data width depends on the device.
• Device series 8400: Ten process data words
• Device series 9400: Eleven process data words
Information on bit assignment in the »Engineer« sample project:
Input data of the Lenze devices (port assignment) - TA &quot; TablePositioning &quot; V3 ( 68)
Output data of the Lenze devices (port assignment) - TA &quot; TablePositioning &quot; V3 ( 70)
LCB_TablePositioning_V3
⎯ EN
INT ⎯ iFirstPeripherieADR
DB ⎯ AxisData
BOOL ⎯ xEnableInternalControl
INT ⎯ iDriveType

ENO ⎯
xInternalControlActive ⎯ BOOL
xError ⎯ BOOL
xCommunicationOK ⎯ BOOL
xDriveError ⎯ BOOL

BOOL ⎯ xDriveEnable

xDriveWarning ⎯ BOOL

BOOL ⎯ xDriveSetQSP

xDriveReady ⎯ BOOL

BOOL ⎯ xResetError

xDriveEnabled ⎯ BOOL

BOOL ⎯ xManualPos

xDriveQSPActive ⎯ BOOL

BOOL ⎯ xManualNeg

xSpeedEqZero ⎯ BOOL

BOOL ⎯ xHomingSet

xHomingActive ⎯ BOOL

BOOL ⎯ xHomingStart

xHomingDone ⎯ BOOL

BOOL ⎯ xHomingReset

xHomePosAvailable ⎯ BOOL

BOOL ⎯ xProfileStart

64

xManualActive ⎯ BOOL

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

LCB_TablePositioning_V3
BOOL ⎯ xProfileRestart

xProfileActive ⎯ BOOL

BOOL ⎯ xProfileReset
BOOL ⎯ xProfilePosStop
WORD ⎯ wProfileNumberSet
BOOL ⎯ xEnableSpeedOverride

xProfileDone ⎯ BOOL
xProfileInTarget ⎯ BOOL
xHW_LimitSwitchPos ⎯ BOOL

xHW_LimitSwitchNeg ⎯ BOOL

REAL ⎯ rSpeedOverrideSet

rSpeedActual ⎯ REAL

BOOL ⎯ xEnablePositionTeach

rPosActual ⎯ REAL

REAL ⎯ rPositionSet

iReadError ⎯ INT

BOOL ⎯ xFreeCtrl_[1...16]
WORD ⎯ wFreeCtrl_1

iWriteError ⎯ INT
xFreeState_[1...16] ⎯ BOOL

WORD ⎯ wFreeCtrl_2_LW

wFreeState_1 ⎯ WORD

WORD ⎯ wFreeCtrl_3_HW

wFreeState_2_LW ⎯ WORD

WORD ⎯ wFreeCtrl_4_LW

wFreeState_3_HW ⎯ WORD

WORD ⎯ wFreeCtrl_5_HW

wFreeState_4_LW ⎯ WORD
wFreeState_5_HW ⎯ WORD

Inputs
Identifier/data type
iFirstPeripherieADR
AxisData
xEnableInternalControl

iDriveType

xDriveEnable
xDriveSetQSP
xResetError
xManualPos
xManualNeg
xHomingSet
xHomingStart
xHomingReset

Information/possible settings
INT

I/O address of the node (assigned in »HW config«).

Instance block of the FB LCB_SetAxisData.
DB ( 78)
BOOL

INT

BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL

LCB_SetAxisData - machine parameters

TRUE: Deactivate all inputs of the block.
• This serves to directly control the block ...
• ... via the variables of the instance data block or
• ... via the variable table.
Select Lenze controller
• 2: 8400 (protec/HighLine/TopLine)
• 11: 9400 HighLine
TRUE: Deactivate controller inhibit (inverted)
TRUE: Activate quick stop
TRUE: Reset error message (acknowledged)
TRUE: Manual jog in positive direction (CW rotation)
TRUE: Manual jog in negative direction (CCW rotation)
TRUE: Set home position
Start homing
Reset home position

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

65

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

Identifier/data type

Information/possible settings

xProfileStart

Start/stop positioning
BOOL TRUE
Start/restart positioning
• The profile with the profile number selected via
wProfileNumberSet is executed.
• Note: During an active positioning process, another profile can
already be defined via wProfileNumberSet which will be executed
after the restart (renewed state change &quot; 0 &quot; to &quot; 1 &quot; ).
• A previously cancelled positioning process is continued.
FALSE

xProfileRestart

BOOL

xProfileReset

BOOL

xProfilePosStop
wProfileNumberSet

BOOL
WORD

xEnableSpeedOverride
rSpeedOverrideSet

wFreeCtrl_1
wFreeCtrl_2_LW
wFreeCtrl_3_HW
wFreeCtrl_4_LW
wFreeCtrl_5_HW

Update of the profile data of a currently active profile considering
the distance already covered.

FALSE TRUE

A profile previously aborted cannot be continued anymore.
• When xProfileStart = TRUE: Restart of a profile.

FALSE TRUE

Positive edge. Stop function of the running positioning process.
• When xProfileStart = TRUE: Restart of a profile.

Profile number of the profile to be executed of the profile data management
• 9400 (1...75)
• 8400 (3...15),

Value for speed override in [%]
• 0...199.99 %

TRUE: Activate &quot; Teach &quot; function to enable the transfer of the position default to the
BOOL variable table.

rPositionSet
xFreeCtrl_[1...16]

FALSE TRUE

TRUE: Switch on speed &quot; override &quot; . &quot; Override &quot; means changing profile parameters
BOOL and their transfer during the positioning process.
REAL

xEnablePositionTeach

• Cancel the active positioning process.

REAL

Position selection in [Units]

Freely assignable bits.
• LW: &quot; Low Word &quot;
• HW: &quot; High Word &quot;
WORD Information on bit assignment: Input data of the Lenze devices (port assignment)
- TA &quot; TablePositioning &quot; V3 ( 68)
WORD
BOOL

WORD
WORD
WORD

Outputs
Identifier/data type
xInternalControlActive

xError

Information/possible settings
TRUE: The output signals that the xEnableInternalControl input and the Internal
BOOL Control button of the visualisation have been activated.
This serves to control the controller via the visualisation.
BOOL

Status signal &quot; Fault &quot;
FALSE Conversion carried out without errors
TRUE Error during the conversion

xCommunicationOk

BOOL

Status of bus communication
FALSE No bus communication active
TRUE Bus communication available

xDriveError

66

BOOL

Status signal &quot; Error in controller &quot;

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

Identifier/data type
xDriveWarning
xDriveReady
xDriveEnabled
xDriveQSPActive
xSpeedEqZero
xHomingActive
xHomingDone
xHomePosAvailable
xManualActive
xProfileActive
xProfileDone
xProfileInTarget
xHW_LimitSwitchPos
xHW_LimitSwitchNeg
rSpeedActual
rPositionActual
iReadError
iWriteError

Information/possible settings
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
REAL
REAL
INT
INT

TRUE: Controller is in &quot; Warning &quot; device state
Status signal &quot; controller is ready for operation &quot;
TRUE: Controller has been enabled
TRUE: &quot; Quick stop active &quot;
TRUE: Speed is zero.
Status signal &quot; Homing activated
Status signal &quot; Homing completed &quot;
Status signal &quot; Home position is known &quot;
Status signal &quot; Manual jog active &quot;
Status signal &quot; Positioning active &quot;
Status signal &quot; Positioning completed &quot;
Status signal &quot; Target position reached &quot;
Positive hardware limit switch
Negative hardware limit switch
Current speed of the motor shaft in [%]
• Value range: -199.99...199.99%
Current position in [Units]
Error code from the SFC block 14.

SFC 14 DPRD_DAT DP ( 79)

Error code from the SFC block 15.

SFC 15 DPWR_DAT DP ( 79)

xFreeState_[1...16]

Freely assignable bit.
BOOL Freely usable status word.
• LW: &quot; Low Word &quot;
wFreeState_1
WORD • HW: &quot; High Word &quot;
Information on bit assignment: Output data of the Lenze devices (port
wFreeState_[2_LW...5_HW] assignment) - TA &quot; TablePositioning &quot; V3 ( 70)
WORD

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

67

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.8.1

Input data of the Lenze devices (port assignment) - TA &quot; TablePositioning &quot; V3

FB inputs

9400 HighLine

Identifier/data type

Process data

Port

xDriveEnable

WORD 1

LPortControl1

xDriveSetQSP

BOOL

8400
motec/protec
StateLine/HighLine/TopLine
Assignment
NOT Bit 0

Process data MCI
WORD 1

LP_MciIn-W1

Assignment
Bit 3

Bit 1

Bit 15

Bit 10

Bit 11

Bit 14

Bit 12

Bit 15

Bit 13

Bit 12

Bit 10

Bit 3

Bit 8

Bit 4

Bit 14

Bit 5
Bit 6

Bit 2
Bit8

Bit 7

Bit 1

Bit 6
Bit 7

-

Bit 8

Bit 0
Bit 1
Bit 8

xEnableSpeedOverride
BOOL

Bit 9

Bit 9

xEnablePosTeach

Bit 2

Bit 2

-

Bit 4

xResetError
xManualPos
xManualNeg
xHomingSet
xHomingStart
xHomingReset
xProfileStart
xProfileRestart
xProfileReset
xProfilePosStop

BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL

BOOL

wProfileNumberSet.Bit
0
BOOL
wProfileNumberSet.Bit
1
BOOL

Bit 5

wProfileNumberSet.Bit
2
BOOL

Bit 6

wProfileNumberSet.Bit
3
BOOL

Bit 7

xFreeCtrl_1
xFreeCtrl_[2...16]

68

BOOL
BOOL

WORD 6

LPortControl2

Bit 0
Bit 1...15

WORD 2

LP_MciIn-W2

Bit 0
Bit 1...15

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

FB inputs

9400 HighLine

Identifier/data type
rPositionSet

Process data

Port

WORD 3
WORD WORD 4

LPort32In1

rSpeedOverrideSet
WORD 2
WORD
rFreeCtrl_1

WORD

rFreeCtrl_2_LW

WORD

rFreeCtrl_2_HW
rFreeCtrl_2_LW

WORD
WORD

rFreeCtrl_4_HW

WORD

8400
motec/protec
StateLine/HighLine/TopLine
Assignment

Process data MCI

Assignment

WORD 3
WORD 4

LP_MciIn-dnIn34_p

LPort16In1

WORD 5

LP_MciIn-W5

WORD 7

LPort16In3

WORD 6

LP_MciIn-W6

WORD 8

LPort16In2

WORD 7

LP_MciIn-W7

WORD 8

LP_MciIn-W8

WORD 9

LP_MciIn-W9

WORD 10

LP_MciIn-W10

WORD 9
WORD 10

LPort16In3

WORD 11

wProfilNumberSet
WORD 5
WORD

-

LPort16In2

-

-

Used input port TA &quot; TablePositioning &quot; V3 - 9400 HighLine
1. LPortControl1
2. LPort16In1
3. LPort32In1
4. LPort16In2
5. LPortControl2
6. LPort16In3
7. LPort32In2
8. LPort32In3

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

69

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.8.2

Output data of the Lenze devices (port assignment) - TA &quot; TablePositioning &quot; V3

FB inputs

9400 HighLine

Identifier/data type
xDriveError
xDriveWarning

BOOL

Process data
WORD 1

Port
LPortStatus1

8400
motec/protec
StateLine/HighLine/TopLine
Assignment
Bit 0

Process data
WORD 1

MCI

Assignment

LP_MciOut-W1

Bit 0

Bit 9

Bit 15

Bit 2

Bit 4

NOT Bit 1

NOT Bit 3

Bit 3

Bit 14

Bit 4

Bit 11

Bit 5

Bit 9

Bit 6

Bit 6

xHomePosAvailable
BOOL

Bit 7

Bit 10

xManualActive

Bit 8

-

Bit 10

Bit 9

Bit 11

Bit 7

Bit 12

Bit 8

xHW_LimitSwitchPos
BOOL

Bit 14

Bit 12

xHW_LimitSwitchNeg
BOOL

Bit 15

Bit 13

xDriveReady
xDriveEnabled
xDriveQSPActive
xSpeedEqZero
xHomingActive
xHomingDone

xProfileActive
xProfileDone
xProfileInTarget

BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL

BOOL
BOOL
BOOL
BOOL

xFreeState_[1...16]
WORD 6
BOOL

LPortStatus2

rPositionActual

WORD 3
WORD WORD 4

WORD 2

LP_MciOut-W2

LPort32Out1

WORD 3
WORD 4

LP_MciOut_dnOut34_p

WORD 2

LPort16Out1

WORD 5

LP_MciOut-W5

WORD 5

LPort16Out2

WORD 6

LP_MciOut-W6

wFreeState_2_LW
WORD 7
WORD

LPort32Out2

WORD 7

LP_MciOut-W7

WORD 8

LP_MciOut-W8

WORD 9

LP_MciOut-W9

WORD 10

LP_MciOut-W10

rSpeedActual
wFreeState_1

WORD
WORD

wFreeState_3_HW
WORD 8
WORD
wFreeState_4_LW
WORD 9
WORD
wFreeState_5_HW
WORD 10
WORD

70

LPort32Out3

Bit 0...15

Bit 0...15

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________
Used output port TA &quot; TablePositioning &quot; V3 - 9400 HighLine
1. LPortStatus1
2. LPort16Out1
3. LPort32Out1
4. LPort16Out2
5. LPortStatus2
6. LPort16Out3
7. LPort32Out2
8. LPort32Out3

7.9

LCB_8400Drive16Word
This description applies to the following FBs:
• »STEP 7«: FB420 LCB_8400Drive16Word
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_8400Drive16Word
Function library:

LenzeLogicControlBasic

This FB serves to control a controller of the 8400 device series with maximally 16 process data
words.



Note!
The FB only functions if the process width 16 constant words has been selected in the
»HW config« of »STEP 7« and in the »TIA Portal«!

LCB_8400Drive16Word
⎯ EN

ENO ⎯

INT ⎯ iFirstPeripherieADR

xError ⎯ BOOL

BOOL ⎯ xEnableInternalControl

iReadError ⎯ INT

WORD ⎯ wCtrl
INT ⎯ iIn[2...16]

iWriteError ⎯ INT
xInternalControlActive ⎯ BOOL
xCommunicationOK ⎯ BOOL
wState ⎯ WORD
iOut[2...16] ⎯ INT

Inputs
Identifier/data type
iFirstPeripherieADR
xEnableInternalControl

Information/possible settings
INT
BOOL

I/O address of the node (assigned in »HW config«).
TRUE: Deactivate all inputs of the block.
• This serves to directly control the block ...
• ... via the variables of the instance data block or
• ... via the variable table.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

71

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

Identifier/data type
wCtrl

Information/possible settings
WORD

iIn[2...16]

INT

MCI control word (8400 device series)
Process input data word [2...16]

Outputs
Identifier/data type

Information/possible settings

xError

BOOL

iReadError

INT

iWriteError

INT

xInternalControlActive

xCommunicationOK

Status signal &quot; Fault &quot;
Error code from the SFC block 14.

SFC 14 DPRD_DAT DP ( 79)

Error code from the SFC block 15.

SFC 15 DPWR_DAT DP ( 79)

TRUE: The output signals that the xEnableInternalControl input and the Internal
BOOL Control button of the visualisation have been activated.
• This serves to control the controller via the visualisation.
BOOL

Status of bus communication
FALSE No bus communication active
TRUE Bus communication available

wState
iOut[2...16]

72

WORD
INT

MCI control word (8400 device series)
Process output data word [2...16]

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.10

LCB_8400Drive4Word
This description applies to the following FBs:
• »STEP 7«: FB423 LCB_8400Drive4Word
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_8400Drive4Word
Function library:

LenzeLogicControlBasic

This FB serves to control a controller of the 8400 device series with maximally four process data
words.



Note!
The FB only functions if the process width four constant words has been selected in the
»HW config« of »STEP 7« and in the »TIA Portal«!

LCB_8400Drive4Word
BOOL ⎯ EN

ENO ⎯ BOOL

INT ⎯ iFirstPeripherieADR

xError ⎯ BOOL

BOOL ⎯ xEnableInternalControl

iReadError ⎯ INT

WORD ⎯ wCtrl

iWriteError ⎯ INT

INT ⎯ iIn[2...4]

xInternalControlActive ⎯ BOOL
xCommunicationOK ⎯ BOOL
wState ⎯ WORD
iOut[2...4] ⎯ INT

Inputs
Identifier/data type

Information/possible settings

iFirstPeripherieADR

INT

xEnableInternalControl

wCtrl
iIn[2...4]

BOOL

WORD
INT

I/O address of the node (assigned in »HW config«).
TRUE: Deactivate all inputs of the block.
• This serves to directly control the block ...
• ... via the variables of the instance data block or
• ... via the variable table.
MCI control word (8400 device series)
Process input data word [2...4]

Outputs
Identifier/data type
xError

Information/possible settings
BOOL

Status signal &quot; Fault &quot;
FALSE Conversion carried out without errors
TRUE Error during the conversion

iReadError

INT

Error code from the SFC block 14.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

SFC 14 DPRD_DAT DP ( 79)

73

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

Identifier/data type

Information/possible settings

iWriteError

INT

xInternalControlActive

xCommunicationOK

Error code from the SFC block 15.

SFC 15 DPWR_DAT DP ( 79)

TRUE: The output signals that the xEnableInternalControl input and the Internal
BOOL Control button of the visualisation have been activated.
• This serves to control the controller via the visualisation.
BOOL

Status of bus communication
FALSE No bus communication active
TRUE Bus communication available

wState

WORD

iOut[2...4]

7.11

INT

MCI control word (8400 device series)
Process output data word [2...4]

LCB_8400Drive8Word
This description applies to the following FBs:
• »STEP 7«: FB422 LCB_8400Drive8Word
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_8400Drive8Word
Function library:

LenzeLogicControlBasic

This FB serves to control a controller of the 8400 device series with maximally eight process data
words.



Note!
The FB only functions if the process width eight constant words has been selected in the
»HW config« of »STEP 7« and in the »TIA Portal«!

LCB_8400Drive8Word
BOOL ⎯ EN
INT ⎯ iFirstPeripherieADR
BOOL ⎯ xEnableInternalControl
WORD ⎯ wCtrl
INT ⎯ iiIn[2...8]

ENO ⎯ BOOL
xError ⎯ BOOL
iReadError ⎯ INT
iWriteError ⎯ INT
xInternalControlActive ⎯ BOOL
xCommunicationOK ⎯ BOOL
wState ⎯ WORD
iOut[2...8] ⎯ INT

74

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________
Inputs
Identifier/data type

Information/possible settings

iFirstPeripherieADR

INT

xEnableInternalControl

wCtrl

BOOL

WORD

iIn[2...8]

INT

I/O address of the node (assigned in »HW config«).
TRUE: Deactivate all inputs of the block.
• This serves to directly control the block ...
• ... via the variables of the instance data block or
• ... via the variable table.
MCI control word (8400 device series)
Process input data word [2...8]

Outputs
Identifier/data type

Information/possible settings

xError

BOOL

iReadError

INT

iWriteError

INT

xInternalControlActive

xCommunicationOK

Status signal &quot; Fault &quot;
Error code from the SFC block 14.

SFC 14 DPRD_DAT DP ( 79)

Error code from the SFC block 15.

SFC 15 DPWR_DAT DP ( 79)

TRUE: The output signals that the xEnableInternalControl input and the Internal
BOOL Control button of the visualisation have been activated.
• This serves to control the controller via the visualisation.
BOOL

Status of bus communication
FALSE No bus communication active
TRUE Bus communication available

wState
iOut[2...8]

WORD
INT

MCI control word (8400 device series)
Process output data word [2...8]

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

75

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.12

LCB_8400Drive12Word
This description applies to the following FBs:
• »STEP 7«: FB421 LCB_8400Drive12Word
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_8400Drive12Word
Function library:

LenzeLogicControlBasic

This FB serves to control a controller of the 8400 device series with maximally twelve process data
words.



Note!
The FB only functions if the process width 12 constant words has been selected in the
»HW config« of »STEP 7« and in the »TIA Portal«!

LCB_8400Drive12Word
BOOL ⎯ EN

ENO ⎯ BOOL

INT ⎯ iFirstPeripherieADR

xError ⎯ BOOL

BOOL ⎯ xEnableInternalControl

iReadError ⎯ INT

WORD ⎯ wCtrl
INT ⎯ iIn[2...12]

iWriteError ⎯ INT
xInternalControlActive ⎯ BOOL
xCommunicationOK ⎯ BOOL
wState ⎯ WORD
iOut[2...12] ⎯ INT

Inputs
Identifier/data type

Information/possible settings

iFirstPeripherieADR

INT

xEnableInternalControl

wCtrl
iIn[2...12]

BOOL

WORD
INT

I/O address of the node (assigned in »HW config«).
TRUE: Deactivate all inputs of the block.
• This serves to directly control the block ...
• ... via the variables of the instance data block or
• ... via the variable table.
MCI control word (8400 device series)
Process input data word [2...12]

Outputs
Identifier/data type
xError
iReadError
iWriteError

76

Information/possible settings
BOOL
INT
INT

Status signal &quot; Fault &quot;
Error code from the SFC block 14.

SFC 14 DPRD_DAT DP ( 79)

Error code from the SFC block 15.

SFC 15 DPWR_DAT DP ( 79)

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

Identifier/data type

Information/possible settings

xInternalControlActive

xCommunicationOK

TRUE: The output signals that the xEnableInternalControl input and the Internal
BOOL Control button of the visualisation have been activated.
• This serves to control the controller via the visualisation.
BOOL

Status of bus communication
FALSE No bus communication active
TRUE Bus communication available

wState
iOut[2...12]

WORD
INT

MCI control word (8400 device series)
Process output data word [2...12]

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

77

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.13

LCB_SetAxisData - machine parameters
This description applies to the following FBs:
• »STEP 7«: FB443 LCB_SetAxisData
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_SetAxisData
Function library:

LenzeLogicControlBasic

With this FB the machine parameters of a higher-level drive can be mapped. The FB conditions the
machine parameters, which you specify in the physical units of the machine via parameters, for the
internal representation.
• At the AxisData input of LCB_TablePositioning_V2 FB the instance data block of the
LCB_SetAxisData - machine parameters has to be entered.
LCB_SetAxisData
⎯ EN

ENO ⎯

REAL ⎯ rFeedConstant
REAL ⎯ rCycleLength
DINT ⎯ diGearNumerator
DINT ⎯ diGearDenominator
REAL ⎯ rReferenceSpeed
REAL ⎯ rReferenceTorque
STRING(16) ⎯ sAxisName
DINT ⎯ diResolution
BOOL ⎯ xModeUnlimited
BOOL ⎯ xModeLimited
BOOL ⎯ xModeModulo

Inputs
Identifier/data type
rFeedConstant

REAL

diGearDenominator

rReferenceTorque
sAxisName
diResolution
xModeUnlimited

78

Cycle
• Initialisation: 360.0 units

DINT

diGearNumerator

Feed constant
• Initialisation: 360.0 units

REAL

rCycleLength

rReferenceSpeed

Information/possible settings

Gearbox factor numerator
• Initialisation: 1

DINT

Gearbox factor denominator
• Initialisation: 1

REAL
REAL
STRING(16)
DINT
BOOL

Reference speed
Reference torque
Axis name
Resolution of one revolution
Traversing range unlimited

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

Identifier/data type
xModeLimited
xModeModulo

7.14

Information/possible settings
BOOL
BOOL

Traversing range limited
Traversing range modulo

SFC 14 DPRD_DAT DP
This description applies to the function in »STEP 7«
• System function for reading of consistent data of a DP standard node/PROFINET IO device.
• This serves to consistently exchange the process data between PROFIBUS/PROFINET master and
»STEP 7« PLC program.

7.15

SFC 15 DPWR_DAT DP
This description applies to the function in »STEP 7«
• System function for writing consistent data to a DP standard node/PROFINET IO device.
• This serves to consistently exchange the process data between PROFIBUS/PROFINET master and
»STEP 7« PLC program.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

79

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.16

LCB_Norm_nToSpeed_s - signal converter
This description applies to the following FBs:
• »STEP 7«: FB432 LCB_Norm_nToSpeed_s
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_nToSpeed_s
Function library:

LenzeLogicControlBasic

This FB converts the 32 bit input signal into a 32 bit speed signal.
LCB_Norm_nToSpeed_s
⎯ EN

ENO ⎯

DINT ⎯ diIn_n

diOut_s ⎯ DINT

DB ⎯ AxisData

xError ⎯ BOOL

Inputs
Identifier/data type

Information/possible settings

diIn_n

Input signal 100 % ≡ 230 = 1073741824

AxisData

DINT

Instance block of the FB LenzeSetAxisData.
DB parameters ( 78)

LCB_SetAxisData - machine

Outputs
Identifier/data type
diOut_s
xError

Information/possible settings
DINT
BOOL

Output signal in [rpm] 15000 rpm ≡ 226 = 67108864
Status signal &quot; Fault &quot;
FALSE Conversion carried out without errors
TRUE Error during the conversion

80

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.17

LCB_Speed_sToNorm_n - signal converter
This description applies to the following FBs:
• »STEP 7«: FB435 LCB_Speed_sToNorm_n
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_Speed_sToNorm_n
Function library:

LenzeLogicControlBasic

This FB converts the input signal into a 32-bit signal.
LCB_Speed_sToNorm_n
⎯ EN

ENO ⎯

DINT ⎯ diIn_s

diOut_n ⎯ DINT

DB ⎯ AxisData

xError ⎯ BOOL

Inputs
Identifier/data type

Information/possible settings

diIn_s

Input signal in [rpm]

AxisData

DINT

15000 rpm ≡ 226 = 67108864

Instance block of the FB LCB_SetAxisData.
DB parameters ( 78)

LCB_SetAxisData - machine

Outputs
Identifier/data type
diOut_n
xError

Information/possible settings
DINT
BOOL

Output signal in [%] 100% ≡ 230 = 1073741824
Status signal &quot; Fault &quot;
FALSE Conversion carried out without errors
TRUE Error during the conversion

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

81

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.18

LCB_Speed_sToSpeed_v - signal converter
This description applies to the following FBs:
• »STEP 7«: FB436 LCB_Speed_sToSpeed_v
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_Speed_sToSpeed_v
Function library:

LenzeLogicControlBasic

This FB converts a 32 bit speed signal into a 16 bit speed signal.
LCB_Speed_sToSpeed_v
⎯ EN

ENO ⎯

DINT ⎯ diIn_s

iOut_v ⎯ INT

Inputs
Identifier/data type

Information/possible settings

diIn_s

Input signal in [rpm]

DINT

15000 rpm ≡ 226 = 67108864

Outputs
Identifier/data type
iOut_v

7.19

Value/meaning
INT

Output signal in [rpm]

LCB_Speed_vToSpeed_s - signal converter
This description applies to the following FBs:
• »STEP 7«: FB437 LCB_Speed_vToSpeed_s
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_Speed_vToSpeed_s
Function library:

LenzeLogicControlBasic

This FB converts a 16 bit speed signal into a 32 bit speed signal.
LCB_Speed_vToSpeed_s
⎯ EN
INT ⎯ iIn_v

ENO ⎯
diOut_s ⎯ DINT

Inputs
Identifier/data type
iIn_v

82

Information/possible settings
INT

Input signal in [rpm] 15000 rpm ≡ 214 = 16384

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________
Outputs
Identifier/data type

7.20

Value/meaning

diOut_s

Output signal in [rpm] 15000 rpm ≡ 226 = 67108864

DINT

LCB_Norm_aToNorm_n - signal converter
This description applies to the following functions:
• »STEP 7«: FC430 LCB_Norm_aToNorm_n
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_Norm_aToNorm_n
Function library:

LenzeLogicControlBasic

This function converts a 16 bit input signal into a 32 bit output signal.
LCB_aToNorm_n
⎯ EN
INT ⎯ iIn_a

ENO ⎯
RET_VAL ⎯ DINT

Inputs
Identifier/data type

Information/possible settings

iIn_a

± 199.99% = ± 215 = ± 32767

INT

Outputs
Identifier/data type
RET_VAL

Information/possible settings
DINT

100 % ≡ 230 = 1073741824

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

83

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.21

LCB_Norm_nToNorm_a - signal converter
This description applies to the following functions:
• »STEP 7«: FC431 LCB_Norm_nToNorm_a
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_Norm_nToNorm_a
Function library:

LenzeLogicControlBasic

This function converts a 32 bit input signal into a 16 bit output signal.
LCB_nToNorm_a
⎯ EN

ENO ⎯

INT ⎯ iIn_a

RET_VAL ⎯ DINT

Inputs
Identifier/data type

Information/possible settings

diIn_n

Input signal 100 % ≡ 230 = 1073741824

INT

Outputs
Identifier/data type
RET_VAL

7.22

Information/possible settings
100 % ≡ 214 = 16384

DINT

LCB_Speed_nToNorm_r - signal converter
This description applies to the following FBs:
• »STEP 7«: FC433 LCB_Speed_nToNorm_r
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_Speed_nToNorm_r
Function library:

LenzeLogicControlBasic

This function converts a 32 bit input signal into a 32 bit percentage signal.
LCB_Speed_nToNorm_r
⎯ EN
INT ⎯ diIn_n

ENO ⎯
RET_VAL ⎯ DINT

Inputs
Identifier/data type
diIn_n

84

Information/possible settings
INT

Input signal in [%] 100 % ≡ 230 = 1073741824

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________
Outputs
Identifier/data type

7.23

Information/possible settings

RET_VAL

Output signal in [rpm] 15000 rpm ≡ 226 = 67108864

DINT

LCB_Speed_rToNorm_n - signal converter
This description applies to the following functions:
• »STEP 7«: FC434 LCB_Speed_rToNorm_n
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_Speed_rToNorm_n
Function library:

LenzeLogicControlBasic

This function converts the transferred input signal into a 32-bit signal of DINT data type.
LCB_Speed_nToNorm_r
⎯ EN

ENO ⎯

INT ⎯ rIn_r

RET_VAL ⎯ DINT

Inputs
Identifier/data type
rIn_r

Information/possible settings
INT

Input signal 0-100.0 %

Outputs
Identifier/data type
RET_VAL

7.24

Information/possible settings
DINT

0 - 230 = 1073741824

LCB_PosToUnit - conversion block
This description applies to the following FBs:
• »STEP 7«: FB441 LCB_PosToUnit
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_PosToUnit
Function library:

LenzeLogicControlBasic

This FB uses the transmitted machine parameters and converts a position defined in the internal
unit [inc] into a position in the real unit of the machine.
LCB_PosToUnit
⎯ EN
DB ⎯ AxisData
DINT ⎯ diPosIn_p

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

ENO ⎯
rPositionOutUnits ⎯ DINT
xLimit ⎯ BOOL

85

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________
Inputs
Identifier/data type
AxisData
diPosIn_p

Information/possible settings
Instance block of the FB LCB_SetAxisData.
DB parameters ( 78)
DINT

LCB_SetAxisData - machine

Position in [increments]

Outputs
Identifier/data type
rPositionOutUnits
xLimit

7.25

Information/possible settings
Position in [unit]
DINT Output in &quot; e4 &quot; format (fixed point with four decimal positions)
BOOL

&quot; Output signal is limited &quot; status
• TRUE: The output signal is limited to the representable value range
±214748.3647.

LCB_UnitToPos - conversion block
This description applies to the following FBs:
• »STEP 7«: FB444 LCB_UnitToPos
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_UnitToPos
Function library:

LenzeLogicControlBasic

This FB converts a position value specified in the real unit of the machine into an internal position
value on the basis of the machine parameters transmitted.
LCB_UnitToPos
⎯ EN
DB ⎯ AxisData

ENO ⎯
diPosOut_p ⎯ DINT

REAL ⎯ rPositionInUnits

xLimit ⎯ BOOL

Inputs
Identifier/data type
AxisData
rPositionInUnits

Information/possible settings
Instance block of the FB LCB_SetAxisData.
DB ( 78)

LCB_SetAxisData - machine parameters

Position in [unit]
REAL Selection in &quot; e4 &quot; view (fixed point with four decimal positions)

Outputs
Identifier/data type
diPosOut_p
xLimit

86

Information/possible settings
DINT
BOOL

Position in [increments]
&quot; Output signal is limited &quot; status
• TRUE: The output signal is limited to the representable value range
±214748.3647.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.26

LCB_UnitToSpeed - conversion block
This description applies to the following FBs:
• »STEP 7«: FB445 LCB_UnitToSpeed
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_UnitToSpeed
Function library:

LenzeLogicControlBasic

This FB converts the transmitted speed value of the real machine into an internal speed value.
LCB_UnitToSpeed
⎯ EN
DB ⎯ AxisData

ENO ⎯
diSpeedOut_p ⎯ REAL

REAL ⎯ rSpeedInUnits

xLimit ⎯ BOOL

Inputs
Identifier/data type
AxisData
rSpeedInUnits

Information/possible settings
Instance block of the FB LCB_SetAxisData.
DB parameters ( 78)

LCB_SetAxisData - machine

Position in [unit]
REAL Selection in &quot; e4 &quot; view (fixed point with four decimal positions)

Outputs
Identifier/data type
diSpeedOut_p
xLimit

Information/possible settings
DINT
BOOL

Position in [increments]
&quot; Output signal is limited &quot; status
• TRUE: The output signal is limited to the representable value range.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

87

Lenze LogicControlBasic/DriveControlBasic - controlling and
calculating
________________________________________________________________

7.27

LCB_SpeedToUnit - conversion block
This description applies to the following FBs:
• »STEP 7«: FB442 LCB_SpeedToUnit
• »TIA Portal«: LCB_300/LCB_12x/LCB_15x_SpeedToUnit
Function library:

LenzeLogicControlBasic

This FB converts a speed value specified in the internal unit [rpm] into a speed value in the real unit
of the machine on the basis of the machine parameters transmitted.
LCB_SpeedToUnit
⎯ EN
DB ⎯ AxisData

ENO ⎯
rSpeedOutUnits ⎯ REAL

DINT ⎯ diSpeedIn_s

xLimit ⎯ BOOL

Inputs
Identifier/data type
AxisData
diSpeedIn_s

Information/possible settings
Instance block of the FB LCB_SetAxisData.
DB ( 78)
DINT

LCB_SetAxisData - machine parameters

Velocity as speed in [rpm] 15000 rpm ≡ 226 = 67108864

Outputs
Identifier/data type
rSpeedOutUnits
xLimit

88

Value/meaning
REAL
BOOL

Speed in [unit/s]
• Output in &quot; e4 &quot; format (fixed point with four decimal positions)
&quot; Output signal is limited &quot; status
• TRUE: The output signal is limited to the representable value range
±214748.3647.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDriveCommunication library - accessing parameters
Overview of the functions and function blocks
________________________________________________________________

8

The LenzeDriveCommunication library - accessing parameters
This LenzeDriveCommunication library...
• ...contains function blocks for processing parameters.
• ...is available for the Siemens software »STEP 7« and »TIA Portal«.

8.1

Overview of the functions and function blocks



Note!
The FBs of this library have to be used separately. It is not possible to use several FBs at
the same time for accessing parameters of the Controller!
The LenzeDriveCommunication library contains the Siemens system functions (SFB) 52/
53. When these blocks are used, you have to observe the maximally possible number of
calls that can be used in parallel. Depending on the Siemens-CPU used, a different
number of calls is possible. More information can be found in the technical data of the
Siemens-CPU.

In »STEP 7«: The &quot; LenzeDriveCommunication &quot; library: Step_7_300_400
Use the library for the following target systems: SIMATIC S7 300/S7 400.
DPV1_Parameter
FB300

DCO_ReadDriveParameter ( 92)

FB301

DCO_WriteDriveParameter ( 94)

FB302

DCO_ReadDriveArray32b ( 100)

FB303

DCO_ReadDriveArray16b ( 97)

FB304

DCO_ReadDriveArray8b ( 96)

FB306

DCO_ReadDriveParamString ( 102)

FB308

DCO_WriteDriveArray32b ( 106)

FB309

DCO_WriteDriveArray16b ( 105)

FB310

DCO_WriteDriveArray8b ( 103)

FB312

DCO_R_W_n_DrivePar ( 108)

FC307

FC307 CONCAT ( 111)

SFB4

SFB4 TON IEC_TC ( 111)

SFB52
[8-1]

SFB52 RDREC DP ( 111)

SFB53

SFB53 WRREC ( 112)

The LenzeDriveCommunication library in »STEP 7«

• The initials &quot; FBxxx &quot; indicate function blocks.
• The initials &quot; FCxxx &quot; indicate functions.
• The initials &quot; SFBxxx &quot; indicate function blocks for system functions.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

89

The LenzeDriveCommunication library - accessing parameters
Overview of the functions and function blocks
________________________________________________________________
In »TIA Portal«: The &quot; LenzeDriveCommunication &quot; library
Applies to the following libraries/target systems:
• TIA_S7_300_400, target system: SIMATIC S7 300/400
• TIA_S7_1200, target system: SIMATIC S7 12xx
• TIA_S7_1500, target system: SIMATIC S7 15xx
Function blocks
DCO_R_W_n_DrivePar ( 108)
DCO_ReadDriveArray8b ( 96)
DCO_ReadDriveArray16b ( 97)
DCO_ReadDriveArray32b ( 100)
DCO_ReadDriveParameter ( 92)
DCO_ReadDriveParamString ( 102)
DCO_WriteDriveArray8b ( 103)
DCO_WriteDriveArray16b ( 105)
DCO_WriteDriveArray32b ( 106)
DCO_WriteDriveParameter ( 94)

The contents of the libraries TIA_S7_300_400, TIA_S7_1200 and TIA_S7_1500 is identical. Use the library which
matches the desired target system.
The libraries contain the same function blocks as the LenzeDriveControlBasic, thus, the inputs/outputs of the function blocks and the operating mode are identical.
[8-2]

Example: The LenzeDriveCommunication library in »TIA Portal«



Note!
The following information is required to access the data of the controller:
• Desired access type: Read/Write
• Parameter number (number of the code/subcode)
• Scaling of the parameter (the number of decimal positions makes the factor). The
scaling can be between the factor 1 (parameter has no decimal position) and factor 10
000 (four decimal positions).
• The data type (one byte, two bytes, four bytes, or string parameters)
All blocks have an xTimeOut output which indicates after 10 seconds that a request
cannot be executed.

Possible data types of the parameters
Data type

Decimal

Hexadecimal

INT 8

2

0x02

Integer 16

INT 16

3

0x03

Integer 32

INT 32

4

0x04

Unsigned 8

UINT 8

5

0x05

Unsigned 16

UINT 16

6

0x06

Unsigned 32

90

Abbreviation

Integer 8

UINT 32

7

0x07

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDriveCommunication library - accessing parameters
Overview of the functions and function blocks
________________________________________________________________

Data type

Abbreviation

Decimal

Hexadecimal

Visible String

STRING

9

0x09

OCTET string

STRING

10

0x0A

64

0x040

Zero
Byte

BYTE

65

0x041

Word

WORD

66

0x042

Double Word

DWORD

67

0x043

Error

-

68

0x044

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

91

The LenzeDriveCommunication library - accessing parameters
DCO_ReadDriveParameter
________________________________________________________________

8.2

DCO_ReadDriveParameter
This description applies to the following FBs:
• »STEP 7«: FB300 DCO_ReadDriveParameter
• »TIA Portal«: DCO_300/DCO_12x/DCO_15x_ReadDriveParameter
Function library:

DCO_DriveCommunication

This FB reads the parameters of a Lenze controller and provides them to the application.
• Parameter values of max. 32 bits can be read.
• Supports index values and code numbers.
• The FB is independent of the used bus system.
• »STEP 7« provides a variable list for controlling this FB.
• S7 VAT ReadDriveParameter
DCO_ReadDriveParameter
⎯ EN

xDone ⎯ BOOL

INT ⎯ iDiagnosticADR

xBusy ⎯ BOOL

BOOL ⎯ xExecute
BOOL ⎯ xUseIndexAsParam
INT ⎯ iIndex
INT ⎯ iSubIndex

xError ⎯ BOOL
xTimeOut ⎯ BOOL
dwData ⎯ DWORD
iDataType ⎯ INT

INT ⎯ iScalingFactor

rData ⎯ REAL
diData ⎯ DINT
ENO ⎯

Inputs
Identifier/data type
iDiagnosticADR
xExecute
xUseIndexAsParam

Information/possible settings
Diagnostic address of the controller (defined in the hardware configuration of the
INT SIMATIC Manager).
BOOL
BOOL

Start parameter transfer.
Activates the direct entry of the code number without index conversion.
• The code number can be directly taken from the table of attributes or the
»Engineer«.
• Standard setting = &quot; TRUE &quot;

iIndex
iSubIndex
iScalingFactor

92

INT
INT
INT

Code number/index of the parameter to be read
Subindex number of the parameter to be read
Scaling factor for the output of the read value.
• Can be taken from the table of attributes.
• Standard setting = &quot; 1 &quot;

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDriveCommunication library - accessing parameters
DCO_ReadDriveParameter
________________________________________________________________
Outputs
Identifier/data type
xDone
xBusy
xError
xTimeOut
dwData

iDataType

rData
diData

Information/possible settings
BOOL
BOOL
BOOL
BOOL

Read operation completed
Read operation active
Error during read operation
Is TRUE if a job has not been processed after 10 seconds.

Read parameter value (data type: DWORD)
DWORD If an error occurred during the read operation, this output shows the corresponding
error code.
Data type of the read parameter value. Possible data types of the parameters
INT ( 90)
The return value &quot; 68 &quot; signalises an incorrect read operation. Error information
(wErrorCode) ( 112)
REAL
DINT

Read parameter value scaled as REAL (as single value/ARRAY depending on the FB).
Read parameter value scaled as DINT (as single value/ARRAY depending on the FB).

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

93

The LenzeDriveCommunication library - accessing parameters
DCO_WriteDriveParameter
________________________________________________________________

8.3

DCO_WriteDriveParameter
This description applies to the following FBs:
• »STEP 7«: FB301 DCO_WriteDriveParameter
• »TIA Portal«: DCO_300/DCO_12x/DCO_15x_WriteDriveParameter
Function library:

DCO_DriveCommunication

This FB writes values into the parameter of a Lenze controller.
• Parameter values of max. 32 bits can be read.
• Supports index values and code numbers.
• The FB is independent of the used bus system.
• »STEP 7« provides a variable list for controlling this FB.
• S7 VAT WriteDriveParameter
DCO_WriteDriveParameter
⎯ EN
INT ⎯ iDiagnosticADR
BOOL ⎯ xExecute

xDone ⎯ BOOL

BOOL ⎯ xUseIndexAsParam

xBusy ⎯ BOOL

INT ⎯ iIndex

xError ⎯ BOOL

INT ⎯ iSubIndex

xTimeOut ⎯ BOOL

INT ⎯ iType

wErrorCode ⎯ BOOL

INT ⎯ iScalingFactor

wErrorInfo ⎯ WORD

REAL ⎯ rValue

ENO ⎯ WORD

Inputs
Identifier/data type
iDiagnosticADR
xExecute
xUseIndexAsParam

Information/possible settings
Diagnostic address of the controller (defined in the hardware configuration of the
INT SIMATIC Manager).
BOOL
BOOL

Start parameter transfer.
Activates the direct entry of the code number without index conversion.
• The code number can be directly taken from the table of attributes or the
»Engineer«.
• Standard setting = &quot; TRUE &quot;

iIndex
iSubIndex
iType

94

INT
INT

Code number/index of the parameter to be read
First subcode number to be read.
• Standard setting = &quot; 0 &quot;

Data type of the parameter value to be written. Possible data types of the
INT parameters ( 90)
• The data type must be defined in a decimal way.
• Standard setting = &quot; 7 &quot;

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDriveCommunication library - accessing parameters
DCO_WriteDriveParameter
________________________________________________________________

Identifier/data type
iScalingFactor

rValue

Information/possible settings
INT

REAL

Scaling factor for the output of the read value.
• Can be taken from the table of attributes.
• Standard setting = &quot; 1 &quot;
Value to be written is scaled as REAL
• The FB scales/converts the value internally via the inputs iType/iScalingFactor.

Outputs
Identifier/data type
xDone
xBusy
xError
xTimeOut

Information/possible settings
BOOL
BOOL
BOOL
BOOL

Write operation completed
Write operation active
Error during write operation
Is TRUE if a job has not been processed after 10 seconds.

wErrorCode

If an error occurred during the read operation, this output shows the corresponding
WORD error code.

wErrorInfo

Provides additional information on the error if available.
WORD (wErrorCode) ( 112)

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Error information

95

The LenzeDriveCommunication library - accessing parameters
DCO_ReadDriveArray8b
________________________________________________________________

8.4

DCO_ReadDriveArray8b
This description applies to the following FBs:
• »STEP 7«: FB304 DCO_ReadDriveArray8b
• »TIA Portal«: DCO_300/DCO_12x/DCO_15x_ReadDriveArray8b
Function library:

DCO_DriveCommunication

This FB reads the subcodes of a Lenze controller of 8 bits data type.
• Maximally 32 subcodes can be read.
• Parameter values of max. 8 bits can be read.
• Supports index values and code numbers.
• The FB is independent of the used bus system.
• »STEP 7« provides a variable list for controlling this FB.
• S7 VAT ReadDriveArray8
DCO_ReadDriveArray8b
⎯ EN

xDone ⎯ BOOL

INT ⎯ iDiagnosticADR

xBusy ⎯ BOOL

BOOL ⎯ xExecute

xError ⎯ BOOL

BOOL ⎯ xUseIndexAsParam

xTimeOut ⎯ BOOL

INT ⎯ iIndex

iDataType ⎯ INT

INT ⎯ iSubIndex

byData ⎯ ARRAY [0...32] BYTE

INT ⎯ iCountSubIndex

rData ⎯ ARRAY [0...32] REAL

INT ⎯ iScalingFactor

iData ⎯ ARRAY [0...32] INT
ENO ⎯

Inputs
Identifier/data type
iDiagnosticADR
xExecute
xUseIndexAsParam

Information/possible settings
Diagnostic address of the controller (defined in the hardware configuration of the
INT SIMATIC Manager).
BOOL
BOOL

Start parameter transfer.
Activates the direct entry of the code number without index conversion.
• The code number can be directly taken from the table of attributes or the
»Engineer«.
• Standard setting = &quot; TRUE &quot;

iIndex
iSubIndex
iCountSubIndex
iScalingFactor

96

INT

Code number/index of the parameter to be read

INT

First subcode number to be read.
• Standard setting = &quot; 1 &quot;

INT

Number of subcodes to be read
• Standard setting = &quot; 32 &quot;

INT

Scaling factor for the output of the read value.
• Can be taken from the table of attributes.
• Standard setting = &quot; 1 &quot;

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDriveCommunication library - accessing parameters
DCO_ReadDriveArray16b
________________________________________________________________
Outputs
Identifier/data type
xDone

BOOL

xBusy

BOOL

xError

BOOL

xTimeOut

BOOL

iDataType

iData

Read operation completed
Read operation active
Error during read operation
Is TRUE if a job has not been processed after 10 seconds.

Data type of the read parameter value. Possible data types of the parameters
INT ( 90)
• The return value &quot; 68 &quot; signalises an incorrect read operation. Error information
(wErrorCode) ( 112)

byData

rData

Information/possible settings

ARRAY [0...32]

ARRAY [0...32] REAL
ARRAY [0...32] INT

Read parameter value (data type: BYTE)
• If an error occurred during the read operation, this output shows the
corresponding error code.
Read parameter value scaled as REAL (as single value/ARRAY depending on the FB).
Read parameter value scaled as INT (as single value/ARRAY depending on the FB).

In the related instance block, the read parameter values are located at the following positions:
Array ...
... byData

DB304.DBB16 - DBB47

... rData

DB304.DBD48 - DBD172

... iData

8.5

Position

DB304.DBW176 - DBW300

DCO_ReadDriveArray16b
This description applies to the following FBs:
• »STEP 7«: FB303 DCO_ReadDriveArray16b
• »TIA Portal«: DCO_300/DCO_12x/DCO_15x_ReadDriveArray16b
Function library:

DCO_DriveCommunication

This FB reads the subcodes of a Lenze controller of 16 bits data type.
• Maximally 32 subcodes can be read.
• Parameter values of max. 16 bits can be read.
• Supports index values and code numbers.
• The FB is independent of the used bus system.
• »STEP 7« provides a variable list for controlling this FB.
• S7 VAT ReadDriveArray16
DCO_ReadDriveArray16b
⎯ EN
INT ⎯ iDiagnosticADR

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

xDone ⎯ BOOL
xBusy ⎯ BOOL

97

The LenzeDriveCommunication library - accessing parameters
DCO_ReadDriveArray16b
________________________________________________________________

DCO_ReadDriveArray16b
BOOL ⎯ xExecute

xError ⎯ BOOL

BOOL ⎯ xUseIndexAsParam

xTimeOut ⎯ BOOL

INT ⎯ iIndex

iDataType ⎯ INT

INT ⎯ iSubIndex

wData ⎯ ARRAY [0...32] WORD

INT ⎯ iCountSubIndex

rData ⎯ ARRAY [0...32] REAL

INT ⎯ iScalingFactor

iData ⎯ ARRAY [0...32] INT
ENO ⎯

Inputs
Identifier/data type
iDiagnosticADR
xExecute
xUseIndexAsParam

Information/possible settings
Diagnostic address of the controller (defined in the hardware configuration of the
INT SIMATIC Manager).
BOOL
BOOL

Start parameter transfer.
Activates the direct entry of the code number without index conversion.
• The code number can be directly taken from the table of attributes or the
»Engineer«.
• Standard setting = &quot; TRUE &quot;

iIndex

INT

iSubIndex
iCountSubIndex
iScalingFactor

Code number/index of the parameter to be read

INT

First subcode number to be read.
• Standard setting = &quot; 1 &quot;

INT

Number of subcodes to be read
• Standard setting = &quot; 32 &quot;

INT

Scaling factor for the output of the read value.
• Can be taken from the table of attributes.
• Standard setting = &quot; 1 &quot;

Outputs
Identifier/data type
xDone

BOOL

xBusy

BOOL

xError

BOOL

xTimeOut
iDataType

wData

98

Information/possible settings

BOOL

Read operation completed
Read operation active
Error during read operation
Is TRUE if a job has not been processed after 10 seconds.

Data type of the read parameter value. Possible data types of the parameters
INT ( 90)
• The return value &quot; 68 &quot; signalises an incorrect read operation. Error information
(wErrorCode) ( 112)

ARRAY [0...32] WORD

Read parameter value (data type: WORD)
• If an error occurred during the read operation, this output shows the
corresponding error code.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDriveCommunication library - accessing parameters
DCO_ReadDriveArray16b
________________________________________________________________

Identifier/data type

Information/possible settings

rData

Read parameter value scaled as REAL (as single value/ARRAY depending on the FB).

iData

ARRAY [0...32] REAL
ARRAY [0...32] INT

Read parameter value scaled as INT (as single value/ARRAY depending on the FB).

In the related instance block, the read parameter values are located at the following positions:
Array ...

Position

... wData

DB303.DBW16 - DBW78

... rData

DB303.DBD80 - DBD204

... iData

DB303.DBD208 - DBW270

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

99

The LenzeDriveCommunication library - accessing parameters
DCO_ReadDriveArray32b
________________________________________________________________

8.6

DCO_ReadDriveArray32b
This description applies to the following FBs:
• »STEP 7«: FB302 DCO_ReadDriveArray32b
• »TIA Portal«: DCO_300/DCO_12x/DCO_15x_ReadDriveArray32b
Function library:

DCO_DriveCommunication

This FB reads the subcodes of a Lenze controller of 32 bits data type.
• Maximally 32 subcodes can be read.
• Parameter values of max. 32 bits can be read.
• Supports index values and code numbers.
• The FB is independent of the used bus system.
• »STEP 7« provides a variable list for controlling this FB.
• S7 VAT ReadDriveArray32
DCO_ReadDriveArray32b
⎯ EN

xDone ⎯ BOOL

INT ⎯ iDiagnosticADR

xBusy ⎯ BOOL

BOOL ⎯ xExecute

xError ⎯ BOOL

BOOL ⎯ xUseIndexAsParam

xTimeOut ⎯ BOOL

INT ⎯ iIndex

iDataType ⎯ INT

INT ⎯ iSubIndex

dwData ⎯ ARRAY [0...32] DWORD

INT ⎯ iCountSubIndex

rData ⎯ ARRAY [0...32] REAL

INT ⎯ iScalingFactor

diData ⎯ ARRAY [0...32] DINT
ENO ⎯

Inputs
Identifier/data type
iDiagnosticADR
xExecute
xUseIndexAsParam

Information/possible settings
Diagnostic address of the controller (defined in the hardware configuration of the
INT SIMATIC Manager).
BOOL
BOOL

Start parameter transfer.
Activates the direct entry of the code number without index conversion.
• The code number can be directly taken from the table of attributes or the
»Engineer«.
• Standard setting = &quot; TRUE &quot;

iIndex
iSubIndex
iCountSubIndex
iScalingFactor

100

INT

Code number/index of the parameter to be read

INT

First subcode number to be read.
• Standard setting = &quot; 0 &quot;

INT

Number of subcodes to be read
• Standard setting = &quot; 32 &quot;

INT

Scaling factor for the output of the read value.
• Can be taken from the table of attributes.
• Standard setting = &quot; 1 &quot;

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDriveCommunication library - accessing parameters
DCO_ReadDriveArray32b
________________________________________________________________
Outputs
Identifier/data type
xDone

Information/possible settings
BOOL

xBusy

BOOL

xError

BOOL

xTimeOut
iDataType

BOOL

Read operation completed
Read operation active
Error during read operation
Is TRUE if a job has not been processed after 10 seconds.

Data type of the read parameter value. Possible data types of the parameters
INT ( 90)
• The return value &quot; 68 &quot; signalises an incorrect read operation. Error information
(wErrorCode) ( 112)

dwData
Read parameter value (data type: DWORD)
ARRAY [0...32] DWORD • If an error occurred during the read operation, this output shows the
corresponding error code.
rData
diData

ARRAY [0...32] REAL
ARRAY [0...32] DINT

Read parameter value scaled as REAL (as single value/ARRAY depending on the FB).
Read parameter value scaled as DINT (as single value/ARRAY depending on the FB).

In the related instance block, the read parameter values are located at the following positions:
Array ...

Position

... dwData

DB302.DBD16 - DBD140

... rData

DB302.DBD144 - DBD268

... diData

DB302.DBD270 - DBD396

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

101

The LenzeDriveCommunication library - accessing parameters
DCO_ReadDriveParamString
________________________________________________________________

8.7

DCO_ReadDriveParamString
This description applies to the following FBs:
• »STEP 7«: FB306 DCO_ReadDriveParamString
• »TIA Portal«: DCO_300/DCO_12x/DCO_15x_ReadDriveParamString
Function library:

LenzeDriveCommunication

This FB reads a code of &quot; String &quot; data type of a Lenze controller.
• Reads up to 128 characters (bytes) of a STRING code.
• The FB is independent of the used bus system.
• »STEP 7« provides a variable list for controlling this FB.
• S7 VAT ReadDriveStringParam
DCO_ReadDriveParamString
⎯ EN

xDone ⎯ BOOL

INT ⎯ iDiagnosticADR

xBusy ⎯ BOOL

BOOL ⎯ xExecute

xError ⎯ BOOL

BOOL ⎯ xUseIndexAsParam

xTimeOut ⎯ BOOL

INT ⎯ iIndex

sData ⎯ STRING [0...128]

INT ⎯ iSubIndex

iDataType ⎯ ARRAY [0...32] INT
ENO ⎯

Inputs
Identifier/data type
iDiagnosticADR
xExecute
xUseIndexAsParam

Information/possible settings
Diagnostic address of the controller (defined in the hardware configuration of the
INT SIMATIC Manager).
BOOL
BOOL

Start parameter transfer.
Activates the direct entry of the code number without index conversion.
• The code number can be directly taken from the table of attributes or the
»Engineer«.
• Standard setting = &quot; TRUE &quot;

iIndex
iSubIndex

INT
INT

Code number/index of the parameter to be read
First subcode number to be read.
• Standard setting = &quot; 1 &quot;

Outputs
Identifier/data type
xDone
xBusy
xError

102

Information/possible settings
BOOL
BOOL
BOOL

Read operation completed
Read operation active
Error during read operation

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDriveCommunication library - accessing parameters
DCO_WriteDriveArray8b
________________________________________________________________

Identifier/data type
xTimeOut
sData

BOOL
STRING [128]

iDataType



Information/possible settings
Is TRUE if a job has not been processed after 10 seconds.
Read parameter value (data type: STRING)

Data type of the read parameter value. Possible data types of the parameters
INT ( 90)
• The return value &quot; 68 &quot; signalises an incorrect read operation. Error information
(wErrorCode) ( 112)

Note!
The text read in from the controller at the sData output is only visible to a limited extent
in the variable table of »STEP 7«!
• In the DB/status view of the variables, the text cannot be read (the variable table can
present the single characters of the STRING).
• The sData variable, for instance, can be read/presented by a separate HMI device.

In the related instance block, the read parameter values are located at the following positions:
STRING ...

8.8

Position

... sData

DB306.DBD10 – DBB140

DCO_WriteDriveArray8b
This description applies to the following FBs:
• »STEP 7«: FB310 DCO_WriteDriveArray8b
• »TIA Portal«: DCO_300/DCO_12x/DCO_15x_WriteDriveArray8b
Function library:

DCO_DriveCommunication

This FB writes up to 32 subcodes of a Lenze controller of
8 bits data type
• The FB can write maximally 32 subcodes.
• The FB can write parameter values of 8 bits.
• Supports index values and code numbers.
• The FB is independent of the used bus system.
• »STEP 7« provides a variable list for controlling this FB.
• S7 VAT WriteDriveArray8
DCO_WriteDriveArray8b
⎯ EN
INT ⎯ iDiagnosticADR
BOOL ⎯ xExecute
BOOL ⎯ xUseIndexAsParameter
INT ⎯ iIndex

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

xDone ⎯ BOOL
xBusy ⎯ BOOL

103

The LenzeDriveCommunication library - accessing parameters
DCO_WriteDriveArray8b
________________________________________________________________

DCO_WriteDriveArray8b
INT ⎯ iSubIndex

xError ⎯ BOOL

INT ⎯ iCountSubIndex

xTimeOut ⎯ BOOL

INT ⎯ iType

iDataType ⎯ INT

INT ⎯ iScalingFactor

dwErrorcode ⎯ DWORD

ARRAY [0...32] REAL] ⎯ rData

ENO ⎯

Inputs
Identifier/data type

Information/possible settings

iDiagnosticADR

Diagnostic address of the controller (defined in the hardware configuration of the
INT SIMATIC Manager).

xExecute

BOOL

xUseIndexAsParameter

BOOL

Start parameter transfer.
Activates the direct entry of the code number without index conversion.
• The code number can be directly taken from the table of attributes or the
»Engineer«.
• Standard setting = &quot; TRUE &quot;

iIndex

INT

iSubIndex
iCountSubIndex
iType

INT

First subcode number to be written.
• Standard setting = &quot; 1 &quot;

INT

Number of subcodes to be written.
• Standard setting = &quot; 32 &quot;

Data type of the parameter value to be written. Possible data types of the
INT parameters ( 90)
• The data type must be defined in a decimal way.
• Standard setting = &quot; 7 &quot;

iScalingFactor

rData

Code number/index of the parameter to be written.

INT

ARRAY [0...32] REAL

Scaling factor for the output of the values to be written.
• Can be taken from the table of attributes.
• Standard setting = &quot; 1 &quot;
Values to be written in array codes (FB 308, FB 309, FB 310)

Outputs
Identifier/data type
xDone
xBusy
xError
xTimeOut
iDataType
dwErrorCode

104

Information/possible settings
BOOL
BOOL
BOOL
BOOL

Write operation completed
Write operation active
Error during write operation
Is TRUE if a job has not been processed after 10 seconds.

The return value &quot; 68 &quot; signalises an incorrect write operation.
INT (wErrorCode) ( 112)
DWORD

Error information

Error number/error info if an error occurred during the write operation.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDriveCommunication library - accessing parameters
DCO_WriteDriveArray16b
________________________________________________________________
In the related instance block, the parameter values to be written are located at the following
positions:
Array ...
... rData

8.9

Position
DB310.DBD14 – DBD138

DCO_WriteDriveArray16b
This description applies to the following FBs:
• »STEP 7«: FB309 DCO_WriteDriveArray16b
• »TIA Portal«: DCO_300/DCO_12x/DCO_15x_WriteDriveArray16b
Function library:

DCO_DriveCommunication

This FB writes up to 32 subcodes of a Lenze controller of 16 bits data type.
• The FB can write maximally 32 subcodes.
• The FB can write parameter values of 16 bits.
• Supports index values and code numbers.
• The FB is independent of the used bus system.
• »STEP 7« provides a variable list for controlling this FB.
• S7 VAT WriteDriveArray16
DCO_WriteDriveArray16b
⎯ EN
INT ⎯ iDiagnosticADR
BOOL ⎯ xExecute
BOOL ⎯ xUseIndexAsParameter

xDone ⎯ BOOL

INT ⎯ iIndex

xBusy ⎯ BOOL

INT ⎯ iSubIndex

xError ⎯ BOOL

INT ⎯ iCountSubIndex

xTimeOut ⎯ BOOL

INT ⎯ iType

iDataType ⎯ INT

INT ⎯ iScalingFactor
ARRAY [0...32] REAL] ⎯ rData

dwErrorcode ⎯ DWORD
ENO ⎯

Inputs
Identifier/data type
iDiagnosticADR
xExecute
xUseIndexAsParameter

Information/possible settings
Diagnostic address of the controller (defined in the hardware configuration of the
INT SIMATIC Manager).
BOOL
BOOL

Start parameter transfer.
Activates the direct entry of the code number without index conversion.
• The code number can be directly taken from the table of attributes or the
»Engineer«.
• Standard setting = &quot; TRUE &quot;

iIndex

INT

Code number/index of the parameter to be written

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

105

The LenzeDriveCommunication library - accessing parameters
DCO_WriteDriveArray32b
________________________________________________________________

Identifier/data type
iSubIndex
iCountSubIndex
iType

INT

First subcode number to be written.
• Standard setting = &quot; 1 &quot;

INT

Number of subcodes to be written.
• Standard setting = &quot; 32 &quot;

Data type of the parameter value to be written. Possible data types of the
INT parameters ( 90)
• The data type must be defined in a decimal way.
• Standard setting = &quot; 7 &quot;

iScalingFactor

rData

Information/possible settings

INT

ARRAY [0...32] REAL

Scaling factor for the output of the values to be written.
• Can be taken from the table of attributes.
• Standard setting = &quot; 1 &quot;
Values to be written in array codes (FB 308, FB 309, FB 310)

Outputs
Identifier/data type
xDone
xBusy
xError
xTimeOut
iDataType
dwErrorCode

Information/possible settings
BOOL
BOOL
BOOL
BOOL

Write operation completed
Write operation active
Error during write operation
Is TRUE if a job has not been processed after 10 seconds.

The return value &quot; 68 &quot; signalises an incorrect write operation.
INT (wErrorCode) ( 112)
DWORD

Error information

Error number/error info if an error occurred during the write operation.

In the related instance block, the parameter values to be written are located at the following
positions:
Array ...

8.10

Position

... rData

DB309.DBD14 – DBD138

DCO_WriteDriveArray32b
This description applies to the following FBs:
• »STEP 7«: FB308 DCO_WriteDriveArray32b
• »TIA Portal«: DCO_300/DCO_12x/DCO_15x_WriteDriveArray32b
Function library:

DCO_DriveCommunication

This FB writes up to 32 subcodes of a Lenze controller of 32 bits data type.
• The FB can write maximally 32 subcodes.
• The FB can write parameter values of 32 bits.
• Supports index values and code numbers.
• The FB is independent of the used bus system.

106

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDriveCommunication library - accessing parameters
DCO_WriteDriveArray32b
________________________________________________________________
• »STEP 7« provides a variable list for controlling this FB.
• S7 VAT WriteDriveArray32
DCO_WriteDriveArray32b
⎯ EN
INT ⎯ iDiagnosticADR
BOOL ⎯ xExecute
BOOL ⎯ xUseIndexAsParameter

xDone ⎯ BOOL

INT ⎯ iIndex

xBusy ⎯ BOOL

INT ⎯ iSubIndex

xError ⎯ BOOL

INT ⎯ iCountSubIndex
INT

iType

INT ⎯ iScalingFactor
ARRAY [0...32] REAL]

rData

xTimeOut ⎯ BOOL
iDataType ⎯ INT
dwErrorType ⎯ ARRAY [0...32] DWORD
ENO ⎯

Inputs
Identifier/data type
iDiagnosticADR
xExecute

Information/possible settings
Diagnostic address of the controller (defined in the hardware configuration of the
INT SIMATIC Manager).
BOOL

xUseIndexAsParameter

BOOL

Start parameter transfer.
Activates the direct entry of the code number without index conversion.
• The code number can be directly taken from the table of attributes or the
»Engineer«.
• Standard setting = &quot; TRUE &quot;

iIndex

INT

iSubIndex
iCountSubIndex
iType

INT

First subcode number to be written.
• Standard setting = &quot; 1 &quot;

INT

Number of subcodes to be written:
• Standard setting = &quot; 32 &quot;

Data type of the parameter value to be written. Possible data types of the
INT parameters ( 90)
• The data type must be defined in a decimal way.
• Standard setting = &quot; 7 &quot;

iScalingFactor

rData

Code number/index of the parameter to be written.

INT

ARRAY [0...32] REAL

Scaling factor for the output of the value to be written.
• Can be taken from the table of attributes.
• Standard setting = &quot; 1 &quot;
Values to be written in array codes (FB 308, FB 309, FB 310)

Outputs
Identifier/data type
xDone
xBusy

Information/possible settings
BOOL
BOOL

Write operation completed
Write operation active

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

107

The LenzeDriveCommunication library - accessing parameters
DCO_R_W_n_DrivePar
________________________________________________________________

Identifier/data type
xError
xTimeOut
iDataType
dwErrorCode

Information/possible settings
BOOL
BOOL

Error during write operation
Is TRUE if a job has not been processed after 10 seconds.

The return value &quot; 68 &quot; signalises an incorrect write operation.
INT (wErrorCode) ( 112)
DWORD

Error information

Error number/error info if an error occurred during the write operation.

In the related instance block, the parameter values to be written are located at the following
positions:
Array ...
... rData

8.11

Position
DB308.DBD14 – DBD138

DCO_R_W_n_DrivePar
This description applies to the following FBs:
• »STEP 7«: FB312 DCO_R_W_n_DrivePar
• »TIA Portal«: DCO_300/DCO_12x/DCO_15x_R_W_n-DrivePar
Function library:

DCO_DriveCommunication

This FB reads/writes up to 32 codes/subcodes of a Lenze controller.
• It can be defined for each of the 32 jobs if it is to be read or written.
• The parameters of a job can be transmitted...
• ...via array (UDT333 DriveParameter) to the block in »STEP 7«.
• ...with the DriveParameter data type in »TIA Portal«.
• ...with the data block DB 313 (DB_DCO_ARRAY_FB312).
• The FBs transmits the individual jobs internally via a loop through FB 300 and FB 301 to the
corresponding controller.
• Supports index values and code numbers.
• The FB is independent of the used bus system.
• »STEP 7« provides a variable list for controlling this FB.
• S7 VAT RW_ParameterList
DCO_R_W_n_DrivePar
⎯ EN
INT ⎯ iDiagnosticADR
BOOL ⎯ xExecute
BOOL ⎯ xUseIndexAsParameter
INT ⎯ iNumberofParameter
ARRAY [0...32] of UDT333 ⎯ aDriveParameter

xDone ⎯ BOOL
xBusy ⎯ BOOL
xError ⎯ BOOL
xTimeOut ⎯ BOOL
dwErrorcode ⎯ DWORD
iErrorDataset ⎯ INT
iCounter ⎯ INT
ENO ⎯

108

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDriveCommunication library - accessing parameters
DCO_R_W_n_DrivePar
________________________________________________________________
Inputs
Identifier/data type

Information/possible settings

iDiagnosticADR

Diagnostic address of the controller (defined in the hardware configuration of the
INT SIMATIC Manager).

xExecute

BOOL

xUseIndexAsParameter

BOOL

Start parameter transfer.
Activates the direct entry of the code number without index conversion.
• The code number can be directly taken from the table of attributes or the
»Engineer«.
• Standard setting = &quot; TRUE &quot;

iNumberofParameter

INT

Number of the codes/subcodes to be read/written
• Standard setting = &quot; 1 &quot;

aDriveParameter
Parameters to be read/written in case of multi-parameter access
ARRAY [0...32] of UDT333

Outputs
Identifier/data type
xDone
xBusy
xError
xTimeOut
dwErrorCode
iErrorDataset
iCounter

Information/possible settings
BOOL
BOOL
BOOL
BOOL
DWORD
INT

Write operation completed
Write operation active
Error during write operation
Is TRUE if a job has not been processed after 10 seconds.
Error number/error info if an error occurred during the write operation.
Parameter data set that triggered the error.

Indicates iNumberOfParameter +1 after a successfully processed job (for diagnostic
INT purposes).

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

109

The LenzeDriveCommunication library - accessing parameters
DCO_R_W_n_DrivePar
________________________________________________________________

[8-3]

Representation in »STEP 7«: The DB 313 data block shows the individual jobs (marked by squared brackets).

• In the data block, up to 32 parameter requests can be projected.
• A pointer (P#DB313.DBX0.0) is used to transfer the data to the FB312.

110

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDriveCommunication library - accessing parameters
FC307 CONCAT
________________________________________________________________

8.12

FC307 CONCAT
Corresponds to the function FC 2 CONCAT (IEC library by Siemens)
This function combines two STRING variables to one string.
• Reads a &quot; STRING &quot; data type from the axes/combines the individual &quot; characters &quot; to one STRING.
• If the output string is longer than the variable applied to the output parameter, the resulting
string is limited to the maximally defined length the BIE bit is set to &quot; 0 &quot; .
• The parameters can only be assigned with a symbolically defined variable.
FC 307 CONCAT
STRING ⎯ IN1

RET_VAL ⎯ STRING

STRING ⎯ IN2

Inputs
Identifier/data type
IN[1...2]

Information/possible settings
STRING

Input string 1...2

Outputs
Identifier/data type
RET_VAL

8.13

Information/possible settings
STRING

Combined string

SFB4 TON IEC_TC
This is a Siemens system function block for generating a switch-on delay.

8.14

SFB52 RDREC DP
This is a Siemens system function block for reading a data set.



Note!
When this block is used, you have to observe the maximally possible number of calls that
can be used in parallel. Depending on the Siemens-CPU used, a different number of calls
is possible. More information can be found in the technical data of the Siemens-CPU.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

111

The LenzeDriveCommunication library - accessing parameters
SFB53 WRREC
________________________________________________________________

8.15

SFB53 WRREC
This is a Siemens system function block for writing a data set.



Note!
When this block is used, you have to observe the maximally possible number of calls that
can be used in parallel. Depending on the Siemens-CPU used, a different number of calls
is possible. More information can be found in the technical data of the Siemens-CPU.

8.16

Error information (wErrorCode)
Error code

Explanation

Additional
info

0x0000

Impermissible parameter
numbers

Access to non-available parameters

-

0x0001

Parameter value cannot be
changed

Change access to a non-changeable parameter value Subindex

0x0002

Lower or upper value limit
exceeded

Change access with value outside the value limits

Subindex

0x0003

Incorrect subindex

Access to non-available subindex

Subindex

0x0004

No array

Access with subindex to non-indexed parameter

-

0x0005

Wrong data type

Change access with value which does not match the data type of the parameter

0x0006

No setting permitted (can only be Change access with non-zero value where not
reset)
permitted

Subindex

0x0007

Description element cannot be
changed

Change access to a non-changeable description
element

Subindex

0x0008

Reserved

(PROFIdrive profile V2: PPO-Write required in the IR
not available)

-

0x0009

Description data not available

Access to non-available description (parameter value is available)

0x000A

Reserved

(PROFIdrive profile V2: Wrong access group)

-

0x000B

No operating authorisation

Change access in case operating authorisation is
missing

-

0x000C

Reserved

(PROFIdrive profile V2: Wrong password)

-

0x000D

Reserved

(PROFIdrive profile V2: Text cannot be read in cyclic
traffic)

-

0x000E

Reserved

(PROFIdrive profile V2: Name cannot be read in cyclic traffic)

0x000F

No text array available

Access to non-available text array (parameter value
is available)

-

0x0010

Reserved

(PROFIdrive profile V2: PPO-Write is missing)

-

0x0011

Job cannot be executed due to
operating status

Access is not possible due to temporary reasons not
further specified

-

0x0012

Reserved

(PROFIdrive profile V2: Other error)

-

0x0013

112

Description

Reserved

(PROFIdrive profile V2: Date cannot be read in cyclic
traffic)

-

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDriveCommunication library - accessing parameters
Error information (wErrorCode)
________________________________________________________________

Error code

Description

Explanation

Additional
info

0x0014

Value is impermissible

Change access with value which is within the value
limits but is impermissible due to other permanent
reasons (parameter with defined individual values)

Subindex

0x0015

Response too long

The length of the current response exceeds the
maximally transferable length

-

0x0016

Impermissible parameter
address

Impermissible or not supported values for attribute, number of subindexes, parameter number or
subindex or a combination

0x0017

Impermissible format

Write request: impermissible or not supported
format of the parameter data

0x0018

Number of values not consistent Write request: Number of values of the parameter
data does not match the number of subindexes in
the parameter address

-

0x0019

Reserved

-

-

Manufacturer-specific

-

-

-

...
0x0064
0x0065
...
0x00FF

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

113

The LenzeDataConversion library - convert data
Overview of the functions and function blocks
________________________________________________________________

9

The LenzeDataConversion library - convert data
This library contains the function blocks and functions for converting data.

9.1

Overview of the functions and function blocks
The functions and function blocks of the LenzeDataConversion library are divided into the following
groups:
Bit operations:
Providing individual bits from bigger data types
FC206 DAC_GetBitOfByte - conversion block ( 115)
FC207 DAC_GetBitOfWord - conversion block ( 116)
FC208 DAC_GetBitOfDWord - conversion block ( 117)
FC209 DAC_SetBitOfByte - bit operation ( 118)
FC210 DAC_SetBitOfWord - bit operation ( 119)
FC211 DAC_SetBitOfDWord - bit operation ( 120)
FC212 DAC_ResetBitOfByte - bit operation ( 121)
FC213 DAC_ResetBitOfWord - conversion block ( 122)
FC214 DAC_ResetBitOfDWord - conversion block ( 123)
Bit splitter:
Converting bits into other data types
FB200 DAC_ByteToBits - bit demultiplexer ( 124)
FB201 DAC_WordToBits - bit demultiplexer ( 124)
FB202 DAC_DWordToBits - bit demultiplexer ( 125)
FC203 DAC_BitsToByte - bit multiplexer ( 125)
FC204 DAC_BitsToWord - bit multiplexer ( 126)
FC205 DAC_BitsToDWord - bit multiplexer ( 126)
Type converter:
Converting bytes/words into other data types.
FB203 DAC_DWordTo2Words - type converter ( 127)
FB204 DAC_DWordTo4Bytes - type converter ( 128)
FB205 DAC_WordTo2Bytes - type converter ( 129)
FC215 DAC_2BytesToWord - type converter ( 130)
FC216 DAC_2WordsToDWord - type converter ( 131)
FC217 DAC_4BytesToDWord - type converter ( 132)
[9-1]

The LenzeDataConversion library in »STEP 7«

• The initials &quot; FBxxx &quot; indicate function blocks.
• The initials &quot; FCxxx &quot; indicate functions.

114

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDataConversion library - convert data
FC206 DAC_GetBitOfByte - conversion block
________________________________________________________________

9.2

FC206 DAC_GetBitOfByte - conversion block
Function library:

LenzeDataConversion

This function returns the state of an individual bit value as a &quot; BYTE &quot; value.
DAC_GetBitOfByte
⎯ EN
BYTE ⎯ byInput

ENO ⎯
RET_VAL ⎯ BOOL

BYTE ⎯ byBitNr

Inputs
Identifier/data type
byInput
byBitNr

Information/possible settings
BYTE
BYTE

Input signal
Number of (0...7) the bit of byInput, the status of which is to be determined.

Output
Identifier/data type
RET_VAL

Information/possible settings
New value of &quot; BOOL &quot; type which results from the respective input signal.
BOOL TRUE
The return value is &quot; TRUE &quot; if the bit indicated at the input has the
&quot; TRUE &quot; value.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

115

The LenzeDataConversion library - convert data
FC207 DAC_GetBitOfWord - conversion block
________________________________________________________________

9.3

FC207 DAC_GetBitOfWord - conversion block
Function library:

LenzeDataConversion

This function returns the status of an individual bit within a &quot; WORD &quot; value.
DAC_GetBitOfWord
⎯ EN
WORD ⎯ wInput

ENO ⎯
RET_VAL ⎯ BOOL

BYTE ⎯ byBitNr

Inputs
Identifier/data type

Information/possible settings

wInput

Input signal

byBitNr

WORD
BYTE

Number (0...15) of the bit of dwInput, the status of which is to be determined.

Output
Identifier/data type
RET_VAL

116

Information/possible settings
BOOL

Output signal
• TRUE if the respective bit of wInput is TRUE.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDataConversion library - convert data
FC208 DAC_GetBitOfDWord - conversion block
________________________________________________________________

9.4

FC208 DAC_GetBitOfDWord - conversion block
Function library:

LenzeDataConversion

This function returns the status of an individual bit value within a &quot; DWORD &quot; value.
DAC_GetBitOfDWord
⎯ EN
DWORD ⎯ dwInput

ENO ⎯
RET_VAL ⎯ BOOL

BYTE ⎯ byBitNr

Inputs
Identifier/data type
dwInput
wBitNr

Information/possible settings
DWORD
BYTE

Input signal
Number (0...31) of the bit of dwInput, the status of which is to be determined.

Output
Identifier/data type
RET_VAL

Information/possible settings
BOOL

Output signal
• TRUE if the respective bit of dwInput is &quot; TRUE &quot; .

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

117

The LenzeDataConversion library - convert data
FC209 DAC_SetBitOfByte - bit operation
________________________________________________________________

9.5

FC209 DAC_SetBitOfByte - bit operation
Function library:

LenzeDataConversion

This function sets an individual bit to &quot; 1 &quot; within a value of the &quot; BYTE &quot; type.
DAC_SetBitOfByte
⎯ EN

ENO ⎯

BYTE ⎯ byInput

RET_VAL ⎯ BYTE

BYTE ⎯ byBitNr

Inputs
Identifier/data type
byInput
byBitNr

Information/possible settings
BYTE
BYTE

Input signal
Number (0 ... 7) of the bit that is to be set.

Output
Identifier/data type
RET_VAL

118

Information/possible settings
BYTE

Output signal
• Value of the &quot; BYTE &quot; data type which results from the bit set.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDataConversion library - convert data
FC210 DAC_SetBitOfWord - bit operation
________________________________________________________________

9.6

FC210 DAC_SetBitOfWord - bit operation
Function library:

LenzeDataConversion

This function sets an individual bit to &quot; 1 &quot; within a value of the &quot; WORD &quot; type.
DAC_SetBitOfWord
⎯ EN
WORD ⎯ wInput

ENO ⎯
RET_VAL ⎯ WORD

BYTE ⎯ byBitNr

Inputs
Identifier/data type

Information/possible settings

wInput

Input signal

byBitNr

WORD
BYTE

Number (0 ... 15) of the bit that is to be set.

Output
Identifier/data type
RET_VAL

Information/possible settings
Output signal
WORD • Value of the &quot; WORD &quot; type, which results by the bit set.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

119

The LenzeDataConversion library - convert data
FC211 DAC_SetBitOfDWord - bit operation
________________________________________________________________

9.7

FC211 DAC_SetBitOfDWord - bit operation
Function library:

LenzeDataConversion

This function sets an individual bit to &quot; 1 &quot; within a value of the &quot; DOUBLE WORD &quot; type.
DAC_SetBitOfDWord
⎯ EN
DWORD ⎯ dwInput

ENO ⎯
RET_VAL ⎯ DWORD

BYTE ⎯ byBitNr

Inputs
Identifier/data type
dwInput
byBitNr

Information/possible settings
DWORD
BYTE

Input signal
Input signal of bit 0...7

Output
Identifier/data type
RET_VAL

120

Information/possible settings
DWORD

Output signal
• Value of the &quot; DOUBLE WORD &quot; type, which results by the bit set.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDataConversion library - convert data
FC212 DAC_ResetBitOfByte - bit operation
________________________________________________________________

9.8

FC212 DAC_ResetBitOfByte - bit operation
Function library:

LenzeDataConversion

This function sets an individual bit to &quot; 0 &quot; within a value of the &quot; BYTE &quot; type.
DAC_ResetBitOfByte
⎯ EN
BYTE ⎯ byInput

ENO ⎯
RET_VAL ⎯ BYTE

BYTE ⎯ byBitNr

Inputs
Identifier/data type
byInput
byBitNr

Information/possible settings
BYTE
BYTE

Input signal
Number (0...7) of the bit that is to be set.

Output
Identifier/data type
RET_VAL

Information/possible settings
BYTE

Output signal
• Value of the &quot; BYTE &quot; data type which results from the bit set.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

121

The LenzeDataConversion library - convert data
FC213 DAC_ResetBitOfWord - conversion block
________________________________________________________________

9.9

FC213 DAC_ResetBitOfWord - conversion block
Function library:

LenzeDataConversion

This function sets an individual bit to &quot; 1 &quot; within a value of the &quot; WORD &quot; type.
DAC_ResetBitOfWord
⎯ EN

ENO ⎯

WORD ⎯ wInput

RET_VAL ⎯ WORD

BYTE ⎯ byBitNr

Inputs
Identifier/data type

Information/possible settings

wInput

Input signal

byBitNr

WORD
BYTE

Number (0 ... 15) of the bit that is to be set.

Output
Identifier/data type
RET_VAL

122

Information/possible settings
Output signal
WORD • The value results from the deleted bit.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDataConversion library - convert data
FC214 DAC_ResetBitOfDWord - conversion block
________________________________________________________________

9.10

FC214 DAC_ResetBitOfDWord - conversion block
Function library:

LenzeDataConversion

This function sets an individual bit to &quot; 0 &quot; within a value of the &quot; DWORD &quot; type.
DAC_ResetBitOfDWord
⎯ EN
DWORD ⎯ dwInput

ENO ⎯
RET_VAL ⎯ DWORD

BYTE ⎯ byBitNr

Inputs
Identifier/data type
dwInput
byBitNr

Information/possible settings
DWORD
BYTE

Input signal
Number (0 ... 31) of the bit that is to be set.

Output
Identifier/data type
RET_VAL

Information/possible settings
DWORD

Output signal
• The value results from the deleted bit.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

123

The LenzeDataConversion library - convert data
FB200 DAC_ByteToBits - bit demultiplexer
________________________________________________________________

9.11

FB200 DAC_ByteToBits - bit demultiplexer
Function library:

LenzeDataConversion

This FB outputs the individual bit values for one input value of the &quot; BYTE &quot; type.
DAC_ByteToBits
⎯ EN

ENO ⎯

BYTE ⎯ byInput

xBit[0...7] ⎯ BOOL

Inputs
Identifier/data type
byInput

Information/possible settings
BYTE

Input signal

Outputs
Identifier/data type
xBit[0...7]

9.12

Information/possible settings
BOOL

Output bit 0...7 of byInput (valency: 20...27)

FB201 DAC_WordToBits - bit demultiplexer
Function library:

LenzeDataConversion

This FB outputs the 16 corresponding bit values for an input value of the &quot; WORD &quot; type.
DAC_WordToBits
⎯ EN
WORD ⎯ wInput

ENO ⎯
xBit[0...15] ⎯ BOOL

Inputs
Identifier/data type
wInput

Information/possible settings
WORD

Input signal

Outputs
Identifier/data type

124

Information/possible settings

xBit[0...15]

Output bit 0 .. bit 15 of wInput (valency: 20..215)

BOOL

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDataConversion library - convert data
FB202 DAC_DWordToBits - bit demultiplexer
________________________________________________________________

9.13

FB202 DAC_DWordToBits - bit demultiplexer
Function library:

LenzeDataConversion

This FB outputs the 32 corresponding bit values for an input value of the &quot; DWORD &quot; type.
DAC_DWordToBits
⎯ EN

ENO ⎯

DWORD ⎯ dwInput

xBit[0...31] ⎯ BOOL

Inputs
Identifier/data type
dwInput

Information/possible settings
DWORD

Input signal

Outputs
Identifier/data type
xBit0..xBit31

9.14

Information/possible settings
BOOL

Output bit 0...31 of dwInput (valency: 20...231)

FC203 DAC_BitsToByte - bit multiplexer
Function library:

LenzeDataConversion

This FB converts eight input bits into a value of the &quot; BYTE &quot; type.
DAC_BitsToByte
⎯ EN
BOOL ⎯ xBit[0...7]

ENO ⎯
RET_VAL ⎯ BYTE

Inputs
Identifier/data type
xBit[0...7]

Information/possible settings
BOOL

Input bits 0...7

Outputs
Identifier/data type
byOutput

Information/possible settings
BYTE

Value of the &quot; BYTE &quot; type which results from the set input bits.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

125

The LenzeDataConversion library - convert data
FC204 DAC_BitsToWord - bit multiplexer
________________________________________________________________

9.15

FC204 DAC_BitsToWord - bit multiplexer
Function library:

LenzeDataConversion

This FB converts the 16 input bits into a value of the &quot; WORD &quot; type.
DAC_BitsToWord
⎯ EN

ENO ⎯

BOOL ⎯ xBit[0...15]

RET_VAL ⎯ WORD

Inputs
Identifier/data type
xBit[0...15]

Information/possible settings
BOOL

Input bits 0...15

Outputs
Identifier/data type
RET_VAL

9.16

Information/possible settings
WORD

Value of the &quot; WORD &quot; type which results from the set input bits.

FC205 DAC_BitsToDWord - bit multiplexer
Function library:

LenzeDataConversion

This FB converts 32 input bits into a value of the &quot; DWORD &quot; type.
DAC_BitsToDWord
⎯ EN
BOOL ⎯ xBit[0...31]

ENO ⎯
RET_VAL ⎯ DWORD

Inputs
Identifier/data type
xBit0..xBit31

Information/possible settings
BOOL

Input bits 0...31

Outputs
Identifier/data type
RET_VAL

126

Information/possible settings
DWORD

Value of the &quot; DOUBLE WORD &quot; type which results from the set input bits.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDataConversion library - convert data
FB203 DAC_DWordTo2Words - type converter
________________________________________________________________

9.17

FB203 DAC_DWordTo2Words - type converter
Function library:

LenzeDataConversion

This FB converts an input value of the &quot; DOUBLE WORD &quot; type into two output values of the &quot; WORD &quot;
type.
DAC_DWordTo2Words
⎯ EN
DWORD ⎯ dwInput

ENO ⎯
wOutput1 ⎯ WORD
wOutput2 ⎯ WORD

Inputs
Identifier/data type
dwInput

Information/possible settings
DWORD

Input value

Outputs
Identifier/data type

Information/possible settings

wOutput1

Output value 1 ≡ bit 0...15 of dwInput

wOutput2

WORD
WORD

Output value 2 ≡ bit 16...31 of dwInput

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

127

The LenzeDataConversion library - convert data
FB204 DAC_DWordTo4Bytes - type converter
________________________________________________________________

9.18

FB204 DAC_DWordTo4Bytes - type converter
Function library:

LenzeDataConversion

This FB converts an input value of the &quot; DWORD &quot; type into four output values of the &quot; BYTE &quot; type.
DAC_DWordTo4Bytes
⎯ EN

ENO ⎯

DWORD ⎯ dwInput

byOutput[1...4] ⎯ BYTE

Inputs
Identifier/data type
dwInput

Information/possible settings
DWORD

Input value

Outputs
Identifier/data type
byOutput1
byOutput2
byOutput3
byOutput4

128

Information/possible settings
BYTE
BYTE
BYTE
BYTE

Output value 1 ≡ bit 0...7 of dwInput
Output value 2 ≡ bit 8...15 of dwInput
Output value 3 ≡ bit 16...23 of dwInput
Output value 4 ≡ bit 24...31 of dwInput

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDataConversion library - convert data
FB205 DAC_WordTo2Bytes - type converter
________________________________________________________________

9.19

FB205 DAC_WordTo2Bytes - type converter
Function library:

LenzeDataConversion

This FB converts an input value of the &quot; WORD &quot; type into two output values of the &quot; BYTE &quot; type.
DAC_WordTo2Bytes
⎯ EN
WORD ⎯ wInput

ENO ⎯
byOutput[1...2] ⎯ BYTE

Inputs
Identifier/data type
wInput

Information/possible settings
WORD

Input value

Outputs
Identifier/data type
byOutput1
byOutput2

Information/possible settings
BYTE
BYTE

Output value 1: bit 0...7 of wInput
Output value 2: bit 8...15 of wInput

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

129

The LenzeDataConversion library - convert data
FC215 DAC_2BytesToWord - type converter
________________________________________________________________

9.20

FC215 DAC_2BytesToWord - type converter
Function library:

LenzeDataConversion

This function converts two input values of the &quot; BYTE &quot; type into an output value of the &quot; WORD &quot; type.
DAC_2BytesToWord
⎯ EN
BYTE ⎯ byInput1

ENO ⎯
RET_VAL ⎯ WORD

BYTE ⎯ byInput2

Inputs
Identifier/data type
byInput1
byInput2

Information/possible settings
BYTE
BYTE

Input value 1 ≡ bit 0...7
Input value 2 ≡ bit 8...15

Outputs
Identifier/data type

130

Information/possible settings

RET_VAL

Value of the &quot; WORD &quot; type according to the transferred input values.

WORD

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

The LenzeDataConversion library - convert data
FC216 DAC_2WordsToDWord - type converter
________________________________________________________________

9.21

FC216 DAC_2WordsToDWord - type converter
Function library:

LenzeDataConversion

This function converts two input values of the &quot; WORD &quot; type into an output value of the &quot; DWORD &quot;
type.
DAC_2WordsToDWord
⎯ EN
WORD ⎯ wInput1

ENO ⎯
RET_VAL ⎯ DWORD

WORD ⎯ wInput2

Inputs
Identifier/data type

Information/possible settings

wInput1

Input value 1 ≡ bit 0...15

wInput2

WORD
WORD

Input value 2 ≡ bit 16...31

Outputs
Identifier/data type
RET_VAL

Information/possible settings
DWORD

Value of the &quot; DOUBLE WORD &quot; type according to the transferred input values.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

131

The LenzeDataConversion library - convert data
FC217 DAC_4BytesToDWord - type converter
________________________________________________________________

9.22

FC217 DAC_4BytesToDWord - type converter
Function library:

LenzeDataConversion

This function converts four input values of the &quot; BYTE &quot; type into a value of the &quot; DWORD &quot; type.
DAC_4BytesToDWord
⎯ EN

ENO ⎯

BYTE ⎯ byInput1

RET_VAL ⎯ DWORD

BYTE ⎯ byInput2
BYTE ⎯ byInput3
BYTE ⎯ byInput4

Inputs
Identifier/data type
byInput1..4

Information/possible settings
BYTE

Input value 1...4
1 Bit 0...7
2 Bit 8...15
3 Bit 16...23
4 Bit 24...31

Outputs
Lenze4BytesToDWord - value of the &quot; DOUBLE WORD &quot; type according to the transferred input
values.
Identifier/data type
RET_VAL

132

Information/possible settings
DWORD

Value of the &quot; DWORD &quot; type according to the transferred input values.

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Index
________________________________________________________________

A

I

Application notes (representation) 8
Assignment of the FB LCB_SetAxisData 24
Assignment of the FB LCB_TablePositioning 25
Assignment of the FBs LCB_ActuatorSpeed 19

Install the Lenze libraries 40

C
Conventions used 7

D
DCO_ReadDriveArray16 97
DCO_ReadDriveArray8b 96
DCO_ReadDriveParameter 92
DCO_ReadDriveParameterString 102
DCO_R-W-n_DrivePar 108
DCO_WriteDriveArray16b 105
DCO_WriteDriveArray32b 106
DCO_WriteDriveArray8b 103
DCO_WriteDriveParameter 94, 100
Document history 6

E
E-mail to Lenze 135
Error information (wErrorCode) 112

F
FB 200 - DAC_ByteToBits - bit demultiplexer 124
FB 201 - DAC_WordToBits - bit demultiplexer 124
FB 202 - DAC_DWordToBits - bit demultiplexer 125
FB 204 - DAC_DWordTo4Bytes - type converter 128
FB 205 - DAC_WordTo2Bytes - type converter 129
FB 418 - L_LCB_TablePositioning_V3 64
FB LCB_SetAxisData - assignment 33
FB LCB_TablePositioning - assignment 34
FB203 - DAC_DWordTo2Words - type converter 127
FC 203 - DAC_BitsToByte - bit multiplexer 125
FC 204- DAC_BitsToWord 126
FC 205 - DAC_BitsToDWord - bit multiplexer 126
FC 206 - DAC_GetBitOfByte - conversion block 115
FC 207 - DAC_GetBitOfDWord 117
FC 207 - DAC_GetBitOfWord - conversion block 116
FC 208 - DAC_GetBitOfDWord - conversion block 117
FC 209 - DAC_SetBitOfByte - bit operation 118
FC 210 - DAC_SetBitOfWord - bit operation 119
FC 211 - DAC_SetBitOfDWord - bit operation 120
FC 212 - DAC_ResetBitOfByte - bit operation 121
FC 213 - DAC_ResetBitOfWord - conversion block 122
FC 214 - DAC_ResetBitOfDWord - conversion block 123
FC 215 - DAC_2BytesToWord - type converter 130
FC 216 - DAC_2WordsToDWord - type converter 131
FC 217 - DAC_4BytesToDWord - type converter 132
FC 307 - CONCAT 111
Feedback to Lenze 135

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

L
L_LCB_ActuatorSpeedV3 53
L_LCB_SetAxisData 78
L_LCB_SpeedToUnit 88
L_LCB_TablePositioning_V2 58
LCB_8400Drive12Word 76
LCB_8400Drive16Word 71
LCB_8400Drive4Word 73
LCB_8400Drive8Word 74
LCB_9400Drive 46
LCB_ActuatorSpeed_V2 48
LCB_GenericDrive 45
LCB_Norm_aToNorm_n - signal converter 83
LCB_Norm_nToNorm_a 84
LCB_Norm_nToSpeed_s 80
LCB_PosToUnit 85
LCB_Speed_nToNorm_r 84
LCB_Speed_rToNorm_n 85
LCB_Speed_sToNorm_n 81
LCB_Speed_sToSpeed_v 82
LCB_Speed_sToSpeed_v - signal converter 82
LCB_UnitToPos 86
LCB_UnitToSpeed 87
Lenze ControlBasic
Overview of the functions and function blocks 43
Lenze DataConversion
Overview of the functions and function blocks 114
Lenze function libraries 38
LenzeDataConversion.lib 114
LenzeDataConversion.lib library 40
LenzeDriveCommunication
Overview of the functions and function blocks 89
LenzeDriveCommunication library 40
LenzeDriveCommunication.lib 89
LenzeLogicControlBasic library 39
LenzeLogicControlBasic.lib 42

N
Notes used 8

S
Safety 9
SFB 4 - TON IEC_TC 111
SFB 52 - RDREC DP 111
SFB 53 - WRREC 112
SFC14 - DPRD_DAT DP 79
SFC15 - DPWR_DAT DP 79

133

Index
________________________________________________________________

T
TA &quot; Actuator Speed &quot; 14
TA &quot; Actuator Speed &quot; - Engineer sample project 15
TA &quot; TablePositioning &quot; - Engineer sample project 15
TIA Portal
1_Lenze_TA_Actuator_Speed 29
2_Lenze_TA_Table_Positioning 32
3_Lenze_Parameter_communication 36
TIA Portal sample projects 15

V
Variable table LCB_TablePos_IntVxx 34

134

Lenze · STEP 7_TIA_Lenze Application Sample · 3.0 EN - 04/2014

Your opinion is important to us
These instructions were created to the best of our knowledge
and belief to give you the best possible support for handling
our product.
If you have suggestions for improvement, please e-mail us to:
feedback-docu@Lenze.de

Thank you for your support.
Your Lenze documentation team

L

135

© 04/2014
Lenze Automation GmbH
Hans-Lenze-Str. 1
D-31855 Aerzen
Germany

Service

Lenze Service GmbH
Breslauer Straße 3
D-32699 Extertal
Germany

+49 5154 82-0

00800 02446877 (24 h helpline)

+49 5154 82-2800

+49 51 54 82-11 12

lenze@lenze.de

service@lenze.de

www.lenze.com
SHPENGS7APPSAM 13456363 EN 3.0 TD11
10

9

8

7

6

5

4

3

2

1