Exchanging Data between Controller and Safety PLC
If a Safety PLC is included in your project, communication between the standard (non-safety-related) machine controller and the Safety PLC is possible and allows the coupling of the standard application with the safety-related application.
Communication possibilities between machine controller and Safety PLC:
Note
To edit safety-related data you have to be logged on to the Safety-related Area: Left-click the
area in the status bar, enter your password and press <Enter>. |
Exchange variables
In Data Lists, global machine controller variables can be mapped to global standard Safety PLC variables.
For the Safety PLC variable (i.e., in the Safety PLC Data List), a data direction has to be set which determines whether data is transferred from or to the Safety PLC: 'I' means that the variable can be read by the safety-related application and 'Q' that it can be written by the safety-related application. Accordingly, the standard application has write or read access.
Exchange variables are always standard variables: only a non-safety-related variable declared with 'Global' keyword in the Data List of the Safety PLC can be assigned to a 'Global' variable of the standard machine controller. No process datum (input or output signal from the process) is involved.
Do not confuse exchange variables with the threefold assignment of a process data item and a Safety PLC variable and a machine controller variable. In such cases, the process data item has the leading role and the Safety PLC variable has a safety-related data type. (Refer to section "Reading safety-related signals in the standard machine controller" for details.)
Use cases for exchange variables
- Use case 1: When programming the Enable Principle by means of the EN_OUT function in the safety-related project, exchange variables can be mapped to the data of the standard controller.
- Use case 2: the Safety PLC integrated in iC9200 Series controllers may provide diagnostic system variables, e.g., for monitoring the status of FSoE Devices and the FSoE communication. Such system variables can be assigned to exchange variables in order to inform the standard application about the condition of the functional safety application.
The coupling has to be done in the Data List of the standard machine controller or of the Safety PLC.
There are two possibilities to create exchange variables:
What do you want to do?
How to create a new exchange variable
In the Data List of the Safety PLC:
- Right-click the variable for which an exchange variable is to be declared in the machine controller.
- Select 'Add Variable (PLC)' from the context menu or click the corresponding toolbar button:
- Specify the data direction of the Safety PLC variable in the Data List by selecting 'I' or 'Q' in the 'I/Q/M' column. Refer to the note above.
The created variable is also inserted in the machine controller Data List. There, the assignment to the Safety PLC variable is also visible.
In the Data List of the machine controller:
- Right-click the variable for which an exchange variable is to be declared in the machine controller.
- Select 'Add Variable (Safety PLC)' from the context menu or click the corresponding toolbar button:
- Specify the data direction of the Safety PLC variable in the Data List by selecting 'I' or 'Q' in the 'I/Q/M' column. Refer to the note above.
The created variable is also inserted in the Safety PLC Data List. There, the assignment to the machine controller variable is also visible.
Note
The added exchange variable is of a standard (non-safety-related) data type, although it is a Safety PLC variable. |
How to disconnect an exchange variable
In the corresponding Data List (machine controller or Safety PLC):
The assignment between the variables is deleted in the each Data List. The variables, however, are not deleted.
How to delete an exchange variable
In the corresponding Data List (machine controller or Safety PLC):
- Right-click the exchange variable whose assignment is to be deleted.
- Select 'Delete Variable (PLC)'/'Delete Variable (Safety PLC)' from the context menu or click the corresponding toolbar button:
The assignment between the variables is deleted in the edited Data List.
If the exchange variable is not yet used in any POU it is also deleted from the other Data List. If, however, the exchange variable is already used in any POU, or if at least a related external variable is declared, it is not deleted from the other Data List. Instead, it becomes a usual global variable which is no longer an exchange variable.
Reading safety-related signals in the standard machine controller
The standard machine controller can read the status of safety-related signals. This applies to safety-related input signals and output signals:
- Reading a safety-related input signal in the standard application:
- Reading a safety-related output signal in the standard application:
Note
Writing to a safety output from the standard application is not possible. The standard application, however, can read the value which is written to the safety output by the safety application. |
Note
Although this is an assignment of a Safety PLC variable to a machine controller variable, do not confuse it with an exchange variable. Exchange variables in the Safety PLC always have a standard data type and no process datum is assigned. In this present threefold assignment, however, the process data item has the leading role. Therefore, the Safety PLC variable has a safety-related data type. |
How to read a safety-related input/output in the standard machine controller
| In the Data List of the machine controller
|
Case 1 machine controller variable not existent or still unconnected |
- Locate the unconnected machine controller variable or create one with the data type of the signal you want to read.
- Select a safety-related process data item for this variable using the Role Picker. Refer to the topic "Role Mapping in Data Lists: I/O Variables and Exchange Variables" for details. This assignment is possible although the machine controller variable has a standard data type and the safety signal has a safety-related data type.
When you connect a safety-related process data item to a (non-safety-related) standard machine controller variable in a Data List, iCube Engineer automatically creates a corresponding safety-related variable in the Safety PLC and connects it. The name and data type (and comment, if available) of the automatically created Safety PLC variable are derived from the standard variable. The data direction of the Safety PLC variable is derived from the process data item type:
- A safety-related input signal results in a Safety PLC variable with data direction 'I'. As a result, the safety-related process data item can be read in the safety-related code as well as in the standard application.
- A safety-related output process data item results in a 'Q' variable in the Safety PLC. As a result, the safety-related process data item can be written in the safety-related code. Writing to a safety output from the standard application is not possible. The standard application, however, can read the value which is written to the safety output by the safety application.
|
Case 2 machine controller variable already connected to Safety PLC variable | In this case, you can only select a process data item for this existing assignment if ...
- the Safety PLC variable has a safety-related data type (no exchange variables).
- the data type of the process data item is matching the data types of both variables.
|
In the Data List of the Safety PLC
- If not already done, select a safety-related process data item for the safety-related variable.
- Right-click the newly connected safety-related variable.
- Select 'Add Variable (PLC)' from the context menu or click the corresponding toolbar button:
The data direction of the Safety PLC variable is derived from the process data item type (as described in the procedure "In the Data List of the machine controller").The created variable is also inserted in the machine controller Data List. There, the assignment to the machine controller variable is also visible. |
Processing standard signals of the safety application in the standard machine controller
The standard machine controller can process standard signals which belong to the safety application.
- Reading a standard input signal of the safety application in the standard application.
- Writing a standard output signal of the safety application from the standard application.
Note
In this case, the Safety PLC has read-only access (Safety PLC variable with standard data type has data direction: 'I') and the signal is written by the standard machine controller. |
The necessary assignments can be done in the Data List of the machine controller or the Safety PLC using the Role Picker. Please refer to the previous section for details.