How to implement the PLC-Alarm TIA Portal function block
How to implement the PLC-Alarm TIA Portal function block
First, of course, the external sources must be added to the TIA Portal Project. This is done as usual via the folder “External source files” in the project tree.
Afterwards the blocks must be generated by the right mouse button on the imported entry and “Generate blocks from source”. To avoid some error messages in advance, you should start with the “PLC_Alarm_Handler.scl”, because this also contains the DB, which is then accessed by the other FCs.
After that the created FB must be called once and the instance DB must have the following name “PLC_Alarm_Handler_DB”, because the other blocks (e.g.: “PLC-Alarm” or “PLC-Alarm_UsedAlarms”). The inputs should also be wired accordingly.
Now that the DB has been created and named correctly, the FC “PLC alarm” can be generated.
After that this FC can be called everywhere where the alarms/warnings/messages are programmed and where the “Program_Alarm” were placed before.
To ensure that the correct text is displayed when a message is triggered, the text list exported from the PLC-Alarm.app must first be imported into the TIA Portal.
Then we can link the text list with the “Progam_Alarm” calls in the PLC_Alarm_Handler FB. (Unfortunately the settings of “Program_Alarm” calls are not transferred with an SCL export). For this we go in the project tree to “PLC supervisions & alarms” where all “Program_Alarm” are listed. First we sort them by name, so we have all calls of alarm handlers in one area and then we select the first one. This should be the following in descending order: Program_Alarm_All\Program_Alarm_All[0] . This “Program-Alarm” entry is linked to two variables, which are now linked to the text lists. For this the list “PLC-Alarm_List” is linked with the variable “…MessNo” and the list “PLC-Alarm-Add” with the variable “…AddMessNo”.
Then you can apply these settings to all entries by selecting the changed entry in the “Alarm text” column in the list and dragging it down by clicking on the bottom right corner.
After that, only the “Program_Alarm” calls have to be added to a message class. In our example, this looks like that the alarms in zone 0 belong to the message class “Alarm General” and the alarms of zone 1 to the class “Alarm_Zone1”.