Unity Diagnostics
Unity Diagnostics
Diagnostics
At a Glance
Unity Pro diagnostics consist of a set of tools and functionalities which allow you to intervene at all stages in the development and use of an automation application.
The different resources available are as follows:
Language Objects (IODDTs).
Diagnostics screens.
The Diagnostics Viewer.
System diagnostics.
Project diagnostics (diagnostic EFBs and DFBs).
Resource Use
Language objects Language objects are diagnostics tools which can be used in a project to ascertain the status of a channel
or module (for example the error bit for channel 1 of the module located in slot 2 of rack 3: %I3.2.1.ERR).
These objects are described at the end of the documentation for each module. In general they are used in
the form of IODDT variables.
Diagnostics screens The diagnostics screens can be accessed from the configuration editor for the processor and the
application-specific modules. To access the desired diagnostics screen double-click on the element
(processor or module) then select the Fault tab. The fault information messages are generally very clear
(for example: Range over/undershoot on an analog channel).
The Diagnostics Viewer for Unity Pro The Diagnostics Viewer is a tool which can be used to view the alarms generated by the system
diagnostics and the diagnostic DFBs. There is a Diagnostics Viewer built into Unity Pro but there are also
Diagnostics Viewers available for Magelis HMI terminals or via Factory Cast applications.
System diagnostics System diagnostics is a service which combines the use of system bits and words with the Diagnostics
Viewer. When a project has been built with the System Diagnostics option,
option the system bits and words
automatically generate diagnostics messages in the Diagnostics Viewers.
Project diagnostics Project diagnostics consist of specific EFBs and DFBs which are embedded in the code of an automation
(diagnostics EFBs and DFBs and SFC diagnostics) project to provide the user or maintenance personnel with clear information on the operating conditions of
the monitored process. These program elements will trigger alarms which can be viewed in the
Diagnostics Viewers.
SFC diagnostics go hand in hand with the system diagnostics, which are an intrinsic part of SFC and
enable step activity times to be monitored.
Advantages
The main advantages of these services are as follows:
Diagnostics are an integral part of the project. It can therefore be thought out at the development stage in order to be able to best meet the requirements of the user
and maintenance personnel.
Errors are logged and dated at source (in the PLC), meaning that the information provided is an exact representation of the state of the process.
You can connect several Viewers (Unity Pro, Magelis, Factory Cast) which will describe the exact state of the process to the user. Each Viewer works independently
and any action taken with one (an acknowledgment for example) is automatically visible on the others.
Diagnostics screens
file://C:\Users\sesa60911\AppData\Local\Temp\~hhA391.htm 12-08-2014
Diagnostics Page 2 of 13
At a Glance
The diagnostic screens on the module or channel are only accessible in connected mode. When an un-
un-masked fault appears, this is reported:
in the configuration screen of the rack, with the presence of a red square in the position of the faulty counting module,
in all screens at module level (Description
Description and Fault tabs),
in the module field with the I/O LED.
in all channel level screens (Configuration
Configuration,
Configuration Adjustment,
Adjustment Debug and Fault tabs),
in the module field with the I/O LED.
in the channel field with the channel fault LED.
in the fault screen that is accessed by the Fault where the fault diagnostics are described.
The fault is also reported:
on the module, through the centralized viewing,
%MWr.m.MOD.2 etc., and the status words.
with the dedicated language objects: CH_ERROR (%Ir.m.c.ERR) and module error MOD_ERROR (%Ir.m.MOD.ERR), %MWr.m.MOD.2,
NOTE: even if the fault is masked (TSX CTY 2C), it is reported by the flashing of the LED I/O and in the fault screen.
Illustration
The diagram below shows the fault reporting structure.
At a Glance
The messages displayed on the diagnostics screens are used to assist in debugging the project. These messages must be concise and are sometimes ambiguous (as
different faults may have the same consequences).
These diagnostics are on two levels: module and channel, the latter being the most explicit. The lists below show the message headings with suggestions for finding out
what is wrong.
file://C:\Users\sesa60911\AppData\Local\Temp\~hhA391.htm 12-08-2014
Diagnostics Page 3 of 13
Self-test The module is running a self-test. Wait until the self-test is complete.
Note: For Modicon M340, if the Xbus line termination are missing, the module will stay in this state.
Different hardware and software There is a lack of compatibility between the module configured and the module in the rack.
configurations Make the configuration and the software configuration compatible.
Module is missing or off Install the module. Fasten the mounting screws.
Counting application fault: Diagnose the fault more precisely (external causes).
measurement overrun Check the application again, if necessary.
overspeed Delete the fault and acknowledge if the fault storing is configured (CTY 2C).
Outputs are set to 0 in automatic mode. Counting pulses or incremental encoder: preset or reset to acknowledge the Invalid measurement
Invalid measurement message. message.
Internal fault or channel self-test: Module fault has gone down to channel level.
faulty module, Refer to module level diagnostics.
module missing or off,
module running self-test.
Different hardware and software configurations Module fault has gone down to channel level.
Refer to module level diagnostics.
Application fault: refusal to configure or adjust Diagnose the fault more precisely.
Diagnostics Viewer
file://C:\Users\sesa60911\AppData\Local\Temp\~hhA391.htm 12-08-2014
Diagnostics Page 4 of 13
project diagnostics.
The Diagnostics Viewer is used to display error messages.
System Diagnostics
System diagnostics are performed automatically. When the PLC detects a system error (for example, a watchdog being exceeded, an input/output error, division by zero,
etc.), information is sent to the Diagnostics Viewer. The Diagnostics Viewer displays a system error message if in the project settings you have checked the System
diagnostics box.
Project Diagnostics
Project diagnostics uses diagnostics EFBs and DFBs. In addition, SFC program diagnostics form an integral part of the system and allow you to test the activation times of
the steps.
When the Project diagnostics box is checked, information is sent to the viewer when a fault occurs, which displays an error message.
Viewer
The Diagnostics Viewer is a tool that is used to display and acknowledge error messages linked to diagnostics:
General
The Unity Pro diagnostics function monitors the elements of the process to detect any faults there may be. When a fault occurs, it sends an error message to the display
systems which display this fault.
Illustration
The following illustration shows the operation of the Unity Pro diagnostics:
Phase Description
1 The diagnostics function blocks built into the project program and the diagnostics built into the system detect process faults.
2 The faults are stored in the form of date/time stamped messages in the diagnostics buffer memory.
3 The error messages are then displayed via the following display systems: Diagnostics Viewer or Human Machine Interface (HMI), used to:
display messages,
acknowledge messages that need an acknowledgement,
initialize animation tables and cross-references,
launch associated program editors,
delete diagnostics buffer alarms.
At a Glance
The Diagnostics Viewer is presented in the form of a display window comprising 2 display fields:
a field that displays the diagnostics error messages,
a field that provides additional information on the error message selected from the alarms list.
file://C:\Users\sesa60911\AppData\Local\Temp\~hhA391.htm 12-08-2014
Diagnostics Page 5 of 13
Diagnostics Viewer
The following screen presents the Diagnostics Viewer and its 2 display fields:
Field Description
Acknowledgement The icon and the text indicate the message status: not acknowledged, acknowledged, deleted or no acknowledgement.
Message Error message. This message contains the 40 first characters of the text entered in the comment of the function block
instance that generated the error.
Definition of icons
The Diagnostics Viewer uses the following icons to indicate the message status:
Icon Description
The fault has disappeared and has been acknowledged (if it needed an acknowledgement).
The system fault has disappeared and has been acknowledged (if it needed an acknowledgement).
If you want to refresh the values of the status words, reselect the message from the list or press the F5 function key.
NOTE: If you wish, you can find the element that caused the error displayed in the viewer. This is called finding the cause.
At a Glance
Cause finding involves searching for an element which has triggered an alarm on a diagnostics EFB or DFB input.
file://C:\Users\sesa60911\AppData\Local\Temp\~hhA391.htm 12-08-2014
Diagnostics Page 6 of 13
Each input with the Diag property can be used to search for causes.
Step Action
2 Right-click on the input for which you want to search for the cause.
Result:
Result The contextual menu allows you to initialize an animation table and to search for the DFB input variable so as to ascertain whether it is
used in the program. This is called cause finding.
3 Click on the Initialize Search to search for cross-references to the selected input.
Result:
Result The Cross-References screen is displayed.
D_GRP EFB IN
D_PRE EFB IN
SAFETY_MONITOR DFB -
At a Glance
The Diagnostics Viewer allows you to configure the display of the error messages. You can:
select the columns to be displayed,
resize the columns,
choose the color and flashing of the messages.
Step Action
file://C:\Users\sesa60911\AppData\Local\Temp\~hhA391.htm 12-08-2014
Diagnostics Page 7 of 13
Result:
Result The contextual menu disappears and the column no longer appears in the Diagnostics Viewer.
Note:
Note To reselect a column you have previously deselected, you must proceed in the same way. In this case, the contextual menu disappears and
the column appears in the Diagnostics Viewer.
3 If you display the contextual menu again (steps 1 and 2), this column will not be preceded by a pointer (deselected column).
Resizing of columns
To modify the size of a column, carry out the following operations:
Step Action
1 Position your cursor in the column titles header, in between the column you want to modify and the next column.
Result:
Result The column resizing cursor appears on the screen.
2 When the cursor appears, press and hold the right button of the mouse and move the mouse to change the column size.
3 Once the correct column size has been reached release the mouse button.
Result:
Result The column is resized.
At a Glance
The Diagnostics Viewer allows you manage the error messages. You can:
sort the messages list,
browse the messages list,
acknowledge a message in the list,
delete a message from the list,
activate another tool,
delete an alarm from the PLC memory.
Number of messages
The number of messages displayed in the list is defined solely by the size of the available memory.
If the memory becomes insufficient:
the DIAG information flashes in the status bar,
the messages associated with faults that have disappeared and have been acknowledged (if they needed acknowledging) are deleted.
Sorting messages
You can sort the messages by each column contained in the list except for the one containing the icons.
To sort the messages, simply click the header of the column containing the data you want to sort. If you click the same header a second time it will be sorted in reverse
order.
By default the messages are inserted in the list in chronological order of appearance of the faults.
NOTE: Whatever the sort criterion for the list, a new message always appears at the top of the list.
list
Acknowledging a message
To acknowledge a message that requires acknowledgement, you must select it and activate one of the following commands:
the corresponding heading in the contextual menu (accessible by right-clicking with the mouse),
the F6 function key,
the corresponding button in the toolbar,
double-clicking the icon of the alarm selected.
You can acknowledge several messages at once (multiple selection). When you acknowledge a message, an order is sent to the PLC and the associated icon is modified in
the list.
A message can be acknowledged from another viewer. In this case, the Unity Pro Diagnostics Viewer is advised and the message is displayed as if acknowledged locally
(the associated icon is modified and the message no longer flashes).
file://C:\Users\sesa60911\AppData\Local\Temp\~hhA391.htm 12-08-2014
Diagnostics Page 8 of 13
At a Glance
Once you have selected one or more error messages (active errors only), you have a number of options available for accessing the Diagnostics Viewer commands:
using the contextual menu,
using the function keys,
using the toolbar.
Contextual Menu
The contextual menu can be accessed by right-clicking a message from the list with the mouse:
The commands and their function keys from the contextual menu are as follows:
Initialize Search Ctrl + U activation of the cross references tool (search for active errors)
Initialize Animation Table Ctrl + T activation of the animation table tool (initialize animation table of active errors
Help on Type - opening the online help for the concerned FFB
Toolbar
The icons of the toolbar corresponding to the contextual menu or to the function keys are as follows:
DiagViewer Properties
Submit Feedback
At a Glance
The DiagViewer Properties dialog box, accessible via the DiagViewer Properties command in the contextual menu, is used to:
define the color of the error messages,
define the flashing mode of the error messages,
choose the fields to be displayed,
define the archiving mode,
define the mode of opening the Diagnostics Viewer.
file://C:\Users\sesa60911\AppData\Local\Temp\~hhA391.htm 12-08-2014
Diagnostics Page 9 of 13
Description
The following table describes the various fields of the Properties dialog box:
Field Description
Acknowledge blink Allows you to define the type of flashing when an error message to be acknowledged appears. Once
acknowledged messages no longer flash.
None:
None no flashing,
Icon only:
only only the icon flashes,
Entire line:
line the entire line flashes.
Field Allows you to choose the fields to be displayed (fields 0 to 15). By default all the fields are displayed.
Select all:
all selects all fields,
Clear All:
All deselects all fields. To select a field check the corresponding box by clicking the mouse.
Archiving Click this box to generate an archive. The entry field and the Browse button allow you to define the path
of the archive file.
Cyclic archiving:
archiving a new archive file is generated every 1000 saves.
Periodic archiving:
archiving a new archive file is generated every x hours.
Hour allows you to define the number x (between 1 and 24).
Additional information field:
field allows you to store additional data in the file.
Automatic Opening When this button is checked, the Diagnostics Viewer is automatically displayed when a fault appears.
At a Glance
Archiving is used to store in a file all error messages as soon as they appear, disappear or are acknowledged. As soon as a message is read in the diagnostics buffer it is
saved in the archive file.
If a fault appears and then disappears, it is represented by a single message in the Diagnostics Viewer (a single line), but by 2 lines in the archive file.
The Properties dialog box allows you to activate archiving of error messages. It also allows you to define the type of archiving and the location of the archive file.
Type of archiving
You can choose between 2 types of archiving:
archiving The history file created is named ProjectName.his, were ProjectName is the name you entered in the Project Properties dialog box is.
cyclic archiving:
in order to avoid the size of the archive file becoming too large, a new ProjectName.his file is created every 1000 saves. The old file then changes name and becomes
ProjectName.bak.
Note: If a ProjectName.bak file already exists, it will be overwritten by the new file of the same name. To avoid a loss of data, you must therefore manage your archive
files.
periodic archiving:
archiving the user defines the frequency with which a new archive file is created (between 1 and 24 hours). The file is created under the name
ProjectDraft_date_time (for example, for a file created on 31 July 2001 at 12 h 26 min 55 s: ProjectDraft_073101_122655. If the chosen frequency is 1 h, the next file
will be created under the name ProjectDraft_073101_132655, etc.). Creating a new file does not overwrite the previous file.
file://C:\Users\sesa60911\AppData\Local\Temp\~hhA391.htm 12-08-2014
Diagnostics Page 10 of 13
FBAlarm Comment
Name of the function block instance
Name of the function block type
Name of the input or output of the faulty block
SFCAlarm Comment
Name of the faulty step
Name of the faulty transition
Format of the reference time
Additional information
System diagnostics
Submit Feedback
At a Glance
The system diagnostic is performed automatically. When the PLC detects a system error (for example, a watchdog being exceeded, an input/output error, division by zero,
etc.), information is sent to the diagnostic viewer. The diagnostic viewer will display a system error message if you have checked the System diagnostics checkbox.
NOTE: As with the project diagnostic, the information viewed on the Viewer comes from the PLC's diag buffer, consequently the events are dated at the source and give the
precise status of the process monitored.
Implementation
The following table describes the procedure to follow to use the system diagnostic on the Premium, Atrium and Quantum PLCs in Unity Pro.
Step Action
2 In the Diagnostics area on the Build tab, check the System diagnostics checkbox.
file://C:\Users\sesa60911\AppData\Local\Temp\~hhA391.htm 12-08-2014
Diagnostics Page 11 of 13
Project diagnostics
At a Glance
You can create a diagnostic DFB in one of two ways.
You can create a standard DFB and then define its values and program it so that it is a diagnostic DFB.
You can use the USER_DIAG_ST_MODEL model that we will provide you with, or use a model you already have.
These two procedures are described below.
NOTE: to understand how user diagnostic DFBs work, refer to the USER_DIAG_ST_MODEL model described in the diagnostic library.
Step Action
1 In the structure view of the Project Browser, right-click on the directory Derived FB Types.
Types
Result:
Result A shortcut menu is opened.
3 Select the first empty cell in the Name column (indicated by an arrow) and enter the name of the new DFB type, then confirm using Enter.
Enter
file://C:\Users\sesa60911\AppData\Local\Temp\~hhA391.htm 12-08-2014
Diagnostics Page 12 of 13
Result:
Result The empty structure of the DFB type is now created. This new DFB is added to the list of existing DFBs. It also appears in the Derived FB
Types directory tree.
4 In the Data Editor, right-click on the type of DFB you have just created.
Result:
Result the contextual menu appears.
7 Create the inputs, outputs, inputs/outputs and the internal variables of the DFB.
Note:
Note in the input's properties, remember to check the Diag checkbox for inputs that will be monitored by the DFB.
8 Write your DFB's code using the REGDFB function to save and date the alarm, and the DEREG function to de-register the alarm.
Note refer to the description of the code of the USER_DIAG_ST_MODEL user diagnostic DFB model if you are not familiar with this type of DFB.
Note:
Step Action
1 In the structure view of the Project Browser, right-click on the directory Derived FB Types.
Types
Result:
Result A shortcut menu is opened.
3 Select the USER_DIAG_ST_MODEL diagnostic DFB model in the diagnostic library, then click on the >> button to transfer it to your project.
5 Replace the USER_DIAG_ST_MODEL name with the name of the type of user DFB you want to create.
6 Modify and create the inputs, outputs, inputs/outputs and the internal variables of the DFB.
Note:
Note in the input's properties, remember to check the Diag checkbox for inputs that will be monitored by the DFB.
Project diagnostic
See: Related Topics Submit Feedback
At a Glance
The project diagnostic uses the diagnostic EFBs and DFBs and the diagnostic integrated in the SFC to generate alarms on the Diagnostic Viewer.
Each diagnostic EFB and each diagnostic DFB has its own specific operation described in the diagnostic library. If you cannot find the appropriate EFB or DFB among these
elements, you can create your own diagnostic DFB.
NOTE: It is strongly recommended to only program a diagnostic DFB instance once within the application.
NOTE: As with the system diagnostic, the information viewed on the Viewer comes from the PLC's diag buffer, consequently the events are dated at the source and give the
precise status of the process monitored.
Step Action
2 In the Diagnostics area on the Build tab, check the Application diagnostics checkbox.
file://C:\Users\sesa60911\AppData\Local\Temp\~hhA391.htm 12-08-2014
Diagnostics Page 13 of 13
Step Action
2 In the Diagnostics area on the Build tab, check the Application diagnostics checkbox.
file://C:\Users\sesa60911\AppData\Local\Temp\~hhA391.htm 12-08-2014