5. Download the parameter data to your CPU while it is in STOP mode with PLC
4.4 Functions for Positioning with Digital Outputs
4.6.1 System Function Block(SFB): Error Messages
• Diagnostics interrupt
4.6.1 System Function Block(SFB): Error Messages
The SFB indicates the errors listed in the table below.
Save for system errors, all errors are specified in closer detail via an error ID that is available as output parameter at the SFB.
Type of error Errors are displayed via SFB parameters
The error ID is displayed in the SFB parameters
Operating mode error ERROR = TRUE STATUS
Job error JOB_ERR = TRUE JOB_STAT
External error ERR > 0 ERR
System error BIE = FALSE -
Operating Mode Error (ERROR = TRUE) This error occurs
on general parameter assignment errors at the SFB (e. g. the wrong SFB is used)
•
• at run start/resume. These errors occur during the interpretation of operating mode parameters.
When an error is detected, the output parameter ERROR is set TRUE.
The error cause is indicated in the STATUS parameter.
Possible error IDs are found in Chapter 4.8.2, page 4-62.
Job Error (JOB_ERR = TRUE)
Job errors can only occur during job interpretation/execution.
When an error is detected, output parameter JOB_ERR is set TRUE.
The error cause is indicated in the JOB_STAT parameter.
Possible error IDs are found in Chapter 4.8.2, page 4-62.
长沙工控帮教育科技有限公司整理
External Errors (ERR)
The system monitors the run, traversing range and the connected I/O. Prerequisite is here that you have switched on monitoring in the "Drive", "Axis" and "Encoder"
parameter assignment screen forms.
An external error is reported when monitoring responds.
External errors can occur at any time, regardless of the started functions.
You must acknowledge external errors with ERR_A (positive edge) .
External errors are indicated at the SFB parameter ERR (WORD) by setting a certain bit.
Monitoring ERR Bit in ERR-WORD Missing pulse (zero mark) 0004 hex 2
Travel range 0800 hex 11 Working range 1000 hex 12 Actual value 2000 hex 13 Target approach 4000 hex 14 Target range 8000 hex 15
The result of the recognition of an external error ("incoming" and "outgoing") can also be a diagnostic interrupt (see Chapter 4.6.2, page 4-57).
System Error
A system error is indicated with BIE = FALSE.
A system error is triggered via:
Read/write error at the instance DB
•
• Multiple calls of the SFB
Error Evaluation in the User Program
1. Call the error handling routine "Error evaluation" (see the view).
2. Query the individual error types in successive order.
3. If required, jump to the error reaction method that is specifically adapted to your application.
长沙工控帮教育科技有限公司整理
BIE = FALSE?
ERROR = TRUE?
Yes
No
Evaluate STATUS No
Yes
ERR > 0?
Evaluate ERR-WORD, correct errors and acknoweledge with
ERR_A=TRUE No
Yes
JOB_ERR = TRUE?
Evaluate JOB_STAT No
Yes Call SFB Evaluating errors:
System Reaction
长沙工控帮教育科技有限公司整理
4.6.2 Diagnostic Interrupt
If one of the following errors occur you can trigger a diagnostic interrupt:
Parameter assignment error (Module data)
•
•
•
•
External error (Monitoring)
The diagnostic interrupt is displayed in the event of incoming as well as outgoing errors.
Your user program can respond instantaneously to errors with the help of this diagnostic interrupt.
Procedure
1. In the parameter assignment screen forms, enable the diagnostic interrupt in the "Basic parameters" dialog.
2. In the "Drive", "Axis" and "Encoder" parameter assignment screen forms, switch on the individual monitoring functions which should trigger a diagnostic Interrupt when an error occurs.
3. In the parameter assignment screen form "Diagnostics", enable diagnostic interrupts for each monitoring facility individually.
4. Implement the diagnostic interrupt OB (OB 82) in your user program.
Responding to Errors with Diagnostic Interrupts Positioning is aborted.
The CPU operating system calls OB 82 in the user program.
Note
The CPU switches to STOP mode if the OB has not been loaded when an interrupt is triggered.
The CPU switches on the SF LED.
•
• The CPU reports the error as "incoming" in its diagnostic buffer. An error is only identified as "outgoing" after all errors pending have been eliminated.
长沙工控帮教育科技有限公司整理
Evaluation of a Diagnostic Interrupts via User Program
When a diagnostic interrupt was triggered, you can evaluate OB 82 to determine the current diagnostic interrupt.
If the module address of the "Positioning" submodule was entered in OB 82, byte 6 + 7 (OB 82_MDL_ADDR), the diagnostic interrupt was triggered by the positioning function of your CPU.
•
•
•
•
•
Bit 0 in byte 8 of OB 82 (Faulty module) is set if at least one more error is pending.
In OB 82, byte 8, bit 0 is reset after all errors have been reported "outgoing".
You can determine the precise cause of error by evaluating data record 1, byte 8 and 9. To do this, you must call SFC 59 (read data record).
Acknowledge the error with ERR_A.
Data record 1, byte 8 Description: JOB_STAT ERR
Bit 0 not used - -
Bit 1 not used - -
Bit 2 Missing pulse* - X
Bit 3 not used - -
Bit 4 not used - -
Bit 5 not used - -
Bit 6 not used - -
Bit 7 not used - -
Data record 1, byte 9 Description: JOB_STAT ERR
Bit 0 Parameter assignment error X -
Bit 1 not used - -
Bit 2 not used - -
Bit 3 Traversing range monitoring X X
Bit 4 Working range monitoring X X
Bit 5 Actual value monitoring* X X
Bit 6 Target approach monitoring* X X
Bit 7 Target range monitoring* X X
* the following errors trigger an incoming and then automatically an outgoing interrupt.
长沙工控帮教育科技有限公司整理
4.7 Examples
The examples (Program and description) are found on the CD-ROM included with your documentation. You can also download them via the Internet. The project consists of several commented S7 programs of various complexity and aiming points.
The Readme.wri on the CD describes how to install the samples. After installation the examples are stored in the catalog
...\STEP7\EXAMPLES\ZDt26_03_TF_____31xC_Pos.
长沙工控帮教育科技有限公司整理
4.8 Technical Data 4.8.1 Incremental Encoders
Connectable Incremental Encoders
Supported are asymmetrical 24-V incremental encoders with/without zero mark that have two pulse tracks with an electrical phase difference of 90°.
Encoder inputs Pulse width min.
Interpulse width min Input frequency max. Cable length max. (at max.
input frequency)
Encoder signal A, B 8.33 µs 60 kHz 50 m
Encoder signal N
(zero mark signal) 8.33 µs 60 kHz / 30 kHz1) 50 m
1) When you are using an encoder whose zero mark is logically "AND" linked to the encoder signals A and B, the pulse width is reduced by half to 25% of the period. In order to maintain the minimum pulse width, the maximum counting frequency must be reduced to30 kHz.
Signal Evaluation
The view shows the signal profile of encoders with asymmetrical output signals:
Asymmetric A
B
C
The CPU internally generates a logical AND link of the zero mark signal and the A and B track signals.
The CPU uses the positive edge at the zero mark for referencing.
The CPU counts in positive direction if the signal A transition leads signal B.
长沙工控帮教育科技有限公司整理
Increments
An increment identifies a signal period of the two encoder signals A and B. This value is specified on the rating plate and/or in the technical data of the encoder.
A
B
4x decoding Pulses
Signal period = Increment
1 2 3 4
Pulses
The CPU evaluates all four edges of the signals A and B (see the view) at every increment (quadruple evaluation). That is, one encoder increment is proportional to four pulses.
Wiring Diagram of the Incremental Encoder Siemens 6FX 2001-4 (Up = 24 V;HTL) The figure below shows the wiring diagram of the incremental encoder
Siemens 6FX 2001-4xxxx (Up = 24 V; HTL):
Housing Shield on housing
4.8.2 Error Lists
If an error occurs, an error ID is output at the SFB parameters STATUS or JOB_STAT. This error ID consists of the event class and event number.
Example
The view below shows the content of the STATUS parameter for the event "Wrong target specified" (Event class: 34H, Event number 02H).
Event
class: 34H Event number (Error number): 02H STATUS
27 20
20 27
0 0
1 1 0
0 0 1 0 0 0 0 0 0 0 1 0
Error IDs at the SFB Parameter "Status"
Event class 32 (20H):
"SFB error"
Event No. Event text Remedy
(20)01H Wrong SFB Use SFB46
(20)04H Wrong channel number (CHANNEL) Set channel number "0"
Event class 48 (30H):
"General errors at the start of a run"
Event No. Event text Remedy (30)01H Run job rejected because of faulty job in the
same SFB call
Correct the respective JOB parameters
(30)02H It is not allowed to modify MODE_IN while the drive is still in motion.
Wait until the current positioning operation is terminated.
(30)03H Unknown operating mode (MODE_IN) Permitted is:
1 (Jog mode),
3 (reference point approach), 4 (relative incremental approach) and 5 (absolute incremental approach).
长沙工控帮教育科技有限公司整理
Event class 48 (30H):
"General errors at the start of a run"
(30)06H DIR_P or DIR_M is not allowed for a linear axis and in "Absolute incremental
approach" mode
Start the run with START.
(30)07H Axis not synchronized "Absolute incremental approach" is only possible if the axis is synchronized.
(30)08H Moving out of working range Run is only allowed into the direction of the working range .
Event class 49 (31H):
"Run start error (Start enable)"
Event No. Event Remedy
(31)01H Start not enabled because the axis is not configured.
Configure the "Positioning" submodule via HW Config
(31)02H Start not enabled, because drive enable is not set
Set "Start enable" at the SFB (DRV_EN = TRUE)
(31)03H Start not enabled because STOP is set. Clear the STOP at the SFB (STOP = FALSE) (31)04H Start not enabled because the axis
currently performs a positioning run (WORKING = TRUE).
Wait until the current positioning operation is terminated
(31)05H Start not enabled because at least one pending error has not been acknowledged.
First, eliminate and acknowledge all external errors, then restart the run.
Event class 50 (32H):
"Run start error (speed/acceleration)"
Event No. Event Remedy
(32)01H Wrong SPEED selection Only "Creep speed" (0) and "Rapid speed"
(1) is allowed when positioning with digital outputs.
Event class 51 (33H):
"Run start error (Changeover/cut-off differences)"
Event No. Event Remedy
(33)01H Changeover/cut-off differences greater than 108 are not permitted
Specify a changeover/cut-off difference of maximum 108
(33)03H A changeover difference smaller than the cut-off difference is not allowed
The changeover difference must be greater than/equal to the cut-off difference.
(33)04H Cut-off difference too low The cut-off difference must have at least the length of half the target range.
长沙工控帮教育科技有限公司整理
Event class 52 (34H):
Event No. Event Remedy
(34)01H Default target out of working range With a linear axis and absolute incremental approach the default target must lie within the range of the software limit switch (inclusive).
(34)02H Wrong default target For the rotary axis the default target must be greater than 0 and smaller than the end of rotary axis.
(34)03H Wrong default distance With relative incremental approach the traversing distance must be positive.
(34)04H Wrong default distance The result, the absolute target coordinate, must be greater than -5x108 .
(34)05H Wrong default distance The result, the absolute target coordinate, must be smaller than 5x108 .
(34)06H Wrong default distance The result, namely the absolute target coordinate, must lie within the working range (+/-half of the target range)
Event class 53 (35H):
"Run start error (traversing distance)"
Event No. Event Remedy
(35)01H Traversing distance too long The target coordinate + actual distance to go must be greater than/equal to -5x108 (35)02H Traversing distance too long The target coordinate + actual distance to go
must be lower than/equal to 5x108
(35)03H Traversing distance too small The traversing distance in plus direction must be greater than the specified cut-off
difference for the plus direction
(35)04H Traversing distance too small The traversing distance in minus direction must be greater than the specified cut-off difference for the minus direction (35)05H Traversing distance too short or the limit
switch has already been overrun in plus direction
The last approachable target in plus direction (working range/traversing range limits) is too close to the actual position
(35)06H Traversing distance too short or the limit switch has already been overrun in minus direction
The last approachable target in minus direction (working range/traversing range limits) is too close to the actual position
长沙工控帮教育科技有限公司整理
Error IDs at the SFB Parameter "JOB_STAT"
Event class 64 (40H):
"General job execution error"
Event No. Event Remedy
(40)01H Axis not configured Configure the "Positioning" submodule via HW Config.
(40)02H Job not possible because positioning is still running
Jobs can only be executed if no positioning run is active. Wait until WORKING = FALSE and then repeat the job.
(40)04H Unknown job Check the Job ID and repeat the job.
Event class 65 (41H):
"Error when executing the request to set the reference point"
Event No. Event Remedy
(41)01H Reference-point coordinate out of working range
With a linear axis the reference point coordinate must not exceed the working range limits.
(41)02H Wrong reference point coordinate With a linear axis the specified reference point coordinate + actual distance to go must still be greater than/equal to -5x108.
(41)03H Wrong reference point coordinate With a linear axis the specified reference point coordinate + actual distance to go must still be smaller than/equal to 5x108.
(41)04H Wrong reference point coordinate With a linear axis the specified reference point coordinate + actual difference to the starting point of the run must still be greater than/equal to -5x108.
(41)05H Wrong reference point coordinate With a linear axis the specified reference point coordinate + actual difference to the starting point of the run must still be smaller than/equal to 5x108 .
(41)06H Reference-point coordinate out of rotary axis range
With a rotary axis the reference point coordinate must not be lower than 0 and greater than/equal to the end of rotary axis.
External Errors (ERR)
External errors are indicated at the SFB parameter ERR (WORD) by setting a bit.
Monitoring ERR Bit in ERR-WORD
Missing pulse (zero mark) 0004 hex 2