s7300 fm351 Operating Instructions en en-US
s7300 fm351 Operating Instructions en en-US
Preface
___________________
Product overview 1
___________________
Basics of positioning 2
SIMATIC Installing and removing the
___________________
FM 351 3
S7-300
FM 351 positioning module ___________________
Wiring the FM 351 4
Installing the configuration
___________________
package 5
Operating Instructions
___________________
Programming the FM 351 6
___________________
Commissioning the FM 351 7
Machine data and
___________________
increments 8
___________________
Operating modes and jobs 9
___________________
Encoder 10
___________________
Diagnosis 11
___________________
Examples 12
___________________
Technical specifications A
___________________
Connection diagrams B
___________________
Data blocks and error lists C
Programming without
___________________
SFB 52 and SFB 53 D
05/2011
A5E01092700-02
Legal information
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent
damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert
symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are
graded according to the degree of danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
with a safety alert symbol, indicates that minor personal injury can result if proper precautions are not taken.
CAUTION
without a safety alert symbol, indicates that property damage can result if proper precautions are not taken.
NOTICE
indicates that an unintended result or situation can occur if the relevant information is not taken into account.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will
be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to
property damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific
task in accordance with the relevant documentation, in particular its warning notices and safety instructions.
Qualified personnel are those who, based on their training and experience, are capable of identifying risks and
avoiding potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must be recommended
or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and
maintenance are required to ensure that the products operate safely and without any problems. The permissible
ambient conditions must be complied with. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication
may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software
described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the
information in this publication is reviewed regularly and any necessary corrections are included in subsequent
editions.
Preface
Standards
The SIMATIC S7-300 product series fulfills the requirements and criteria of IEC 61131-2.
Additional support
If you have any further questions about the use of products described in this manual and do
not find the right answers here, contact your local Siemens representative
(http://www.siemens.com/automation/partner):
A guide to the technical documentation for the various products and systems is available on
the Internet:
● SIMATIC Guide manuals (http://www.siemens.com/simatic-tech-doku-portal)
The online catalog and online ordering systems are also available on the Internet:
● A&D Mall (http://www.siemens.com/automation/mall)
Training center
To help you get started with automation technology and systems, we offer a variety of
courses. Contact your regional Training Center or the central Training Center in D-90327
Nuremberg, Germany.
● Internet: SITRAIN homepage (http://www.sitrain.com)
Technical Support
You can access technical support for all A&D projects via the following:
● Online support request form: (http://www.siemens.com/automation/support-request)
Preface ...................................................................................................................................................... 3
1 Product overview ....................................................................................................................................... 9
1.1 FM 351 positioning module............................................................................................................9
1.2 Application areas of the positioning module ................................................................................10
1.3 Structure of a controlled positioning using an FM 351 ................................................................11
2 Basics of positioning ................................................................................................................................ 15
2.1 Controlled positioning ..................................................................................................................15
2.2 Ranges and switching points of the positioning module..............................................................16
3 Installing and removing the FM 351 ......................................................................................................... 19
4 Wiring the FM 351 ................................................................................................................................... 21
4.1 Important safety information ........................................................................................................21
4.2 Description of the encoder interface ............................................................................................22
4.3 Connecting encoders ...................................................................................................................23
4.4 Description of the front connector ................................................................................................24
4.5 Wiring the power section..............................................................................................................27
4.6 Wiring Front Connectors ..............................................................................................................30
5 Installing the configuration package......................................................................................................... 33
6 Programming the FM 351 ........................................................................................................................ 35
6.1 Overview of the Programming section.........................................................................................35
6.2 Basics of programming a positioning module ..............................................................................36
6.3 FC ABS_INIT (FC 0) ....................................................................................................................38
6.4 FB ABS_CTRL (FB 1) ..................................................................................................................39
6.5 FB ABS_DIAG (FB 2)...................................................................................................................46
6.6 Data blocks ..................................................................................................................................48
6.6.1 Templates for data blocks............................................................................................................48
6.6.2 Channel DB..................................................................................................................................48
6.6.3 Diagnostic DB ..............................................................................................................................49
6.6.4 Parameter DB ..............................................................................................................................49
6.7 Technical specifications of the FCs, FBs, and DBs for the FM 351 ............................................50
6.8 Quicker access to module data....................................................................................................51
6.9 Parameter transmission paths .....................................................................................................53
11 Diagnosis............................................................................................................................................... 137
11.1 Possibilities of error display and error evaluation ......................................................................137
11.2 Types of error.............................................................................................................................138
11.2.1 Synchronous errors....................................................................................................................138
11.2.2 Asynchronous errors..................................................................................................................138
11.3 Meaning of the error LEDs.........................................................................................................139
11.4 Error display with OP .................................................................................................................140
11.5 Error evaluation in the user program .........................................................................................141
11.6 Diagnostics buffer of the module ...............................................................................................146
11.7 Diagnostics interrupts ................................................................................................................147
12 Examples............................................................................................................................................... 151
12.1 Introduction ................................................................................................................................151
12.2 Requirements.............................................................................................................................151
12.3 Prepare examples......................................................................................................................152
12.4 Example codes...........................................................................................................................152
12.5 Testing an example....................................................................................................................153
12.6 Continuing to use an example ...................................................................................................153
12.7 Example program 1 "FirstSteps"................................................................................................154
12.8 Example program 2 "Commissioning" .......................................................................................156
12.9 Example program 3 "AllFunctions" ............................................................................................158
12.10 Example program 4 "OneChannel"............................................................................................160
12.11 Example program 5 "DiagnosticsAndInterrupts"........................................................................163
12.12 Example program 6 "SeveralChannels" ....................................................................................165
A Technical specifications......................................................................................................................... 167
A.1 General Technical Specifications ..............................................................................................167
A.2 Technical Specifications of the FM 351 .....................................................................................168
B Connection diagrams............................................................................................................................. 173
B.1 Overview ....................................................................................................................................173
B.2 Connection diagram for incremental encoder Siemens 6FX 2001-2 (Up=5V; RS 422) ............174
B.3 Connection diagram for incremental encoder Siemens 6FX 2001-2 (Up=24V; RS 422) ..........175
B.4 Wiring diagram of the incremental encoder Siemens 6FX 2001-4 (Up = 24 V; HTL) ...............176
B.5 Connection diagram for absolute encoder Siemens 6FX 2001-5 (Up=24V; SSI) .....................177
3*3& &RQILJXUDWLRQSDFNDJHFRQWDLQLQJWKH
SDUDPHWHUDVVLJQPHQWVFUHHQV
EORFNVDQGPDQXDO
6
&38ZLWKXVHUSURJUDPDQG
EORFNVRI)0
)0
Overview
● Packaging machines
● Lifting and conveying equipment
● Woodworking machinery
Example: Controlling delivery processes
Various wooden parts are processed using a profiling machine. Various work processes
and, with that, different cutting heads, are required to machine the wood. The various
cutting heads are exchanged by means of a controlled positioning process.
● Paper making machines and printing machines
● Rubber and plastics processing machines
Example: Simply handling processes
The injection molded parts in an injection molding machine are removed from the work
piece by means of a gripper arm. The gripper arm is controlled by the positioning module.
● Building materials industry
● Machine tools
Control circuit
The following figure shows the components of a controlled positioning using rapid
traverse/creep speed drives.
/LQHVXSSO\
(0(5*(1&<
)0SRVLWLRQ &38
6723VZLWFK
LQJPRGXOH
6DIHW\ 3RZHU
GHYLFH VHFWLRQ
3&3*
0DFKLQLQJVWDWLRQV
0RWLRQ
0 (QFRGHU
0RWRU 0HFKDQLFDO
WUDQVPLVVLRQ
HOHPHQWV +DUGZDUHOLPLW
VZLWFKHV
&RQILJXUDWLRQSDFNDJHFRQWDLQLQJ
WKHSDUDPHWHUDVVLJQPHQW
VFUHHQVEORFNVDQGPDQXDO
Motor
The motor is controlled by the power section and it drives the axes.
Encoder
The encoder provides distance and direction information. The following encoders can be
connected:
● Incremental encoders with 5 V differential signal, symmetrical
● Incremental encoders with 24 V signal, asymmetrical
● SSI absolute encoder
CPU
The CPU executes the user program. Data and signals are exchanged between the user
program and the module by means of function calls.
Programming device or PC
The programming device or PC is used for
● Assigning parameters:
You use either the parameter assignment screens or the parameter DB to assign
parameters for the FM 351 (refer to the section entitled "Content of the parameter DB
(Page 184)").
● Programming:
You program the FM 351 with functions that you can integrate directly in the user
program.
● Testing and commissioning:
You test and commission the FM 351 with the help of the parameter assignment screens.
● System environment:
– Centralized application
SIMATIC S7-300, from CPU 314 (recommendation: Depends on user memory
requirement of the application)
SIMATIC C7
– Distributed use with ET 200M
● System integration:
– Module exchange possible without PG
– Teleservice possible
Controlled positioning
Each positioning process is characterized by
● A start position
● The target of the positioning
● Parameters that determine the sequence of the positioning
The target is initially approached at a higher velocity (rapid traverse). At a specified distance
from the target, the velocity switches to creep speed. The drive is switched off shortly before
the axis reaches the target - also at a specified distance from the target. In doing so, the
module monitors the target approach.
The drive is controlled via digital outputs with rapid traverse or creep speed and in the
appropriate direction.
Target
The target is the absolute or relative position on the axis that is approached during a
positioning process.
Range Description
Operating range defines the area that you define for your task by means of the software limit
switches and the end of the rotary axis.
Changeover difference defines the distance from the target at which the drive changes from rapid
traverse to creep speed.
Changeover point defines the position at which the drive changes from rapid traverse to creep
speed.
Switch-off difference defines the distance from the target at which the drive is switched off.
Switch-off point defines the position at which the drive is switched off. The positioning
module then adopts the monitoring functions from this point on.
Target range defines the positioning precision for your application and surrounds the
target symmetrically.
Standstill range defines a symmetrical area around the target that will be monitored by the
positioning module.
The following figure shows how the switching points and switching differences can be
arranged for a positioning. For simplification purposes, it is assumed that the actual velocity
changes linearly over the distance traversed. The emerging ramps can be explained by
mechanical inertia or by the parameter assignment possibilities of the power section.
YUDSLG
$FWXDOYHORFLW\
YFUHHS
'LVWDQFH
&KDQJHRYHUGLIIHUHQFH
6ZLWFKRII
GLIIHUHQFH
The following figure shows how the switching ranges can be arranged around the target.
6RIWZDUHOLPLWVZLWFKVWDUW 7DUJHW 6RIWZDUHOLPLWVZLWFKHQG
① Operating range
② Changeover difference in plus traversing direction
③ Changeover difference in minus traversing direction
④ Switch-off difference in plus traversing direction
⑤ Switch-off difference in minus traversing direction
⑥ Standstill range
⑦ Target range
Establish slots
The FM 351 can be fitted at any slot for signal modules on the mounting rail.
Tools required
You will need a 4.5 mm screwdriver to install or remove the FM 351.
;&+
FKDQQHO
;&+
FKDQQHO
)0
Refer to the section entitled "Wiring diagram of the incremental encoder Siemens
1)
Procedure
1. Connecting the connecting cable to the encoder.
With some encoders it may be necessary to adapt the cable (cable end to the encoder) in
accordance with the manufacturer´s instructions.
2. The encoder cables must be shielded.
Cables A and /A, B and /B, N and /N for the incremental encoder and the cables DAT and
/DAT, CLS and /CLS for the absolute encoder must be twisted in pairs.
3. Open the front door and insert the sub D connector onto the FM 351.
4. Secure the connector by tightening the finger screws. Close the front door.
5. Remove the insulation material on the connecting cable and clamp the cable shield into
the shield connection element. Use the shield terminal elements for this.
)URQWFRQQHFWRU;
6KLHOGFRQQHFWLRQHOHPHQW
Front connector
You use the 20-pin front connector to connect the supply voltages of the encoder and the
digital outputs. The digital outputs and inputs assigned to the channels are also connected.
Power section
The power section, e.g. a simple contactor circuit, is connected to the digital outputs of the
positioning module and controls the motor.
Contactor circuit
The following figure shows the control and load circuit of a power section.
The functions of the digital outputs correspond to control mode 1(refer to the section entitled
"Machine data of the drive (Page 67)").
&RQWUROFLUFXLW /RDGFLUFXLW
// /
'LJLWDORXWSXWVRIWKH)0
. .
( (
1&
. . . .
FRQWDFW
RI
0
0
3ROHFKDQJLQJPRWRU
K1 Direction - plus
K2 Direction - minus
K3 Rapid traverse
K4 Creep speed
E1 Hardware limit switch minus
E2 Hardware limit switch plus
CAUTION
Note
Direct connection of inductances, e.g, of relays and contactors, is possible without an
external protective circuit.
If SIMATIC output circuits can be switched off by means of additionally installed contacts,
e.g. relay contacts, additional overvoltage protection devices must be provided for
inductances. See the following example of overvoltage protection
'LJLWDORXWSXWRIWKH)0 'LJLWDORXWSXWRIWKH)0
HJ4 HJ4
&RQWDFWLQRXWSXWFXUUHQWFLUFXLW
ZLWKGLRGH ZLWK=GLRGH
Connecting cables
● As of 100 m cable lengths, the cables for digital inputs and outputs must be shielded.
● The shields of the cables must be arranged on both sides.
● Flexible cable, cross section 0.25 to 1.5 mm2
● Ferrules are not required. If you do however want to use them, you can use ferrules
without insulating collars (DIN 46228, Form A, short design).
Tools required
3.5 mm screwdriver or power screwdriver
Procedure
WARNING
Non-isolation
The ground of the auxiliary voltage for the encoder supply is electrically isolated from the
CPU ground. For downward compatibility with FM 351 with order number 6ES7351-1AH01-
0AE0, the ground of the auxiliary voltage for the encoder supply (1M) can be connected with
the CPU ground (M).
&38[[ )0
7HUPLQDO0
0
/
0
*URXQG
&RQILJXUDWLRQ
SDFNDJH
([DPSOHV %ORFNOLEUDU\
*HWWLQJ6WDUWHG
Procedure
The entire configuration package can be located on the supplied CD.
1. De-install any already existing configuration packages.
2. Place the CD in the CD drive of your PC or PG.
3. Start Setup.exe and follow the step-by-step setup instructions displayed by the
installation program.
Result
The components of the configuration package are installed in the following directories:
● SIEMENS\STEP7\S7LIBS\FMx51LIB: FCs, FBs, and UDTs
● SIEMENS\STEP7\S7FABS: configuration software, Readme, online help
● SIEMENS\STEP7\EXAMPLES: Examples
● SIEMENS\STEP7\S7MANUAL\S7FABS: Getting Started, manuals
Note
If, when installing STEP 7, you chose a directory other than SIEMENS\STEP7, then this
directory will be entered.
If your CPU supports the system blocks SFB 52 and SFB 53 with DPV1 functionality
Then use the blocks from the program folder "FM 351 ABS V2" in the supplied block library
to program the FM 351.
In addition to centralized use in the S7-300, these blocks also support distributed use with
PROFINET and PROFIBUS DP.
You will find a description in this section.
If your CPU does not support the system blocks SFB 52 and SFB 53 with DPV1 functionality
Then use the blocks from the program folder "FM 351,451 ABS V1" to program the FM 351.
For a description, please refer to the appendix entitled "Programming without SFB 52 and
SFB 53 (Page 201)".
Task
You can assign parameters, control, and commission each channel of the positioning
module via a user program. The following sections illustrate how to design a user program to
suit your application.
Preparation
1. Open the block library FMx51LIB in SIMATIC Manager, then copy the required functions
(FCs), function blocks (FBs), and block templates (UDTs) to the block container of your
project. If the block numbers are already assigned, assign new numbers. The block
names are entered unchanged in the symbol table of your S7 program.
Name Meaning
FC ABS_INIT (FC 0) You need this FC to initialize the channel DB following a
module startup.
FB ABS_CTRL (FB 1) You need this FB for data exchange and for controlling
FB ABS_DIAG (FB 2) You need this FB when you process detailed diagnostic
information in the program or want to make this information
available to an operator control and monitoring system
UDT ABS_CHANTYPE(UDT 1) You need this UDT to create a channel DB for each channel;
this is then used by the FC ABS_INIT and FB ABS_CTRL
UDT ABS_DIAGTYPE (UDT 2) You need this UDT to create a diagnostic DB for each
module; this is then used by the FB ABS_DIAG
UDT ABS_PARATYPE(UDT 3) You need this UDT to create a parameter DB with
parameters; this is then used by the FB ABS_CTRL in order to
write or read machine data and increment tables
2. Create the data blocks (DBs) using the UDTs in the block container of your S7 program:
– a separate channel DB for each channel.
– If you want to write or read parameters using the user program, you need a separate
parameter DB for each channel.
– If you would like to execute the diagnostics using the user program, you require only a
diagnostic DB for each module.
3. Enter the module address in the associated channel DB and, if necessary, also in the
corresponding diagnostic DB at the "MOD_ADDR" address (refer to the section entitled
Basics of programming a positioning module (Page 202)).
4. Enter the channel number and, if necessary, the number of the parameter DB also in the
respective channel DB.
If your programing device or PC is connected to a CPU, you can now download the blocks to
the CPU.
The following figure shows you how the positioning module, FCs, DBs and OBs
communicate with each other.
)&$%6B,1,7 )%$%6B&75/
-REV
)XQFWLRQVZLWFKHV
&RQWUROVLJQDOV
'%B12 '%B12 )HHGEDFNVLJQDOV
&KDQQHO'%
&KDQQHO'%
3$5$'%12
3DUDPHWHU'%
)%$%6B',$*
'LDJQRVWLFVEXIIHU
'%B12
'LDJQRVWLF'%
*) The module address (channel DB/diagnostic DB) entered in the "MOD_ADDR" parameter is
used for accessing the module. We recommend you assign the module address to the channel
DB/diagnostic DB in the user program so that the assignment of the module address takes
place when you call the user program in OB 100.
Figure 6-1 Data exchange between FCs, FBs, DBs and positioning module
Task
The FC ABS_INIT deletes the following data in the channel DB:
● The control signals
● The checkback signals
● The trigger bits, done bits, and error bits of the jobs
● The function switches and their done bits and error bits
● The job management for the FB ABS_CTRL
Call
The function must be executed for each channel after a startup, i.e., after the power supply
to the module or CPU is switched on. Call the function, for example, in the start-up OB 100
and the insertion/removal OB 83 or the initialization phase of your user program. This
ensures that your user program does not access obsolete data after a CPU or module
restart.
Call parameters
Return values
The specified function does not supply a return value.
Tasks
With the FB ABS_CTRL you can read the operating data for each channel of the module,
assign channel parameters, and control the operation. For these tasks, you use control
signals, checkback signals, function switches, and write and read jobs.
Each time it is called, the function block performs the following actions:
● Reading checkback signals:
The FB ABS_CTRL reads all the checkback signals for a channel and enters them in the
channel DB. Because the control signals and jobs are not executed until after this step,
the checkback signals reflect the status of the channel before the block was called.
● Job management:
The FB ABS_CTRL processes the read and write jobs and transmits data between the
channel DB, parameter DB, and the module.
● Writing control signals:
The control signals written to the channel DB are transferred to the module.
Call
The FB ABS_CTRL must be called cyclically for each channel, e.g., in OB 1.
Before you call the FB ABS_CTRL, enter all the data needed to execute the required
functions into the channel DB.
Call parameters
Return values
The function provides the following return values:
RETVAL BR Description
1 1 At least 1 job is active
0 1 No job is active, no error
-1 0 Error: data error (DATA_ERR) or
communication error (JOB_ERR) occurred
Jobs
Data exchange with the module other than the control and checkback signals is handled
using jobs.
To deliver a job you set the respective trigger bit in the channel DB and in the case of write
jobs also the respective data. You then call FB ABS_CTRL to execute the job.
If you are using the FM 351 centrally, a read job requires exactly one cycle. If you are using
the FM 351 as a distributed module, a read job can require several cycles.
On account of the necessary acknowledgements of the module, a write job requires at least
3 calls or OB cycles.
When a job is finished, the block takes back the trigger bit. The next time the block is called,
the subsequent job is identified and executed.
For each job, there is not only a trigger bit (extension _EN as in "enable") but also a done bit
and an error bit. These have the extension _D as in "done" and _ERR as in "error" in their
names. The FB ABS_CTRL updates the done bits and error bits once the processing of a job
has ended. After the evaluation or prior to issuing a job, these bits should be set to 0.
If you set the JOBRESET bit, all the done and error bits are reset before the queued jobs are
processed. The JOBRESET bit is then reset to 0.
Function switch
The function switches activate and deactivate the states of the channel. A job for writing the
function switches will only be executed when there is a change in a switch setting. The
setting of the function switch is latched after the job has been executed.
Function switches and jobs can be used at the same time in one FB ABS_CTRL call.
As in the case of the jobs, alongside the function switches there are trigger bits with the
ending _ON / _OFF, done bits with the ending _D and error bits with the ending _ERR.
To be able to evaluate the done bits and error bits of the function switches, you should set
these bits to 0 before you issue a job to change a function switch.
This order enables you to initiate a complete positioning operation with a set of jobs and
control signals. The jobs start with the writing and activating of machine data, and continue
with the setting of the external enable input and, finally, the writing of increments for the
incremental approaches.
Control signals
If there is a STOP signal, an operator error or a drive enable is missing, the block resets the
control signals START, DIR_M and DIR_P.
You can restart a motion after you have acknowledged the operator error with
OT_ERR_A=1. With this acknowledgement you cannot submit any other jobs and control
signals.
If there is no operator error pending, the block sets the acknowledgement for the operator
error OT_ERR_A to 0.
The block resets the START, DIR_P, and DIR_M start signals when the channel signals the
start of the motion, except in "jog" mode.
If the axis parameters are not assigned, the block withholds all the control signals with the
exception of the OT_ERR_A operator error acknowledgement.
Startup
Call FC ABS_INIT at the startup of the module or CPU (refer to the section entitled "FC
ABS_INIT (FC 0) (Page 38)"). Among other things, this resets the function switches. The FB
ABS_CTRL acknowledges the module startup. During this time, RETVAL and JOBBUSY = 1.
Job status
You can check the status of job execution using the RETVAL return value and the JOBBUSY
activity bit in the channel DB. The status of an individual job can be evaluated using the
trigger bits, done bits, and error bits of this job.
RETVAL JOBBUSY Trigger bit _EN Done bit _D Error bit _ERR
Job active 1 1 1 0 0
Job completed 0 0 0 1 0
without errors
Job completed -1 0 0 1 1
with errors
Write job -1 0 0 0 1
cancelled
Response to errors
If faulty data are written during a write job, the channel issues the checkback signal
DATA_ERR = 1 to the channel DB. If an error occurs during communication with the module
in a write or read job, the cause of error is stored in the JOB_ERR parameter in the channel
DB.
● Error with a write job:
If an error occurs in a job, the trigger bit is canceled and error bit _ERR and done bit _D
are set. The trigger bit is also canceled for all write jobs still pending, but only error bit
_ERR is set. The pending write jobs are canceled because jobs could pile up in this case.
The pending read jobs will continue to be processed. JOB_ERR is reset again for each
job.
● Error with a read job:
If an error occurs in a job, the trigger bit is canceled and error bit _ERR and done bit _D
are set.
The read jobs still pending continue to be processed. JOB_ERR is reset again for each
job.
For further error information, refer to the JOB_ERR and DATA_ERR parameter descriptions
(sections entitled "Diagnosis (Page 137)" and "Data and structure of the diagnostic DB
(Page 186)").
Program structure
The following figure shows the basic structure of a user program used to cyclically control a
channel of a module following a one-time startup initialization. The RETVAL return value of
the FB ABS_CTRL is used in the user program for a general error evaluation.
For every other channel a sequence in accordance with the following figure can be executed
parallel and independently.
,QLWLDOL]DWLRQ
2QHWLPHFDOO
HJ2%
&DOO)&$%6B,1,7
-REVVWLOORSHQ"
1R
6HWMREGDWDDQGMREWULJJHUELWV <HV
6HWFRQWUROVLJQDOV
&DOO)%$%6B&75/
HJ2%
&\FOLFFDOO
(YDOXDWHUHWXUQYDOXH5(79$/RI)%$%6B&75/
!
1H[WMRE
Tasks
Use FB ABS_DIAG to read the diagnostic buffer of the module and make it available for
display on an operator control and monitoring system or for a programmed evaluation.
Call
The block must be called cyclically, e.g., in OB 1. An additional call in an alarm OB is not
permitted. At least two calls (cycles) are required for a complete execution of the function.
The function reads out the diagnostic buffer when checkback signal DIAG = 1 in the channel
DB indicates a new entry in the diagnostic buffer. After the diagnostic buffer is read, the
DIAG bit in the channel DB of the module is set to 0.
Call parameters
Return values
The block returns the following return values in in word 302 in the RETVAL parameter of the
diagnostic DB:
RETVAL BR Description
1 1 Job active
0 1 No job is active, no error
-1 0 Error
Jobs
You can read the diagnostic buffer independent of a new entry by setting the trigger bit
DIAGRD_EN in the diagnostic DB. After the diagnostic buffer is read, the trigger bit is set to
0.
Carry out this job after a CPU start-up and a module start-up. This way you can ensure that
the content of the diagnostic DB corresponds with the content of the module´s diagnostic
buffer, even if the module has not made a new entry in the diagnostic buffer.
Start
The block does not perform any startup processing.
Response to errors
In the case of a faulty execution, the cause of the error can be found in the diagnostic DB in
the JOB_ERR parameter (refer to the sections entitled "Diagnosis (Page 137)" and "Data
and structure of the diagnostic DB (Page 186)").
6.6.2 Channel DB
Task
The channel DB (refer to the section entitled Content of channel DB (Page 179)) is the data
interface between the user program and the positioning module. It contains and accepts all
data required for control and operation of a channel.
Structure
The channel DB is divided into different areas:
Channel DB
Module address *)
Channel number
Number of the parameter DB
Control signals
Checkback signals
Function switch
Trigger bits for write jobs
Trigger bits for read jobs
Done bits
Error bits
Job management for functions
Data for jobs
*) You can also enter the address using the configuration software
6.6.3 Diagnostic DB
Task
The diagnostic DB (refer to the section entitled Data and structure of the diagnostic DB
(Page 186)) is the data storage for the FB ABS_DIAG and includes the diagnostic buffer of
the module that has been processed by this function block.
Structure
Diagnostic DB
Module address
Internal data
Job status
Trigger bit
Processed diagnostic buffer
6.6.4 Parameter DB
Task
If you want to change the machine data and increment tables during operation, you require a
parameter DB (refer to the section entitled Contents of parameter DB (Page 184)) in which
this data is stored. The parameters can be changed from the user program or from an
operator control and monitoring system.
You can export the data displayed in the configuration software into a parameter DB. You
can also import a parameter DB into the configuration software and view it there.
Each module channel can have several sets of parameter assignment data, e.g., for different
recipes. You can switch among these in your program.
Structure
Parameter DB
Machine data
Increment tables
6.7 Technical specifications of the FCs, FBs, and DBs for the FM 351
Technical specifications
The following table offers you an overview of the technical specifications for the functions
and data blocks.
No. Block name Version Assignment in Assignment in Assignment in local MC7 Called
load memory work memory data area code / system functions
(bytes) (bytes) (bytes) data
(bytes)
FC 0 FC ABS_INIT 1.0 184 130 2 94
FB 1 FB ABS_CTRL 1.0 4548 4176 34 4140 SFB 53: WRREC,
SFB 52: RDREC
FB 2 FB ABS_DIAG 1.0 1800 1658 42 1622 SFB 52: RDREC
Channel DB - 638 184 - 148
Parameter DB - 840 556 - 520
Diagnostic DB - 524 388 - 352
Module cycle
The checkback signals of a channel are updated by the module every 8 ms.
Application
In special applications or in an alarm level, a particularly fast access to checkback and
control signals could be required. You can reach this data directly via the input and output
areas of the module.
To coordinate startup following each module startup, e.g., after inserting a module or after
CPU STOP → RUN, you must call the FB ABS_CTRL until the end of the startup is indicated
by RETVAL = 0. Then, do not use the FB ABS_CTRL any more.
Note
It is not possible to use the FB ABS_CTRL together with a write access.
STL Description
L PED 516 Read the current actual position value (ACT_POS) from channel 1
//with direct access:
//Start address of the channel + 4
STL Description
L 2#10001000 //Set DRV_EN and DIR_P to 1
T PAB 521 //Write signals with direct access for channel 2:
//Start address of the module + 8 + 1
E
D 8VHU
3DUD
&RQILJXULQJ 3DUDPHWHU PHWHU SURJUDP
VRIWZDUH '% D
'%
E
$%6B&75/
+:&RQILJ
3DUDPHWHUV
WARNING
Setting up a project
Set up a project under STEP 7.
The following describes the sequence of steps via the SIMATIC Manager (without using the
wizards).
Step Action ✓
1 Install the configuration package (if this has not already happened). ❒
2 In SIMATIC Manager, set up a new project (File > New). ❒
3 Insert a station in your project (Insert > Station). ❒
4 Select the station, then run the "HW Config" configuration interface by double-clicking "Hardware". ❒
5 Enter your hardware structure in a subrack with: ❒
Power supply (PS) module
CPU
Function module (FM 351)
6 Save this hardware configuration in HW Config (Station > Save). ❒
Step Action ✓
1 Installing the FM 351 (refer to the section entitled "Installing and removing the FM 351 (Page 19)")
Hang the module onto the rail. ❒
2 Wiring the FM 351 (refer to the section entitled "Wiring the FM 351 (Page 21)")
Wiring up the front connector of the FM 351:
– Auxiliary voltage for the encoder supply ❒
– Auxiliary voltage for the load power supply ❒
– Digital inputs ❒
– digital outputs ❒
Encoder connection ❒
3 Checking the safety-related switches
Check the function of the following:
EMERGENCY STOP switches ❒
Hardware limit switches ❒
4 Front connector
The front connector must be engaged. ❒
5 Check the shielding of the individual cables. ❒
6 Switch on the voltage supply
Switch the CPU to STOP mode (safer mode). ❒
Switch on the 24 V supply voltage for the auxiliary voltage. ❒
Step Action ✓
1 In the SIMATIC Manager, select the library FMx51LIB (File > Open > Libraries). ❒
2 From the program folder FM 351 ABS V2, copy the FC 0 function and the FB 1 block to the blocks ❒
folder.
3 Create a channel DB from the template UDT 1 for each channel and enter the channel number. ❒
4 If you want to use a programmed diagnostic evaluation, copy FB 2 and create a diagnostic DB for each ❒
module.
5 If you wish to read or write machine data and increment tables in the user program, you require UDT 3 ❒
in order to create a parameter DB for each channel.
Step Action ✓
1 Select the line in the subrack with the module FM 351. ❒
2 Now double-click to call the parameter assignment screens for the FM 351. ❒
3 You can change the following settings under File > Properties: ❒
General
If you change the start address, you must also change the end address.
Note the module address that you are shown.
Basic parameters
Step Action ✓
1 Use the screens Debug > Commissioning, Debug > Error evaluation and Debug > Service to test your ❒
data for commissioning.
2 You can change any incorrect machine data in the Debug > Commissioning screen. These changes ❒
will be valid until the next transition of the CPU from STOP to RUN.
3 You can save the corrected machine data in the CPU by repeating steps 6 to 9 of the previous ❒
sequence.
Step Action ✓
1 Synchronize the axis ❒
Incremental encoder Absolute encoder ❒
– Select "Set reference point". To do this enter – In principle, the FM 351 should be
the required value (refer to the section synchronized immediately after the
entitled "Configuring set reference point parameter assignment.
(Page 119)"). – Perform an the absolute adjustment
or (refer to the section entitled "Determining
the absolute encoder adjustment
– Select the "reference point approach" mode (Page 82)").
(refer to the section entitled "Configuring the
reference point approach mode
(Page 103)").
Check the actual status of the axis. The physical position must match the value output on the display. ❒
2 Select Jog mode. ❒
Check the correct interconnection of the outputs (control mode) and the actual value. ❒
– Traverse in creep speed in the plus and minus direction.
– Traverse in rapid traverse in the plus and minus direction.
Check the encoder resolution (refer to the section entitled "Resolution (Page 85)"). ❒
– Traverse the drive a defined distance in a defined direction.
The actual traversing distance must agree with the value indicated in the Debug >
Commissioning screen.
3 Select Incremental approach mode
absolute with increment number 255
– Check the process with the defined increment dimension ❒
– and use the increment 255 to check the changeover and switch-off differences against the ❒
circumstances of your system.
4 Test the other function switches and jobs in accordance with your application cases ❒
e.g., loop approach, set actual value
Note
If you are using the FM 351 on PROFIBUS DP, the CPU must be in RUN mode for testing
and commissioning. Otherwise you will not be able to control the FM 351.
Note
If, in the commissioning screen, you set the drive enable while the CPU is in STOP mode,
and then exit all the parameter assignment screens, the drive enable will be cancelled.
Preparing channel DB
Step Action ✓
1 Open the channel DB. ❒
2 Check the following entries:
the module address in the MOD_ADDR parameter (refer to the section entitled Basics of ❒
programming a positioning module (Page 36))
the channel number in the CH_NO parameter ❒
if applicable, the number of the parameter DB in the PARADBNO parameter ❒
3 Save the channel DB (File > Save). ❒
Step Action ✓
1 Open the diagnostic DB. ❒
2 Make sure that the module address is entered in the MOD_ADDR parameter (refer to the section ❒
entitled Basics of programming a positioning module (Page 36)).
3 Save the diagnostic DB (File > Save). ❒
Integrating blocks
Step Action ✓
1 Integrate the required functions and blocks in your user program. ❒
Step Action ✓
1 In the SIMATIC Manager, select the blocks and then download them with Target system > Download ❒
to the CPU.
See also
Important safety information (Page 21)
Note
If synchronization-relevant parameters have been changed, when the machine data is
enabled the module will carry out the following actions for the respective channel:
the synchronization is deleted
the function switches and zero offset will be cancelled
all the machine data and increment tables so far will become invalid
Synchronization-relevant parameters are:
Axis type
End of rotary axis
Encoder type
Distance per encoder revolution
Increments per encoder revolution
Number of revolutions
Reference point coordinate
Absolute encoder adjustment
Type of reference point approach
Counting direction
Note
If you change the system of units in the parameter assignment screens under STEP 7,
the values are converted into the new system. This may lead to rounding errors.
If you change the system of units programmed via the jobs "Write machine data" and
"Enable machine data", the values will not be automatically converted.
Drive data
YFUHHS
5DSLGWUDYHUVH [4
&UHHSVSHHG [4
7UDYHUVHSOXV [4
7UDYHUVHPLQXV [4
Control mode 2
YUDSLG
3(+
YFUHHS
5DSLGWUDYHUVH [4
FUHHSVSHHG
3RVLWLRQUHDFKHG [4
7UDYHUVHSOXV [4
7UDYHUVHPLQXV [4
YFUHHS
5DSLGWUDYHUVH [4
&UHHSVSHHG [4
7UDYHUVHSOXV [4
7UDYHUVHPLQXV [4
Control mode 4
YUDSLG
&KHFNEDFNVLJQDO
3(+
YFUHHS
5DSLGWUDYHUVHSOXV [4
&UHHSVSHHGSOXV [4
5DSLGWUDYHUVHPLQXV [4
&UHHSVSHHGPLQXV [4
Table 8- 1 Table with states of the 4 outputs for each control mode, x stands for channel 1 and 2
6RIWZDUHOLPLWVZLWFK 6RIWZDUHOLPLWVZLWFKHQG
7DUJHW
VWDUW
① Operating range
⑥ Standstill range
⑦ Target range
⑨ Switch-off point
The monitoring time starts with the start of a positioning and is retriggered with each actual value change in the
traversing direction.
the target approach.
The positioning must end within the monitoring time.
The monitoring time is retriggered for the last time once the switch-off difference is reached.
the plausibility of the actual values on the switch points.
Axis data
3K\VLFDOVWDUW 3K\VLFDOHQG
The rotary axis is an axis whose traversing range is not restricted by mechanical stops.
0D[LPXPGLVSOD\DEOH 6WDUWRIURWDU\D[LVFRRUGLQDWH (QG
YDOXH (QGRIURWDU\D[LV RIURWDU\D[LV
Greater than or equal to 0 and smaller than the value "end of rotary axis" (0 ≤ reference point coordinates < "end of
rotary axis").
Incremental encoder
After each start-up of the FM 351, the axis is initially not synchronized. Only after a synchronization will the configured
software limit switches be monitored.
Absolute encoder (SSI)
The axis is synchronized after the FM 351 has received a complete, error-free message frame for the associated channel.
As of this point the software limit switches will be monitored.
The absolute encoder must cover at least the operating range including the software limit switches.
Connection: operating range, encoder range, traversing range
The "operating range" is the area that you establish for your jobs by means of the software limit switches.
The "encoder range" is the unambiguous range that is covered by the encoder. For a linear axis, the module assigns
the "encoder range" symmetrically across across the operating range. That is, the module shifts the encoder range in
order to equalize the distances between the software limit switches and the ends of the encoder range (see figure).
The "traversing range" is the value range that the FM 351 can process. The traversing range depends on the
resolution.
Definition
The encoder supplies path information to the module (refer to the section entitled "Encoder
(Page 131)"). The module evaluates this and uses the resolution to convert it into an actual
value.
The correct definition of the encoder's machine data is essential for ensuring consistency
between the calculated and physical actual position of the axis.
0RWRU
(QFRGHU
*HDUER[
0RWRU (QFRGHU
*HDUER[
Definition
The absolute encoder adjustment and the reference point coordinate is used to explicitly
map the encoder's value range to the coordinate system of the axis.
Note
You perform this adjustment just once during the commissioning. After a configuration,
the position module is synchronized during start-up as soon as a complete, faultless
message frame of the encoder is received after start-up.
$FWXDOYDOXH
$[LV
&XUUHQW
9DOXHRIDEVROXWHHQFRGHU
(QFRGHUYDOXH
(QFRGHU
$[LV
'HVLUHG
1) Assignment of the coordinate system to the encoder values with the specified absolute encoder
adjustment. The encoder value 0 corresponds to the actual value -125.
2) Desired classification of the coordinate system to the encoder. At this position the coordinate
should be -125.
8QLTXHHQFRGHUUDQJHWKDWFDQEHFRYHUHGZLWKWKLVHQFRGHU
6/6 6/(
9DOXHRIDEVROXWHHQFRGHU
&DOFXODWHGYDOXHRI
DEVROXWHHQFRGH
DGMXVWPHQW
The encoder supplies 2048 unique values. The operating range is established by the
software limit switches. Because of the selected resolution of 1 mm per pulse, the encoder
however can cover a greater operating range than the one provided by the software limit
switches.
With the set resolution, the operating range is already covered with 2001 values. Therefore,
in the example, 47 pulses "remain" and these are symmetrically positioned around the
operating range.
8.7 Resolution
Definition
The resolution indicates the traversing distance corresponding to one pulse. It is a
measurement for the precision of the positioning and also determines the possible maximum
traversing range of the positioning module.
The resolution (RES) can be calculated as in the following table:
Note
All position information is rounded up to the integral multiple of the resolution. This way the
entered values differentiate from the used values.
Example
● An incremental encoder has the following data:
– Increments per encoder revolution: 5000
– Distance per encoder revolution: 1000 mm
– 1 increment = 4 pulses
This results in the resolution (4 x evaluation):
PP PP PP
5HVROXWLRQ
LQFUHPHQWV ,QFUHPHQW bSXOVHV
PP
3XOVH
PP PP PP
5HVROXWLRQ
LQFUHPHQWV ,QFUHPHQW 3XOVH
8.8 Increments
8.8.1 Increments
Definition
Increments are target specifications that can be controlled by the positioning module with the
relative/absolute incremental approach mode.
WDUJHWUDQJH WDUJHWUDQJH
:RUNLQJbUDQJH 5DQJHLQZKLFKDWDUJHWPD\OLH
1RWDUJHWPD\OLHLQWKLVSDUWRIWKHZRUNLQJUDQJH
Note
The entry is made in the unit in accordance with the set system of units. In doing so, please
observe the post-decimal places.
Numerical example:
Incremental: 800 mm
System of units: 10-3 mm
Entry in the parameter DB: 800000
Tip: in the increment table define separate areas for relative and absolute increments.
Definition
The end of a positioning is indicated by the checkback signal WORKING = 0. It can be
reached in three different ways:
● Target approach
● Shutdown
● Cancel
Monitoring
During the end of a positioning, the following monitoring systems are active:
● Monitoring time
The monitoring time is retriggered at the switch-off point for the last time and then loses
its validity with the end of the positioning.
Within this time, the end of the positioning must be reached, otherwise the outputs will be
switched off and the operating error "Error during target approach" (error number 5) will
be issued.
● Monitoring of target range
The FM 351 sets a symmetrical range around each target, thereby defining the
positioning precision of your application. The axis must come to a standstill within this
range during a target approach. A value 0 switches off the tolerance during the target
approach.
Target approach
The target approach in the "Absolute/relative incremental approach" modes starts once the
switch-off point has been reached. As of this point the drive is switched off, and the FM 351
adopts the monitoring functions.
Depending on which monitoring you have assigned, there are different cases for creating the
checkback signal "PR (POS_RCD)". The positioning is canceled if checkback signal "PR
(POS_RCD)" is not generated.
Scenario 1: You have assigned:
● Target range (TRG_RANGE) > 0
● Standstill velocity (ZSPEED_L) > 0
● Monitoring time (MON_TIME) > 0
PR is generated when the velocity falls below the standstill velocity and the target range
has been reached. It does not matter which condition is fulfilled first.
PR is not generated if the actual value has not reached the target range within the
monitoring time or the target range has been overrun without the velocity falling below the
standstill velocity.
PP 7DUJHW PP
YFUHHS
YVWDQGVWLOOYHORFLW\
W
YFUHHS
W
YFUHHS
YVWDQGVWLOOYHORFLW\
W
YFUHHS
W
PP PP
YUDSLG
YFUHHS
HJ6723 (QGRISRVLWLRQLQJ
Cancel
Cancel means: the positioning is immediately ended without using the changeover difference
and switch-off difference from rapid traverse or creep speed to standstill. In addition, all the
relevant outputs of the respective control mode are immediately switched off and also:
● Increment = actual value
● Distance-to-go = zero
The positioning is canceled if
● The drive enable signal is deleted (DRV_EN=0)
● The CPU goes to STOP
● Diagnostic error or any operating error except the "Target overrun" operating error (error
number 9) occurred
The "PR (POS_RCD)" checkback signal is not set in "Incremental approach" mode.
If the standstill velocity is assigned, the standstill monitoring will become active as soon as
the velocity falls below the standstill velocity. If the standstill velocity is not assigned, the
standstill monitoring will be active once the outputs have been switched off.
YUDSLG
YFUHHS
&DQFHODWLRQ
Definition
In "Jog" mode you can move the drive in one direction at the press of a button. You must
install a button for both directions (plus and minus) respectively. You can use "Jog" mode for
both synchronized and non-synchronized axes.
For a non-synchronized axis, jogging involves a positioning in the specified direction.
For a synchronized axis (linear axis), jogging involves a positioning to the software limit
switches.
Requirement
The axis parameters must be assigned.
5. Set the control signal for the plus or minus traversing direction (DIR_P=1 or DIR_M=1).
6. Call the FB ABS_CTRL.
02'(B,1
-RJJLQJ
'59B(1
'ULYHHQDEOH
[O
(QDEOHLQSXW
:$,7B(,
',5B0',5B3
:25.,1*
YUDSLG
YFUHHS
V
Shutdown of jogging
"Jog" mode is shut down, if
● You release the button used for jogging (DIR_M or DIR_P=0)
● The FM 351 receives a STOP signal (STOP = 1)
● The actual value reaches the limit of the operating range for a synchronized linear axis
The axis can only continue moving in the opposite direction.
After traversing is shut down, it can continue in any direction.
Canceling jogging
"Jog" mode is canceled, if
● the drive enable signal is deleted (DRV_EN=0)
● a traversing range limit for a linear axis has been overrun
Monitoring
In jog mode, the following monitoring functions are not active at the end of the positioning:
● Monitoring of standstill range
● Monitoring of target range
● Monitoring of standstill velocity
This operation does not result in proper positioning after which the "Position reached" signal
is set.
Definition
In "Reference point approach" mode you can synchronize the axes on account of a
repeating external event.
Requirements
● An incremental encoder with zero mark.
● The axis parameters must be assigned.
Note
The following applies to the rotary axis: Reproducibility of the reference point is only ensured
if the ratio of the End of rotary axis value and the Distance per encoder revolution value is an
integer.
02'(B,1
5HIHUHQFHSRLQWDSSURDFK
'59B(1
'ULYHHQDEOH
[O
(QDEOHLQSXW
:$,7B(,
67$57
',5B0',5B3
:25.,1*
6<1&
YUDSLG
YFUHHS
V
5HIHUHQFH =HURPDUN
SRLQWVZLWFK
YFUHHS
6WDUWLQJSRVLWLRQ 6<1&
YFUHHS
6<1&
6WDUWLQJSRVLWLRQ 5
YFUHHS
R = Direction reversal REF = Reference point switch UM = Reversing switch N = Zero mark of encoder
SYNC = Synchronization was reached
Example of reference point approach (REFPT_TYPE=0):
The start direction must be assigned in the plus
1
direction.
5()
The location of the zero mark of the reference point
switch is assigned in the plus direction. 80
5 6<1& 6WDUWLQJSRVLWLRQ
YFUHHS
YUDSLG
6<1& 6WDUWLQJSRVLWLRQ
5 5
YFUHHS
YUDSLG
6WDUWLQJSRVLWLRQ 6<1&
R = Direction reversal REF = Reference point switch UM = Reversing switch N = Zero mark of encoder
SYNC = Synchronization was reached
Definition
In "incremental approach" mode the FM 351 can move the drive
● to absolute targets,
● relatively by an incremental distance in a specified direction.
The target or the relative distances are specified as increments of the FM 351. You have the
option of entering up to 100 increments in a table. These are valid both for relative
incremental approach mode as well as for absolute incremental approach mode.
Independently of the increment table, you can specify the distance using the increments 254
and 255 (refer to the section entitled "Increments (Page 87)").
Requirements
● The axis parameters must be assigned.
● The axis must be synchronized.
● The increments must be available on the module.
Note
Only positive increments are permissible for "Relative incremental approach" mode.
The signs of the increments result from the DIR_P and DIR_M direction specifications.
02'(B,1
,QFUHPHQWDODSSURDFK
'59B(1
'ULYHHQDEOH
[O
(QDEOHLQSXW
:$,7B(,
67$57
',5B0',5B3
:25.,1*
326B5&'
3(+
YUDSLG
YFUHHS
V
Distance-to-go
The distance-to-go is the specified difference between the target (increment) and the actual
value.
In the case of a rotary axis, the displayed distance-to-go cannot be used.
Delete distance-to-go
With the job "Delete distance-to-go" you can delete any awaiting distance-to-go.
You also delete the awaiting distance-to-go by calling a different operating mode or by
starting the operating mode in the other direction.
Definition
The job "Set actual value" assigns a new coordinate to the current encoder state. The
operating range is projected on a different area of the axis.
Ascertain the shift of the operating range with (ACTUALnew -ACTUALcurrent).
● ACTUALnew is the default value
● ACTUALcurrent is the actual value at the time of the execution
Requirements
● The axis parameters must be assigned.
● The axis must be synchronized.
Job sequence
1. Enter the coordinate AVAL for the actual value (ACTUALnew).
– Linear axis:
You must select the specified actual value such that the software limit switches are
still within the permissible traversing range after the job is called.
The absolute value of the shift resulting from (ACTUALnew - ACTUALcurrent) must be
less than or equal to the absolute value of the permitted traversing range (max. 100 m
or 1000 m).
– Rotary axis:
Rule for the defined actual value:
0 ≤ actual value < end of rotary axis
2. Set the respective trigger bit (AVAL_EN=1).
If issued during a positioning, the "set actual value" job is held back until the end of the
positioning, and it is carried out only after the subsequence call of the block.
Table 9- 4 Shifting of the operating range on the axis by means of "set actual value"
2OGFRRUGLQDWHV\VWHP
6/6 $&7 6/(
3URMHFWLRQRI
QJH
ZRUNLQJUDQJH
JbU D
WKURXJKDFWXDO
U N LQ
YDOXH
WR
Z R
PP
6 HW
Definition
You use the "set reference point" job to synchronize the axes. The job shifts the operating
range. All the shifts that were created with set actual value are retained.
The setting projects the operating range on the axis. Therefore, by entering different values,
the operating range can be moved to any position within the physical area of the axis.
Prerequisites
● The positioning must have ended.
● The axis parameters must be assigned.
Job sequence
1. Enter the value for the reference point coordinate (REFPT).
– Linear axis:
The reference point coordinate must not lie outside of the software limit switches. This
also applies to the reference point coordinate in a shifted coordinate system.
– Rotary axis:
Rule for the reference point coordinate:
0 ≤ reference point coordinate < end of rotary axis
2. Set the respective trigger bit (REFPT_EN).
Table 9- 5 Shift of the operating range on the axis by means of "set reference point"
2OGFRRUGLQDWHV\VWHP
6/6 $&7 6/(
D[LV
3URMHFWLRQRI
JbU D
ZRUNLQJUDQJH
U N LQ
WKURXJKUHIHUHQFH
SRLQWWR
Z R
PP
6 HW
-400 400 400
Definition
With "loop approach" you specify the direction in which a target is approached with a
frictional connection. You can use loop approach if a frictional connection between the motor
and axis can only be ensured in one direction.
A target that is approached in the direction opposite the specified direction is initially overrun.
Then the FM 351 carries out an about-turn and approaches the target in the specified
direction.
Requirements
● The axis parameters must be assigned.
● The axis must be synchronized.
● In the case of a loop approach in the opposite direction to that of the traversing direction
of the target the maximum target position is:
– traversing direction plus
target < SLE - 1/2 target range - switch-off difference plus - changeover difference
minus
– traversing direction minus
target > SLS + 1/2 target range + switch-off difference minus + changeover difference
plus
● A loop approach will not be carried out if the target is being approached in the direction of
the loop approach. In this case, an incremental approach without an about-turn in
direction will be carried out.
● The sequence of the "incremental approach" mode must be known (refer to the section
entitled "Configuring the increment drive mode (Page 109)").
Fictitious target
If you start positioning to a target that is located in the direction opposite that of the assigned
loop approach, the FM 351 determines a fictitious target for this target. The FM 351 performs
a direction reversal at the fictitious target and then approaches the target in the proper
direction.
This fictitious target must be located by at least half the target range before the respective
software limit switch.
The distance of the fictitious target from the assigned target is determined depending on the
direction:
Table 9- 6 Calculating the location of the fictitious target with a loop approach
Example
Using a positioning with loop approach minus to a maximum target we can illustrate the
location of the fictitious target.
6RIWZDUHOLPLWVZLWFK
YUDSLGWUDYHUVH )LFWLWLRXVWDUJHW HQG
YFUHHS
7DUJHW
'LUHFWLRQ
UHYHUVDO
YFUHHS
Definition
The enable input is an external input with which a positioning can be enabled by an external
event.
Definition
With the "read position data" job you can read the increment, distance-to-go and speed at
the current time.
Job sequence
1. Set the trigger bit in the channel DB (ACTSPD_EN=1).
2. The data is then stored in the channel DB.
Definition
With the "read encoder data" job you can read the current data of the encoder as well as the
value for the absolute encoder adjustment.
Prerequisites
You can read the value for the absolute adjustment after you have carried out the "set
reference point" job (refer to the section entitled "Determining the absolute encoder
adjustment (Page 82)").
Job sequence
1. Set the trigger bit in the channel DB (ENCVAL_EN=1).
2. The data is then stored in the channel DB.
Definition
The "checkback signals for the positioning" inform you of the current status of the
positioning.
Sequence
The data are stored in the channel DB at each call of FB ABS_CTRL.
Definition
The "checkback signals for the diagnostics" informs you of occurring diagnostic events.
Sequence
1. If the module enters a new event in the diagnostic buffer, it sets the DIAG bit in all
channels in the checkback interface. Every time an error occurs, all of the error classes
listed in the appendix "Data blocks / Error lists" create an entry in the diagnostic buffer.
The DIAG bit is also set when the diagnostic buffer is deleted.
2. If it is not possible to call an operating mode or control an active operating mode, or if this
is carried out incorrectly, the module sets an operator error OT_ERR in the checkback
interface. The cause of error is then entered in the diagnostic buffer. While the operator
error exists, you can neither start a new operating mode nor continue with the halted one.
You acknowledge an existing operator error with OT_ERR_A=1.
3. The module sets the DATA_ERR bit in the checkback interface when it detects faulty data
in a write job. The cause of error is then entered in the diagnostic buffer.
4. The checkback signals are stored in the channel DB.
5. When the diagnostic buffer is read, the module sets the DIAG bit back to 0 in all
channels.
Note
If the 5 V encoder does not output a zero mark signal and wire-break monitoring is enabled,
you must interconnect the zero mark signal inputs N and /N externally so that the inputs will
exhibit different signal levels (for example, N to 5V, /N to ground).
Signal forms
The following figure illustrates the signal forms of encoders with asymmetrical and
symmetrical output signals.
asymmetrical symmetrical
$ $
$
% %
%
1 1
1
Signal evaluation
increments
An increment identifies a signal period of the two signals (A and B) of an encoder. This value
is specified in the technical specifications of an encoder and / or on its ID plate.
6LJQDOSHULRG LQFUHPHQW
$
%
3XOVHV 4XDGUXSOHHYDOXDWLRQ
Pulses
The positioning module evaluates all 4 edges of signals A and B in every increment
(quadruple evaluation).
Pulses
1 increment (encoder specification) = 4 pulses (FM evaluation)
Response times
The positioning module has the following response times for connected incremental
encoders:
Response times
Response time = switching cycle of the connected switching elements
Note
You can compensate for the minimum response time by assigning the changeover difference
and switch-off difference accordingly.
Indecision
The indecision influences the precision of the positioning. In the case of incremental
encoders the indecision is negligible.
Data Transmission
The baud rate for data transmission depends on the cable length (refer to the appendix
section entitled "Technical specifications (Page 167)").
Response times
The FM 351 has the following response times for absolute encoders:
Response times
Minimum response time = message frame time + switching cycle of the connected switching elements
Maximum response time = 2 x message frame time + monoflop time + switching cycle of the connected switching elements
With programmable absolute encoders:
Maximum response time = message frame time + monoflop time + switching cycle of the connected switching elements
+1/max. step sequence frequency
Monoflop time
The monoflop time is 64 µs.
Encoders with values greater than the limits specified here are not permitted.
Baud rate Message frame time with 13 bit Message frame time with 25 bit
0.188 MHz 75 µs 139 µs
0.375 MHz 38 µs 70 µs
0.750 MHz 19 µs 35 µs
1.500 MHz 10 µs 18 µs
Note
You can compensate for the minimum response time by assigning the changeover and
switch-off differences accordingly.
Indecision
The indecision is the difference between the maximum and the minimum response time.
With an absolute encoder this amounts to
Indecision
Indecision = message frame time + monoflop time
With programmable absolute encoders:
Indecision = message frame time + monoflop time + 1/max. step sequence frequency
Description
These errors occur synchronously to a job or to the start of a positioning. Synchronous errors
are operator errors (error class 2), data errors (error class 4), machine data errors (error
class 5), increment table errors (error class 6) (refer to the appendix for a description of error
classes).
Description
These errors occur during operation on account of external events. They trigger a diagnostic
interrupt. Asynchronous errors are operating errors (error class 1) and diagnostic errors
(error class 128) (refer to the appendix for a description of error classes).
Error LEDs
The status and error display shows different error states.
6)
&+
&+
Program structure
The following figure shows the "General program structure" of a user program presented in
the section entitled "FB ABS_CTRL (FB 1) (Page 39)", expanded to include the readout of
the diagnostic buffer for display on an OP. The FB ABS_DIAG stores the diagnostic buffer in
a diagnostic DB that can be displayed by the OP.
,QLWLDOL]DWLRQ
2QHWLPHFDOO
HJ2%
&DOO)&$%6B,1,7
-REVVWLOORSHQ"
1R
6HWMREGDWDDQGMREWULJJHUELWV <HV
6HWFRQWUROVLJQDOV
5HDGRXWGLDJQRVWLFEXIIHURIPRGXOH&DOO
)%$%6B',$*
HJ2%
&\FOLFFDOO
&DOO)%$%6B&75/
(YDOXDWHUHWXUQYDOXH5(79$/RI)%$%6B&75/
!
-REV -REVLQ
(UURU
FRPSOHWH SURJUHVV
*HQHUDO
3RVVLEO\
QRQVSHFLILF
(YDOXDWHGDWDRI
UHVSRQVHWR 1H[WF\FOH
UHDGMREVDQG
GDWDHUURU
FKHFNEDFN
SURJUDPPLQJ
VLJQDOV
HUURU
1H[WMRE
In the following figure you will find a possible program structure with which you can respond
to the checkback signals "data error" (DATA_ERR), "operator error" (OT_ERR) and the error
bits of the job (_ERR).
&DOO)%$%6B&75/
2SHUDWRUHUURU
27B(55 "
<HV
(UURUUHVSRQVHWRRSHUDWRUHUURU 1R
(YDOXDWHUHWXUQYDOXH5(79$/RI)%
$%6B&75/
IRUDOOLVVXHGMREVRIDFKDLQ
(YDOXDWHHUURUELWVDQGGRQHELWV
&RPPXQLFDWLRQHUURU
-2%B(55" LIQHFHVVDU\MREVSHFLILF
<HV HUURUUHVSRQVHUHSHWLWLRQ
UHVWDUW
5HVSRQVHWRSRVVLEOH
FDXVHV
'%QRWORDGHG
'%WRRVKRUW
,QFRUUHFW'%QXPEHU
*HQHUDOSURJUDPPLQJHUURU
1R
'DWDHUURU
'$7$B(55 "
<HV
1R
-REVSHFLILFHUURUUHVSRQVH
Figure 11-3 User program with evaluation of the error bits in the jobs
The following image offers a possible program structure using which you can evaluate all the
errors via the entries in the diagnostic DB. In this way you can respond to the program if one
or more errors are reentered in the diagnostic buffer of the module. Some possible program
responses are listed in the following detailed figures.
&DOO)%$%6B&75/
'LDJQRVWLFEXIIHU
FKDQJHG
',$* RUGLDJQRVWLF
IODJ "
<HV
6HWGLDJQRVWLFIODJ
&DOO)%$%6B',$*
(YDOXDWHUHWXUQYDOXH5(79$/RI)%$%6B',$*
1R
Figure 11-4 User program with complete error evaluation via the diagnostic DB
'DWDHUURU
'$7$B(55 "
<HV
6HDUFKIRUHUURUFODVVDQGLQGLDJQRVWLF'%
1R
,PSOHPHQWVSHFLILFHUURUUHVSRQVHEDVHGRQWKHHUURUQXPEHU
2SHUDWLQJHUURU
27B(55 "
<HV
/RRNIRUHUURUFODVVLQWKHGLDJQRVWLF'%
1R
([HFXWHVSHFLILFHUURUUHVSRQVHEDVHGRQHUURUQXPEHU
DFNQRZOHGJHRSHUDWLQJHUURU
,'IURPGLDJQRVWLF
LQWHUUXSWVHW"
<HV
6HDUFKIRUHUURUFODVVLQGLDJQRVWLF'%
1R
,PSOHPHQWVSHFLILFHUURUUHVSRQVHEDVHGRQWKHHUURUQXPEHU
(UURUFODVV
(UURUQXPEHUFKDQQHOHWF
VSHFLILHGYDOXHV"
<HV 1R
,PSOHPHQWVSHFLILFHUURUUHVSRQVHEDVHGRQWKHHUURUQXPEHU
Diagnostic events
The module´s diagnostic buffer includes maximum 9 diagnostic events and is organized as a
ring buffer.
A diagnostic event is written in the buffer if an "incoming" (error) message is detected. This
can be a message, a synchronous error (data error, operator error) or even an asynchronous
error (operational error and diagnostics error). From a cause of error several entries can
occur as follow-up errors. Outgoing messages do not create any entries in the diagnostic
buffer.
For each diagnostic event the following is given:
● Status (always incoming)
● Internal error
● External error
● Error class
● Error number
● Channel number
● Increment number (in the case of increment table errors)
When a diagnostic event is written in the diagnostic buffer, the checkback signal DIAG=1 is
set in all assigned channels.
With the FB ABS_DIAG, the diagnostic buffer can be transferred as a whole into a data block
(diagnostic DB) or displayed via the error evaluation screen of the configuration software. If
the diagnostic buffer is read, the module sets the checkback signal DIAG=0.
Note
If the diagnostic buffer is read simultaneously from the FB ABS_DIAG and the error
evaluation screen, it is possible that a new diagnostic event is not detected by the program.
Interrupt processing
The FM 351 can trigger diagnostic interrupts. You process these interrupts in an interrupt
OB. If an interrupt is triggered without the associated OB having been loaded, the CPU will
switch to STOP mode (see SIMATIC Programming With STEP 7 Manual
(http://support.automation.siemens.com/WW/view/en/45531107)).
You enable the processing of the diagnostic interrupts as follows:
1. Select the module in HW Config
2. Enable the diagnostic interrupt under Edit > Object properties > Basic parameters.
3. Save and compile the hardware configuration.
4. Download the hardware configuration to the CPU.
$GGUHVVRILQWHUUXSWJHQHUDWLQJ
PRGXOH2%B0'/B$''5
0RGXOHDGGUHVVIURPFKDQQHO'%
02'B$''5"
'LDJQRVWLFLQWHUUXSW
1R
2%
<HV
1RWHWKHPRGXOHDGGUHVVDQGHUURUGLVSOD\V ([LW2%RU
IURP2%E\WHV FKHFNQH[W
PRGXOH
1RWH'LDJQRVWLFLQWHUUXSWRFFXUUHG,'
VHHDOVR)LJXUH3RVVLEOHHYDOXDWLRQRIDGLDJQRVWLF
LQWHUUXSWLQ(UURUHYDOXDWLRQLQWKHXVHUSURJUDP
'LDJQRVWLFLQWHUUXSW
RFFXUUHG,'VHW"
<HV
1RWHG
0RGXOHDGGUHVV
)URP2% PRGXOHDGGUHVV
)URPFXUUHQWFKDQQHO'%
02'B$''5"
1R
HJ2%
&\FOLFFDOO
<HV
(UURUGLVSOD\VIURP2% 1R
&KDQQHOHUURU 2WKHUHUURU
6SHFLDOUHVSRQVHSHUFKDQQHO
DIWHUHYDOXDWLRQRIGLDJQRVWLF 6SHFLDOUHVSRQVHIRUWKHHQWLUH
EXIIHU PRGXOH
Example project
The FM 351 configuration package you installed contains example projects showing you
several typical applications based on a number of selected functions.
The English example project is located in the following folder:
...\STEP7\EXAMPLES\zEn18_01
It contains several S7 programs of various complexities and objectives.
12.2 Requirements
Procedure
In order to work through the examples online, you must prepare as follows:
1. Use SIMATIC Manager to open the example project zEn18_01_FMx51___Prog in the
\STEP7\EXAMPLES folder (use the detailed representation to display the symbolic
name) and copy it under a suitable name in your project directory (File > Save as).
2. Insert in your project a station that complies with your hardware set-up.
3. Complete the hardware configuration with HW Config and save the configuration.
4. Select an example program and copy the program to the offline CPU.
5. Assign the FM 351 parameters using "Getting Started". Use File > Export to export the
parameters that are adapted to your system to the parameter DBs of all the examples
apart from the the "Getting Started" example.
6. Enter the module address in the associated channel DB and, if necessary, also in the
corresponding diagnostic DB in the "MOD_ADDR" parameter (refer to the section entitled
Basics of programming a positioning module (Page 36)).
7. Download the hardware configuration to your CPU.
8. Download the blocks to your CPU.
9. If you would like to try the next example, go to step 4.
Examples in STL
The examples are written in STL. You can view them directly via the LAD/FBD/STL editor.
Select the view with "symbolic display", "icon selection" and "comment". If you have sufficient
space on the screen, you can also view the "icon information".
Test sequence
Once you have made all the entries necessary for the respective example, download the
entire block container to the CPU.
The example programs include variable tables (VATs) you can use to view and change data
blocks online, i.e., in CPU RUN mode. Select the views "icon" and "icon comment" from the
variable table. Open a variable table, connect it with the configured CPU and cyclically
monitor the variables. This way the displayed variables are constantly updated. By
transmitting the control values you can change the values in the online data blocks.
All examples assume that you have entered and saved the machine data with the parameter
assignment screens. This allows you to work through the examples sequentially.
If "continuous reading" by the FM 351 (e.g., of position values) is programmed, the
CPU S7-300 can encounter restrictions when updating the parameter assignment screens.
Procedure
You can continue using the code of examples directly as a user program.
The code of examples is not optimized and also is not designed for all eventualities. Error
evaluations have not been extensively programmed in the example programs so as not to
make the programs too comprehensive.
The "AllFunctions" example program can be used as a copy template in which, by means of
modifying, you can compile the functions that can then be used as a basic template for your
user program.
The examples are prepared for channel 1 ("severalchannels" for channel 1 and 2). Use the
LAD/FBD/STL editor to change the channel number.
Objective
With this example you can commission your positioning module whose parameters you have
assigned with the aid of "Getting Started".
This example expands the program in the "Linking to the User Program" chapter of the
"Getting Started" by an error evaluation.
Requirements
You have assigned the positioning module parameters as described in "Getting Started".
In the channel DB, the address of your module is entered correctly in the MOD_ADDR
parameter, and the channel number is correctly entered in the CH_NO parameter.
Startup
In the startup OB (OB 100) you call the FC ABS_INIT, which resets all the control and
checkback signals as well as the job management in the channel DB.
Cyclic operation
Open the variable table (VAT_CTRL_1), create the connection to the configured CPU and
then monitor the variables. Transfer the prepared control values. Activate the
"CHAN_1".DRV_EN: the drive is now enabled ("CHAN_1".ST_ENBLD=1). If the drive is not
enabled, please check your enable inputs.
CAUTION
Set DIR_P=1 in order to move in the plus direction with selected "Jog" mode. If you set
DIR_P=0, the drive is shut down properly.
Error evaluation
Create a data error by setting in the VAT_CTRL_1 the reference point coordinate
"CHAN_1".REFPF outside of the operating range or the end of rotary axis. Then activate the
job "set reference point" with "CHAN_1".REFPT_EN=1. The CPU goes to STOP. In an
example, this is the simplest method of indicating an error. You can of course program a
different error evaluation.
Open the hardware configuration and double-click the FM 351 or FM 451. This opens the
parameter assignment software. Display the cause of error via the Debug > Error evaluation
screen.
The status values in the VAT_CTRL_1 still show the status before the STOP of the CPU.
Update the status values in order to view the done bits and error bits of the jobs.
Proceed as follows to remedy the error:
1. Enter a permissible value in the control value.
2. Switch the CPU to STOP.
3. Switch the CPU to RUN mode.
4. Enable the control values. If you have already enabled the control values before the CPU
is restarted, the initialization will reset them again in the OB 100 and they will therefore be
ineffective.
Aim
In this example you commission the positioning module without using the parameter
assignment screens. You control and monitor by means of variable tables (VAT).
Requirements
You have assigned the positioning module parameters as described in "Getting Started".
In the channel DB, the address of your module is entered correctly in the MOD_ADDR
parameter, and the channel number is correctly entered in the CH_NO parameter.
In the diagnostic DB, the address of your module is entered correctly in the MOD_ADDR
parameter.
The supplied channel DB already includes the DB number 30 of the parameter DB for the
machine data in the PARADBNO parameter.
The machine data of your system are stored in the PARADB_1 data block.
Start-up
In the start-up OB (OB 100) call the FC ABS_INIT in order to initialize the channel DB. Then
set the trigger bits for all jobs that you require after start-up of the module.
Cyclic operation
Open the variable table (VAT_CTRL_1), create the connection to the configured CPU and
then monitor the variables.
Transfer the prepared control values. "Jog" mode is set and the necessary enables are set.
The drive turns by means of DIR_P=1. The actual value must change. In order to stop the
drive, set STOP to "1" and transfer the control values.
Activate and transfer the control value "CHAN_1".REFPT_EN (set reference point). The
checkback signal "CHAN_1".SYNC =1 means: the channel is synchronized.
In VAT_DIAG you can see the most important entries of the diagnostic buffer of the module.
The meaning of the error classes and error numbers can be found in the manual in the
appendix section entitled "Error classes (Page 189)".
Error evaluation
Try to create more errors:
● Specify a reference point coordinate that is greater than the operating range or the end of
rotary axis.
● Switch off the external auxiliary voltage.
● Delete the PARADB_1 on the online CPU and try to write the machine data. In the
example, the error evaluation is programmed in such a way that the CPU goes to STOP.
When you update VAT_CTRL_1 again, the error code for this error is displayed in the
"CHAN_1".JOB_ERR. The meaning of the error codes can be found in the manual in the
appendix section entitled "List of JOB_ERR messages (Page 188)".
Objective
This example uses all the functions of the FM 351 / 451:
● Operating modes
● Function switch
● Write jobs
● Read jobs
You can use the example programs as copy templates. By means of modification, compile
the functions that will form the basic template for your user program. The data that you must
adapt to your application are identified with ***. Some functions are only available with the
FM 451.
Responses to external events and the error evaluation are system-specific and are therefore
not included in this example.
Requirements
You have assigned the positioning module parameters as described in "Getting Started".
In the channel DB, the address of your module is entered correctly in the MOD_ADDR
parameter, and the channel number is correctly entered in the CH_NO parameter.
The supplied channel DB already includes the DB number 30 of the parameter DB for the
machine data in the PARADBNO parameter.
The machine data of your system are stored in the PARADB_1 data block.
Startup
In the startup OB (OB 100) call the FC ABS_INIT in order to initialize the channel DB. Then
set the trigger bits for all jobs that you require after startup of the module.
Operation
The CPU is in STOP. Open the variable table USER_VAT and enter the necessary job
number in the control values for your user program. The job numbers are explained in the
code of the example.
In doing so, the correct combination of user data "USER_DB".CTRL_SIG,
"USER_DB".FUNC_SW, "USER_DB".WR_JOBS, "USER_DB".RD_JOBS and
"USER_DB".RETVAL_CTRL is necessary.
For more information, refer to the section entitled "Operating modes and jobs (Page 91)".
Create the connection to the configured CPU and transfer and activate the control values.
Start the CPU (STOP > RUN). Monitor the checkback signals and actual values.
You can repeat the processing of the step chain by means of a new STOP RUN transition of
the CPU. Obviously, this action is not suitable for continuous operation. In the example we
use this action so that the module is always reinitialized.
Objective
In this example you control a drive by means of the user program. The user program
commissions the module after a CPU restart. Next, it executes a step sequence that is
triggered by certain events.
Using the variable tables, you define events, monitor the reactions of the module, and
evaluate the diagnostic buffer.
In this slightly more complex example, you can get to know the following block possibilities:
● Issuing several jobs simultaneously
● Mixing write and read jobs
● Reading with a continuous job, without waiting for the end of the job
● Evaluation of the checkback signals of the block
● Evaluation of the checkback signals for an individual job
● Resetting of done bits and error bits for individual jobs or all jobs
● Central call of ABS_CTRL at the end of the user program
Requirements
You have assigned the positioning module parameters as described in "Getting Started".
In the channel DB, the address of your module is entered correctly in the MOD_ADDR
parameter, and the channel number is correctly entered in the CH_NO parameter.
The supplied channel DB already includes the DB number 30 of the parameter DB for the
machine data in the PARADBNO parameter.
The machine data of your system are stored in the PARADB_1 data block.
Startup
In the startup OB (OB 100) you set the startup identifier (step 0) for the user program in the
associated instance DB (USER_DB).
Operation
The CPU is in STOP. Open the variable table USER_VAT, adapt the increment
("USER_DB".TRG_INC_1, "USER_DB".TRG_INC_2), the changeover difference
("USER_DB".CHGDIF) and the switch-off difference ("USER_DB".CUTDIF) to your system
and transfer the control values.
Start the CPU (STOP > RUN). Observe the step number of the step chain
("USER_DB".STEPNO), the checkback signals and the actual values. After the initialization
a "relative incremental approach" is carried out. The drive travels in a negative direction to its
first position ("USER_DB".TRG_INC_1).
Then the program waits in step 6 for an external trigger ("USER_DB".START_INC_2), in
order to commence the next incremental approach in direction plus. When the position is
reached, the step chain is at its end value (-2). The incremental approach with increment
number 255 allows the transfer of the changeover difference and switch-off difference. With
that you can test the behavior of your target approach.
You can repeat the processing of the step chain by means of a new start (STOP > RUN) of
the CPU. Obviously, this action is not suitable for continuous operation. In the example we
use this action so that the module is always reinitialized.
Error evaluation
In the case of an error in the processing, the step chain is brought to a halt. Step number -1
will be entered.
Try to create errors that will be stored by the central error evaluation as group errors in the
"USER_DB".ERR bit.
● In the USER_VAT, enable the prepared control value for the increment number 1
("USER_DB".TRG_INC_1), which is greater than the software limit switch.
The step chain is brought to a stop and -1 is shown as the step number. Check the errors
by means of the error evaluation screen.
● In the USER_VAT enable further control values one after the other for the increment
number 1 ("USER_DB".TRG_INC_1), increment number 255 ("USER_DB".TRG_INC_2),
and the change-over difference ("USER_DB".CHGDIF) and switch-off difference
("USER_DB".CUTDIF). For the error inspection proceed as you would with increment 1.
Objective
This example includes a user program with the same formulation as in the example program
4 "OneChannel". In addition, we show you how you evaluate a diagnostic interrupt for
specific modules and then make this into a general module error in the user program.
Requirements
You have assigned the positioning module parameters as described in "Getting Started".
In the channel DB, the address of your module is entered correctly in the MOD_ADDR
parameter, and the channel number is correctly entered in the CH_NO parameter.
In the diagnostic DB, the address of your module is entered correctly in the MOD_ADDR
parameter.
The supplied channel DB already includes in the PARADBNO parameter the DB number
(30) of the parameter DB for the machine data.
The machine data of your system are stored in the PARADB_1 data block.
In the HW Config, enable the diagnostic interrupt for this module via Edit > Object properties
> Basic parameters > Select interrupt > Diagnostics. Compile the hardware configuration,
and then download it to the CPU.
Startup
In the startup OB (OB 100) you set the startup identifier (step 0) for the user program in the
instance DB.
Operation
As in example program 4 "OneChannel".
Error evaluation
In the case of an error in the processing, the step chain is brought to a halt. Step number -1
will be entered. In the USER_VAT you will find the latest entry of the diagnostic buffer. You
can determine the cause of error via the error class and error number (refer to the appendix
section entitled "Error classes (Page 189)").
Try to create errors that will be stored by the central error evaluation as group errors in the
"USER_DB".ERR bit.
● In the USER_VAT, enable the prepared control value for the increment number 1
("USER_DB".TRG_INC_1), which is greater than the software limit switch.
The step chain is brought to a stop and -1 is shown as the step number. Check the errors
via the error evaluation screen or the diagnostic data in the USER_VAT.
● In the USER_VAT enable further control values one after the other for the increment
number 1 ("USER_DB".TRG_INC_1), increment number 255 ("USER_DB".TRG_INC_2),
and the change-over difference ("USER_DB".CHGDIF) and switch-off difference
("USER_DB".CUTDIF). For the error inspection proceed as you would with increment 1.
● Create the diagnostic interrupts by disconnecting the auxiliary voltage of the module or
removing the front connector. The diagnostics error "USER_DB".ERR_MOD and group
error "USER_DB".ERR will be 1 and the step number will be -1.
Objective
This example contains the same user program as example program 4 "OneChannel", but it
operates 2 channels of the module. The user program uses a separate instance of
ABS_CTRL and ABS_DIAG for each channel, a multiple instance is not possible. The user
program expects a channel number as input parameter. The DB numbers for channel and
diagnostic DBs associated with this channel are stored as constants in the program and can
by adjusted by you.
Requirements
You have assigned the channel 1 parameters as described in "Getting Started". Use Edit >
Copy channel to copy channel 1 to channel 2. If necessary, adapt the parameters of channel
2. Save the hardware configuration and download it to the CPU.
In the channel DB, the address of your module is entered correctly in the MOD_ADDR
parameter, and the channel number is correctly entered in the CH_NO parameter.
In the diagnostic DB, the address of your module is entered correctly in the MOD_ADDR
parameter.
The supplied channel DBs already include the DB number 30 or 31 of the parameter DB for
the machine data in the PARADBNO parameter.
In the data blocks PARADB_1 and PARADB_2 the machine data is stored for in each case
one channel of your system.
In HW Config, enable the diagnostic interrupt for this module with Edit > Object Properties >
Basic Parameters > Interrupt Selection > Diagnostics. Compile the hardware configuration,
and then download it to the CPU.
A variable table is set up for each channel.
Startup
In the startup OB (OB 100) you set the startup identifier (step 0) for the user program in both
instance DBs (USER_DB_1, USER_DB_2).
Operation
The CPU is in STOP. Open the USER_VAT_1 and USER_VAT_2 and transfer their control
values.
Start the CPU (STOP > RUN). You can see how the actual positions of both channels
change.
Error evaluation
As in example program 5 "DiagnosticsAndInterrupts", however separately for each channel.
Technical specifications
Technical specifications
Dimensions and weight
Dimensions W x H x D (mm) 80 × 125 × 120
Weight Approx. 535 g
Current, voltage and output
Current consumption from backplane bus Max. 200 mA
Power loss Typ. 7.9 W
Auxiliary voltage for the encoder supply Auxiliary voltage: 24 V DC (X1, terminal 1)
(permissible range: 20.4 to 28.8 V)
Encoder supply Horizontal installation of S7-300, 20 °C:
– 5.2 V/500 mA (for both channels together)
– 24 V/800 mA (for both channels together)
Horizontal installation of S7-300, 60 °C:
– 5.2 V/500 mA (for both channels together)
– 24 V/600 mA (for both channels together)
Vertical set-up S7-300, 40 °C:
– 5.2 V/500 mA (for both channels together)
– 24 V/600 mA (for both channels together)
Current consumption from 1L+ (without load):
max. 100 mA (X1, terminal 1)
Encoder supply 24 V, uncontrolled
– L+ -2 V (X2/X3, terminal 5)
– Short-circuit protection: yes, thermal
Encoder supply 5.2 V (X2/X3, terminal 6) short-circuit
protection: yes, electronic
Permissible potential difference between input (ground)
and central ground connection of the CPU:
– 60 V AC
– 75 V DC
Auxiliary voltage for the load power supply Auxiliary voltage: 24 V DC (X1, terminal 19)
(permissible range: 20.4 to 28.8 V)
Technical specifications
Supply of the digital inputs and outputs Current consumption from 2L+ (without load):
max. 50 mA (X1, terminal 19)
Permissible potential difference between input of ground
connection 1M (X1, terminal 2) and the central
grounding point (shield): 60 V AC; 75 V DC
– Insulation tested with 500 V DC
Permissible potential difference between input of ground
connection 2M (X1, terminal 20) and the central
grounding point (shield): 60 V AC; 75 V DC
– Insulation tested with 500 V DC
Load voltage incorrect polarity protection Yes
Encoder inputs
Position measuring Incremental
Absolute
Signal voltages Symmetrical inputs: 5 V in accordance with RS 422
Asymmetrical inputs: 24 V/ typically. 4 mA
Input frequency and cable length for symmetrical Max. 400 kHz with 32 m cable length, shielded
incremental encoder with 5 V supply
Input frequency and cable length for symmetrical Max. 400 kHz with 100 m cable length, shielded
incremental encoder with 24 V supply
Input frequency and cable length for asymmetrical Max. 50 kHz with 25 m cable length, shielded
incremental encoder with 24 V supply
Max. 25 kHz with 100 m cable length, shielded
Data baud rate and cable length for absolute encoders Max. 188 kHz with 200 m cable length, shielded
Max. 375 kHz with 100 m cable length, shielded
Max. 750 kHz with 40 m cable length, shielded
Max. 1.5 MHz with 12 m cable length, shielded
Listen-in mode for absolute encoders No
Input signals Incremental: 2 pulse trains, 90° shift, 1 zero pulse
Absolute: Absolute value
Technical specifications
Digital inputs
Number of digital inputs 8
Number of simultaneously controllable digital inputs 8
Galvanic isolation Yes, optocoupler
Status display Yes, green LED for each digital input
Input voltage 0-signal: -3 ... 5 V
1-signal: 11 ... 30 V
Input current 0-signal: ≤ 2 mA (quiescent current)
1-signal: 6 mA
Input delay (1I0, 1I1, 1I2 and 2I0, 2I1, 2I2) 0- → 1-signal: Typ. 3 ms
1-→ 0-signal: Typ. 3 ms
Input delay (1I3 and 2I3) 0- → 1-signal: Typ. 300 µs
1- → 0-signal: Typ. 300 µs
Connection of a 2-wire BERO Supported
Cable length, unshielded (1I0, 1I1, 1I2 and 2I0, 2I1, 2I2) 100 m
Cable length, shielded (1I0, 1I1, 1I2 and 2I0, 2I1, 2I2) Max. 600 m
Cable length shielded (1I3 and 2I3) Max. 100 m
Insulation testing VDE 0160
Digital outputs
Number of outputs 8
Galvanic isolation Yes, optocoupler
Status display Yes, green LED for each digital output
Output voltage 0-signal: 0.5 mA
1-signal: 0.5 A
(permissible range: 5 ... 600 mA)
Lamp load: 5 W
Output delay when output voltage = 0.5 A 0- → 1-signal: max. 300 µs
1- → 0-signal: max. 300 µs
Signal level with 1-signal L+ -0.8 V
Control of a digital input Yes
Control of a count input No, on account of 50 µs missing pulse
Short-circuit protection Yes, thermally clocking
switching threshold 1 A
Limiting of inductive switch-off voltage Typ. L+: -48 V
Switching frequency Resistive load: Max. 100 Hz
Inductive load: Max. 0.5 Hz
Total current of the digital outputs with the horizontal Demand factor 75%:
installation of S7-300 at 20 °C and 60 °C: 3 A
Total current of the digital outputs with the vertical Demand factor 75%:
installation of S7-300 at 40 °C: 3 A
Technical specifications
Unshielded cable length Max. 100 m
Shielded cable length Max. 600 m
Insulation testing VDE 0160
Note
If the 24 V supply voltages are connected via a mechanical contact, the FM 351 issues a
pulse to the outputs. Within the permissible output current range the pulse can amount to
50 µs. You must observe this when you use the FM 351 in connection with fast counters.
Overview
The following table describes encoders that you can connect to the positioning module. The
connection diagrams for these encoders are described in this appendix:
In the chapter ... you will find the pin Connecting cable Comment
assignment for
Connection diagram for Incremental encoder 4 x 2 x 0.25 + 2 x 1 mm2 Incremental encoders:
incremental encoder Siemens Siemens Up=5 V, RS 422
6FX2001-2 (Up=5 V; RS 422) 6FX2001-2
Connection diagram for Incremental encoder 4 x 2 x 0.5 mm2 Incremental encoders:
incremental encoder Siemens Siemens Up=24 V, RS 422
6FX2001-2 (Up=24 V; RS 422) 6FX2001-2
Connection diagram for Incremental encoder 4 x 2 x 0.5 mm2 Incremental encoders:
incremental encoder Siemens Siemens Up=24 V, HTL
6FX2001-4 (Up=24 V; HTL) 6FX2001-4
Connection diagram for Absolute encoder 4 x 2 x 0.5 mm2 Absolute encoder:
absolute encoder Siemens Siemens Up=24 V, SSI
6FX2001-5 (Up=24 V; SSI) 6FX2001-5
Connection diagram
The following figure shows the connection diagram for the incremental encoder Siemens
6FX 2001-2 (Up=5 V: RS 422):
Connection diagram
)0[ (QFRGHU
$
$
%
%
1
12-pin circular connector Socket
1
Siemens 6FX2003-0SU12
Connection side (solder side)
*URXQG
9
6KLHOGRQ 6KLHOGRQ
KRXVLQJ KRXVLQJ
&DEOHၮၮၮPP
Connection diagram
The following figure shows the connection diagram for an incremental encoder Siemens
6FX2001-2 (Up=24 V; RS 422):
Connection diagram
)0[ (QFRGHUV
$
$
%
%
1
Circular connector 12-pin socket
1
Siemens 6FX2003-0SU12
Connection side (solder side)
*URXQG
9
6KLHOGRQ 6KLHOGRQ
KRXVLQJ KRXVLQJ
/LQHၮၮPP
Connection diagram
The following figure shows the connection diagram for an incremental encoder Siemens
6FX2001-4 (Up=24 V; HTL):
Connection diagram
)0[ (QFRGHU
$
%
1
*URXQG
9
Circular connector 12-pin socket
5(
Siemens 6FX2003-0SU12
6KLHOGRQ 6KLHOGRQ Connection side (solder side)
KRXVLQJ KRXVLQJ
&DEOH[[PP
* Pins 10 and 11 are internally bridged.
** Pins 2 and 12 are internally bridged.
Note
To connect a non-SIEMENS incremental encoder in a push-pull configuration (current
sourcing/sinking), observe the following:
Current sourcing: Connect RE (9) to ground (7).
Current sinking: Connect RE (9) to +24 V (5).
Connection diagram
The following figure shows the connection diagram for an absolute encoder Siemens
6FX2001-5 (Up=24 V; SSI):
Connection diagram
)0[ (QFRGHU
'$7
'$7
&/6
&/6
*URXQG
Circular connector 12-pin socket
9
Siemens 6FX2003-0SU12
Connection side (solder side)
6KLHOGRQ 6KLHOGRQ
KRXVLQJ KRXVLQJ
&DEOH[[PP
Data of channel DB
Note
You must not change any data that is not listed in this table.
0 = creep speed
1 = rapid traverse
Increment number for incremental approach mode
Parameter DB data
Note
You must not change any data that is not listed in this table.
Note
You must not change any data that is not listed in this table.
JOB_ERR messages
Error classes
Class 1: Operating error
Operating errors are detected asynchronously to an operator input/control. Operating errors
cause the positioning to be canceled, except in the case of error number 9. Error number 9
causes the positioning to be shut down.
If your CPU does not support the system blocks SFB 52 and SFB 53 with DPV1 functionality
Then use the blocks from the program folder "FM 351,451 ABS V1" to program the FM 351.
You will find a description in this section.
Task
You can assign parameters, control, and commission each channel of the positioning
module via a user program. The following chapter illustrates how to design a user program to
suit your application.
Preparation
1. In SIMATIC Manager, open the block library FMx51LIB and copy the required functions
(FC) and block templates (UDT) to the block container of your project. If the block
numbers are already being used, assign new numbers. The block names are entered
unchanged in the symbol table of your S7 program.
Name Meaning
FC ABS_INIT (FC 0) Required to initialize the channel DB after a module start-up
FC ABS_CTRL (FC 1) Required for data exchange and for controlling
FC ABS_DIAG (FC 2) Required if you are processing detailed diagnostic information
in the program or want to make this available for a operator
control and monitoring system
UDT ABS_CHANTYPE(UDT 1) Required in order to create a channel DB for each channel;
this is then used by the FC ABS_INIT and FC ABS_CTRL
UDT ABS_DIAGTYPE (UDT 2) Required in order to create a diagnostic DB for each module;
this is then used by the FC ABS_DIAG
UDT ABS_PARATYPE(UDT 3) Required in order to create a parameter DB with parameters;
this is then used by the FC ABS_CTRL in order to write or
read machine data and increment tables
2. Create the data blocks (DBs) using the UDTs in the block container of your S7 program:
– a separate channel DB for each channel.
– If you want to write or read parameters using the user program, you need a separate
parameter DB for each channel.
– If you would like to execute the diagnostics using the user program, you require only a
diagnostic DB for each module.
3. Enter the module address in the associated channel DB and, if necessary, also in the
corresponding diagnostic DB in the "MOD_ADDR" parameter.
Proceed as follows to enter the module address:
– Recommended procedure:
Assign the module address to the channel DB/diagnostic DB in the user program so
that the assignment of the module address takes place when you call the user
program in OB 100.
– Alternative procedure:
You can have the module address entered automatically if you select the module in
HW Config, open the "Properties" dialog with the menu command Edit > Object
Properties, and use the "Mod_Adr" button there to select a channel DB and diagnostic
DB, if necessary. But in this case the values entered in the channel DB/diagnostic DB
(including the module address) are reset to their initial values in the event of a
consistency check (menu command Edit > Check block consistency opens the "Check
block consistency" dialog) followed by a compilation (menu command Program >
Compile All in the "Check block consistency" dialog box).
The values are not changed if there is only a consistency check without compilation.
The menu command Edit > Compile All is only required within the consistency check if
the project was last edited with STEP 7 V5.0 Service Pack 2 or later.
4. Enter the channel number and, if necessary, the number of the parameter DB also in the
respective channel DB.
5. If your programming device or PC is connected to a CPU, you can now download the
FCs and DBs to the CPU.
The following figure shows you how the positioning module, FCs, DBs and OBs
communicate with each other.
)&$%6B,1,7 )&$%6B&75/
-REV
)XQFWLRQVZLWFKHV
&RQWUROVLJQDOV
'%B12 '%B12 )HHGEDFNVLJQDOV
&KDQQHO'%
&KDQQHO'%
3$5$'%12
3DUDPHWHU'%
)&$%6B',$*
'LDJQRVWLFVEXIIHU
'%B12
'LDJQRVWLF'%
*) The module address (channel DB/diagnostic DB) entered in the "MOD_ADDR" parameter is used for accessing the
module. We recommend you assign the module address to the channel DB/diagnostic DB in the user program so
that the assignment of the module address takes place when you call the user program in OB 100.
Figure D-1 Data exchange between FCs, DBs and positioning module
Task
The FC ABS_INIT deletes the following data in the channel DB:
● The control signals
● The checkback signals
● The trigger bits, done bits, and error bits of the jobs
● The function switches and their done bits and error bits
● The job management for the FC ABS_CTRL
Call
The function must be run through for each channel after start-up (supply voltage on) of the
module or the CPU. Call the function, for example, in the start-up OB 100 and the
insertion/removal OB 83 or the initialization phase of your user program. This ensures that
your user program does not access obsolete data after a CPU or module restart.
Call parameters
Return values
The specified function does not supply a return value.
Tasks
With the FC ABS_CTRL you can read the operating data for each channel of the module.
You can also configure the channels and control them during operation. To do this, use the
control signals, checkback signals, function switches as well as the write and read jobs.
With each call the function carries out the following activities:
● Reading checkback signals:
The FC ABS_CTRL reads all the checkback signals for a channel and enters them in the
channel DB. Because the control signals and jobs are not executed until after this step,
the checkback signals reflect the status of the channel before the block was called.
● Job management:
The FC ABS_CTRL processes the read and write jobs and transfers the data between
the channel DB, parameter DB and the module.
● Writing control signals:
The control signals that are entered in the channel DB are transferred to the module.
Call
The FC ABS_CTRL must be called cyclically for each channel, e.g., in OB 1.
Before you call the FC ABS_CTRL, enter all the data required to execute the intended
functions in the channel DB.
Call parameters
Return values
The function provides the following return values:
RET_VAL BR Description
1 1 At least 1 job is active
0 1 No job is active, no error
-1 0 Error: Data error (DATA_ERR) or
communication error (JOB_ERR) has occurred
Jobs
Data exchange with the module other than the control and checkback signals is handled
using jobs.
To deliver a job you set the respective trigger bit in the channel DB and in the case of write
jobs also the respective data. Then call the FC ABS_CTRL in order to execute the job.
If you are using the FM 351 centrally, a read job requires exactly one cycle. If you are using
the FM 351 as a distributed module, a read job can require several cycles.
On account of the necessary acknowledgements of the module, a write job requires at least
3 calls or OB cycles.
When a job is finished, the block takes back the trigger bit. The next time the block is called,
the following job will be ascertained and executed.
For each job, there is not only a trigger bit (extension _EN as in "enable") but also a done bit
and an error bit. These have the extension _D as in "done" and _ERR as in "error" in their
names. The FC ABS_CTRL updates the done bits and error bits once the processing of a job
has ended. After the evaluation or prior to issuing a job, these bits should be set to 0.
If you set the JOBRESET bit, all the done bits and error bits will be reset prior to processing
the awaiting jobs. The JOBRESET bit is then set back to 0.
Function switch
The function switches switch the states of the channel on and off. A job for writing the
function switches will only be executed when there is a change in a switch setting. The
setting of the function switch is retained after the job has been executed.
Function switches and jobs can be used simultaneously with a call of the FC ABS_CTRL.
As in the case of the jobs, alongside the function switches there are trigger bits with the
ending _ON / -OFF, done bits with the ending _D and error bits with the ending _ERR.
To be able to evaluate the done bits and error bits of the function switches, you should set
these bits to 0 before you issue a job to change a function switch.
This order enables you to completely trigger a positioning with a set of jobs and control
signals. The jobs go from writing and activating the machine data through the setting of the
external enable input up to writing the increments for the incremental approaches.
Control signals
If there is a STOP signal, an operator error or a drive enable is missing, the block resets the
control signals START, DIR_M and DIR_P.
You can restart a motion after you have acknowledged the operator error with
OT_ERR_A=1. With this acknowledgement you cannot submit any other jobs and control
signals.
If there is no operator error pending, the block sets the acknowledgement for the operator
error OT_ERR_A to 0.
The block resets the START, DIR_P, and DIR_M start signals when the channel signals the
start of the motion, except in "jog" mode.
If the axis parameters are not assigned, the block withholds all the control signals with the
exception of the OT_ERR_A operator error acknowledgement.
Start-up
On start-up of the module or the CPU, call the FC ABS_INIT. Among other things, this resets
the function switches. The FC ABS_CTRL acknowledges the module start-up. During this
time the RET_VAL and JOBBUSY = 1.
Job status
The status of the job processing can be read off from the return value RET_VAL and from
the active bit JOBBUSY in the channel DB. The status of an individual job can be evaluated
using the trigger bits, done bits, and error bits of this job.
Response to errors
If faulty data are written during a write job, the channel issues the checkback signal
DATA_ERR = 1 to the channel DB. If an error occurs during communication with the module
in a write or read job, the cause of error is stored in the JOB_ERR parameter in the channel
DB.
● Error with a write job:
If an error occurs in a job, the trigger bit is canceled and error bit _ERR and done bit _D
are set. The trigger bit is also canceled for all write jobs still pending, but only error bit
_ERR is set. The awaiting write jobs will be withdrawn because jobs could stack up on
top of each other.
The awaiting read jobs will continue to be processed. In doing so, the JOB_ERR is then
reset for each job.
● Error with a read job:
If an error occurs in a job, the trigger bit is canceled and error bit _ERR and done bit _D
are set.
The awaiting read jobs will continue to be processed. In doing so, the JOB_ERR is then
reset for each job.
For further error information, refer to JOB_ERR and DATA_ERR parameter descriptions in
the section entitled "Diagnosis (Page 137)".
Program structure
The following figure shows the basic structure of a user program used to cyclically control a
channel of a module following a one-time startup initialization. The return value RET_VAL of
the FC ABS_CTRL is used in the user program for a general error evaluation.
For every other channel a sequence in accordance with the following figure can be executed
parallel and independently.
,QLWLDOL]DWLRQ
2QHWLPHFDOO
HJ2%
&DOO)&$%6B,1,7
-REVVWLOORSHQ"
1R
6HWMREGDWDDQGMREWULJJHUELWV <HV
6HWFRQWUROVLJQDOV
&DOO)&$%6B&75/
HJ2%
&\FOLFFDOO
!
1H[WMRE
Tasks
With the FC ABS_DIAG you read out the diagnostic buffer of the module and make it
available for a display in the operator control and monitoring system or for a programmed
evaluation.
Call
The function must be called cyclically, e.g., in OB 1. An additional call in an interrupt OB is
not permitted. At least two calls (cycles) are required for a complete execution of the
function.
The function reads out the diagnostic buffer when a new entry in the diagnostic buffer is
indicated by means of the checkback signal DIAG = 1 in the channel DB. After the diagnostic
buffer is read, the DIAG bit in the channel DB of the module is set to 0.
Call parameters
Return values
The function provides the following return values:
RET_VAL BR Description
1 1 Job active
0 1 No job is active, no error
-1 0 Error
Jobs
You can read the diagnostic buffer independent of a new entry by setting the trigger bit
DIAGRD_EN in the diagnostic DB. After the diagnostic buffer is read, the trigger bit is set to
0.
Carry out this job after a CPU start-up and a module start-up. This way you can ensure that
the content of the diagnostic DB corresponds with the content of the module´s diagnostic
buffer, even if the module has not made a new entry in the diagnostic buffer.
Start-up
The function does not perform a start-up processing.
Response to errors
In the case of a faulty execution, the cause of the error can be found in the diagnostic DB in
the JOB_ERR parameter; refer to the section entitled "Diagnosis (Page 137)".
D.6.2 Channel DB
Task
The channel DB is the data interface between the user program and the FM 351. It includes
and accepts all the data that is required for controlling and operating a channel.
Structure
The channel DB is divided into different areas:
Channel DB
Module address *)
Channel number
Number of the parameter DB
Control signals
Checkback signals
Function switch
Trigger bits for write jobs
Activation bits for read jobs
Done bits
Error bits
Job management for functions
Data for jobs
*) You can also enter the address using the configuration software
D.6.3 Diagnostic DB
Task
The diagnostic DB (refer to the section entitled Data and structure of the diagnostic DB) is
the data storage for the FB ABS_DIAG and includes the diagnostic buffer of the module that
has been processed by this function block.
Structure
Diagnostic DB
Module address
Internal data
Job status
Trigger bit
Processed diagnostic buffer
D.6.4 Parameter DB
Task
If you want to change the machine data and increment tables during operation, you require a
parameter DB in which this data is stored. The parameters can be changed from the user
program or from an operator control and monitoring system.
You can export the data displayed in the configuration software into a parameter DB. You
can also import a parameter DB into the configuration software and view it there.
Each module channel can have several sets of parameter assignment data, e.g., for different
recipes. You can switch among these in your program.
Structure
Parameter DB
Machine data
Increment tables
D.7 Technical specifications of the FCs and DBs for the FM 351
Technical specifications
The following table offers you an overview of the technical specifications for the functions
and data blocks.
Table D- 1 Technical specifications of the functions and data blocks for the FM 351
No. Block name Version Assignment in Assignment in Assignment in local MC7 Called
load memory work memory data area code / system functions
(bytes) (bytes) (bytes) data
(bytes)
FC 0 FC ABS_INIT 1.0 184 130 2 94
FC 1 FC ABS_CTRL 1.0 4548 4176 34 4140 SFC 58:
WR_REC,
SFC 59: RD_REC
FC 2 FC ABS_DIAG 1.0 1800 1658 42 1622 SFC 59: RD_REC
Channel DB - 638 184 - 148
Parameter DB - 840 556 - 520
Diagnostic DB - 524 388 - 352
Module cycle
The checkback signals of a channel are updated by the module every 8 ms.
Application
In special applications or in an alarm level, a particularly fast access to checkback and
control signals could be required. You can reach this data directly via the input and output
areas of the module.
For start-up coordination, after each start-up of the module (e.g. after connecting the module,
after CPU STOP → RUN) you must call the FC ABS_CTRL until the end of the start-up is
indicated by RET_VAL = 0. After this you must not use the FC ABS_CTRL any more.
Note
It is not possible to use the FC ABS_CTRL together with a write access.
STL
L PED 516 Read the current actual position value (ACT_POS) from channel 1
with direct access:
Start address of the channel + 4
STL
L 2#10001000 Set DRV_EN and DIR_P to 1
T PAB 521 Write signals with direct access for channel 2:
Start address of the module +8 + 1
E
D 8VHU
3DUD
&RQILJXULQJ 3DUDPHWHU PHWHU SURJUDP
VRIWZDUH '% D
'%
E
$%6B&75/
+:&RQILJ
3DUDPHWHUV
C
A Calculation
Absolute encoder, 134 Resolution, 85
Data Transmission, 134 Call
Increments per encoder revolution, 79 FB ABS_CTRL, 39
Message frame times, 135 FB ABS_DIAG, 46
Monoflop time, 135 FC ABS_CTRL, 206
Parity check for absolute encoders, 78 FC ABS_DIAG, 212
Pulse evaluation, 134 FC ABS_INIT, 38, 205
Response times, 135 Call parameters
Absolute encoder adjustment, 82 FB ABS_CTRL, 40
Alternative, 84 FB ABS_DIAG, 46
Determining, 82 FC ABS_CTRL, 206
Example, 83 FC ABS_DIAG, 212
Actual monitoring time, 72 FC ABS_INIT, 38, 205
Actual position value (ACT_POS) Cancel, 98
Example, 52, 218 Incremental approach, 116
Ambient temperatures, 19 Jogging, 101
Applications Reference point approach, 106
Parameter transmission, 54, 220 Set actual value, 118
Assigning parameters, 57 Cancel set actual value, 117
Requirement, 33 Data in channel DB, 118
Assignment Changeover difference, 16
Front connector, 24 Changeover difference minus, 70
Sub D sockets, 22 Changeover difference plus, 70
Asymmetrical output signals, 131 Changeover point, 16
Asynchronous errors, 138 Changing
Auxiliary voltage Increment tables, 63
Encoder supply, 24 Machine data, 62
Load power supply, 25 Channel DB, 48, 214
axis Content, 179
Machine data, 73 Preparing, 59
Axis data, 73 Structure, 48, 214
Task, 48, 214
Checkback signal in the channel DB
B End of a positioning, 98
Checkback signals
b_28, 78 Direct access, 51, 217
Baud rate, 80 Reading, 39, 51, 206, 217
Block library, 202 Checkback signals for the diagnostics, 129
Block templates, 36, 48, 202, 214 Data in the channel DB, 129
Blocks Sequence, 129
Downloading, 59 Checkback signals for the positioning
Data in the channel DB, 128
Sequence, 128
FC 2 H
FC ABS_DIAG, 212
Hardware limit switch, 21
FC ABS_CTRL, 206
HW installation, 56
Call, 206
Call parameters, 206
Control signals, 209
I
Data blocks used, 206
Error response, 210 INC_REV, 79
Function switch, 207 Increment, 132
Jobs, 207, 209 Increment number 1 to 100, 88
Return values, 207 Increment number 1-100, 110
Tasks, 206 Increment number 254, 89, 111
FC ABS_DIAG, 212 Increment number 255, 89, 112
Call, 212 Increment table 1, 185
Call parameters, 212 Increment table 2, 185
Data block used, 212 Increment tables
Error response, 213 Changing, 63
Jobs, 213 First parameter assignment, 62
Return values, 212 Reading, 62, 63
Start-up, 213 Writing, 62
Tasks, 212 Incremental approach, 109
FC ABS_INIT, 38, 205 Absolute, 109
Call, 38, 205 Cancel, 116
Call parameters, 38, 205 Data in the channel DB, 114, 116
Data block used, 38, 205 Data in the parameter DB, 115
Return values, 38, 205 Increment number 1-100, 110
Tasks, 38, 205 Increment number 254, 111
FCs and DBs Increment number 255, 112
Technical specifications, 216 Relative, 109
FCs, FBs, and DBs Requirement, 109
Technical specifications, 50 Shutdown, 115
Fictitious target, 123 Incremental approach with increment number 254
First parameter assignment Sequence, 111
Increment tables, 62 Incremental approach with increment number 255
Machine data, 61 Sequence, 112
FM 351 Incremental encoder, 131
Installing, 19 Increments per encoder revolution, 79
removing, 20 Missing pulses, 81
Startup, Response times, 133
Start-up, Signal forms, 131
Technical specifications, Increments, 61, 87
FM 351 positioning module, 12 Requirement, 87
Frame error, 81 Indecision, 133, 136
Frame length, 77 Initialize module
Front connector, 24 Example, 158
Assignment, 24 Installation guidelines, 167
Wiring, 30 Installing
Function switch Configuration package, 33
FB ABS_CTRL, 41 FM 351, 19
FC ABS_CTRL, 207
Functions, 36, 202
J M
Job Machine data, 61, 184
Cancel set actual value, 117 axis, 73
Set actual value, 117 Baud rate, 80
Set reference point, 119 Changing, 62
Job management, 39, 206 Counting direction, 80
job processing Distance per encoder revolution, 78
Order, 41 Drive, 67
Job processing Enabling, 61
Order, 208 Encoder, 77
Job status, 43, 210 Encoder type, 77
JOB_ERR First parameter assignment, 61
Messages, 188 Frame length, 77
Jobs Increments per encoder revolution, 79
FB ABS_CTRL, 40, 42 Monitoring, 81
FB ABS_DIAG, 47 Number of encoder revolutions, 79
FC ABS_CTRL, 207, 209 Parity check for absolute encoders (SSI), 78
FC ABS_DIAG, 213 Reading, 62
Jogging, 99 Writing, 61
Cancel, 101 Maximum cable length, 80
Configuring, 99 Mechanical adjustment
Data in the channel DB, 100 Encoder, 84
Operating range limit, 102 Message frame times
Requirement, 99 Absolute encoder, 135
Sequence, 99 Messages
Shutdown, 101 JOB_ERR, 188
Missing pulses
Incremental encoder, 81
L Module cycle, 50, 216
Module data
LED CH 1, 139
Fast access, 51, 217
LED CH 2, 139
MON_FRAME, 81
Length of cable
MON_PULSE, 81
maximum, 80
MON_WIRE, 81
Load circuit, 27
Monitoring, 81, 91
Load power supply, 25
Standstill velocity, 92
Auxiliary voltage, 25
Target range, 91
Location of fictitious target, 123
Monitoring time, 72, 91, 93
Loop approach, 121
Monoflop time
Data in the channel DB, 122
Absolute encoder, 135
Requirement, 121
Motor, 11
Sequence, 121
Motor circuit-breaker, 21
Mounting position
Mounting rail, 19
Mounting rail
Mounting position, 19
Multiturn encoders, 134
N Project
Setting up, 55
NO_REV, 79
Protective circuit, 27
Non-isolation, 31
Pulse, 132
Pulse evaluation
Absolute encoder, 134
O
Operating mode
Incremental approach, 109 R
Jogging, 99
Range of values
Reference point approach, 103
Resolution, 85
Operating principle
Read jobs, 42, 208
Contactor circuit, 28
Read position data
Operating range, 16, 76
Sequence, 126
Operating range limit
Reading
Jogging, 102
Checkback signals, 39, 51, 206, 217
Order
Increment tables, 62, 63
job processing, 41
Machine data, 62
Job processing, 208
Reference point approach, 103
Output signal
Cancel, 106
asymmetrical, 131
Data in the channel DB, 105
symmetrical, 131
Data in the parameter DB, 106
Overall number of steps of the encoder, 79
Effects, 106
Overview
Requirement, 103
Diagnostic interrupts, 147
Synchronization, 103
Overvoltage protection
Types, 106
Example, 29
Reference point switch, 24, 103
Reference velocity, 72
Relationship
P
Traversing range, 86
Parameter DB Removing
Areas, 49, 215 FM 351, 20
Content, 184 Requirement
Structure, 49, 215 Assigning parameters, 33
Task, 49, 215 Encoder data, 127
Parameter transmission Incremental approach, 109
Applications, 54, 220 Increments, 87
Position Jogging, 99
Sub D sockets, 22 Loop approach, 121
Position data, 126 Reference point approach, 103
Data in the channel DB, 126 Set actual value, 117
Positioning Set reference point, 119
End, 91 Resolution, 85
Power section device, 11 Calculation, 85
Power unit, 27 Example, 86
Preparing Range of values, 85
Channel DB, 59 Traversing range, 86
Diagnostic DB, 59 Response of the FM 351
Programming, 56 Diagnostic interrupts, 147
Program structure, 45, 211 Response times
Programming, 36, 202 Absolute encoder, 135
Preparing, 56 Incremental encoder, 133
T W
Target, 16 Wire break, 81
Target approach, 93 Wiring, 56
Target range, 16, 71 Front connector, 30
Monitoring, 91 Wiring information, 25
Task WORKING, 91
Channel DB, 48, 214 Write jobs, 41, 208
Diagnostic DB, 49, 215 Writing
Parameter DB, 49, 215 Control signals, 39, 206
Tasks Control signals, 39, 206
FB ABS_CTRL, 39 Control signals, 39, 206
FB ABS_DIAG, 46 Increment tables, 62
FC ABS_CTRL, 206 Machine data, 61
FC ABS_DIAG, 212
FC ABS_INIT, 38, 205
Technical specifications X
FCs and DBs, 216
X1, 24
FCs, FBs, and DBs, 50
X2, 22
FM 351, 50, 216
X3, 22
General, 167
Test sequence
Example, 153
Test steps
Function switch, 58
Jobs, 58
Operating modes, 58
Traversing range, 76
Relationship, 86
Resolution, 86
Type of reference point approach, 75
Types
Reference point approach, 106
Types of error, 138
U
UDT, 48, 214
User program
Error evaluation, 141