Join us today!

Creating an Alarm T...
 
Notifications
Clear all

Creating an Alarm Table in Visualization

4 Posts
4 Users
2 Reactions
1,400 Views
TwinControls
Posts: 71
Admin
Topic starter
(@beckhoffsupport)
Member
Joined: 2 years ago

To create an alarm table in visualization, we need to enable the 'Event table' special control feature in the PLC properties first. 

Add the visualization to your project.  Right click your PLC Project, select 'add', then visualization.

addvisualization

 

After adding the visualization, we will enable the 'Event table' in the project properties. Right click your PLC Project and choose 'Properties'. 

properties

 

Select the 'Visualization Profile' on the left menu and check the 'EventTable' checkbox. 

enableEventTable

 

Open the visualization and go to Toolbox. You will now see the 'Event Table' under special controls tools. Drag and drop it to workspace. 

addeventtable

 

Add the Tc2_Utilities library into your project. 

utilities

 

Add the alarm event array declaration in your MAIN program and build your project. 

stAlarmEvents :  ARRAY[1..80] OF ST_ReadEvent;

 

Open the visualization, select the event table in the workspace and go to properties. In the 'Event data array' section, select the array variable we declared in the MAIN program.

eventarray

 

In the MAIN program, now we can define our alarm events. Add the code below. 

//Alarm 1
stAlarmEvents[1].nSourceId :=  1;
stAlarmEvents[1].nEventId := 1;
stAlarmEvents[1].nClass := 7;
stAlarmEvents[1].nConfirmState := 1;
stAlarmEvents[1].nResetState := 1;
stAlarmEvents[1].sSource := 'fbSensorAlarmCheck';
stAlarmEvents[1].sDate := '09/16/2022';
stAlarmEvents[1].sTime := '11:41:51';
stAlarmEvents[1].sComputer := 'PLC-1';
stAlarmEvents[1].sMessageText := 'Prox Sensor has failed';
stAlarmEvents[1].bQuitMessage := FALSE;
stAlarmEvents[1].bConfirmable := TRUE;


//Alarm 2
stAlarmEvents[2].nSourceId :=  1;
stAlarmEvents[2].nEventId := 1;
stAlarmEvents[2].nClass := 8;
stAlarmEvents[2].nConfirmState := 1;
stAlarmEvents[2].nResetState := 1;
stAlarmEvents[2].sSource := 'fbDriveErrorCheck';
stAlarmEvents[2].sDate := '09/16/2022';
stAlarmEvents[2].sTime := '11:45:51';
stAlarmEvents[2].sComputer := 'PLC-1';
stAlarmEvents[2].sMessageText := 'Check motor parameters!';
stAlarmEvents[2].bQuitMessage := FALSE;
stAlarmEvents[2].bConfirmable := TRUE;

 

nSourceID - You can assign a source ID

nEventId - You can assign event an ID

nClass - 

(* nClass
1 - Maintenance 
2 - Message
3 - Hint
4 - Information
5 - Instruction
6 - Warning
7 - Alarm
8 - Parameter Error
*)

sSource - You can use the function block name which is generating the alarm. 

sMessageText - Your alarm message. 

You can check this tutorial the get the system local time and use it for sDate and sTime. You would need to convert the data to string and concatenate the hour, min, sec info etc... 

alarmtable

 

To clear the alarms, you can declare and empty event structure and assign it to your array elements when you need to clear them. 

stEmptyEvent : ST_ReadEvent;
IF bClearAlarms THEN
    stAlarmEvents[1] := stEmptyEvent;
    stAlarmEvents[2] := stEmptyEvent;
END_IF

 

 

 You can also use FB_AdsReadEvents function block to read all the events in the ADS and display them in the event table and you can utilize the Beckhoff TcEventConfigurator to create and configure your alarms. 

tcEventconfigurator

 

Reply
3 Replies
3 Replies
runtimevictor
(@runtimevictor)
Joined: 2 years ago

Estimable Member
Posts: 156

@beckhoffsupport ,

the latest Beckhoff TcEventConfigurator image,

could you explain the best one..., which is for TwinCAT2 or TwinCAT3?,How is it used?

I would be very grateful if you could give an example of how TcEventConfigurator is used...

Thank you very much for everything, Victor.

TcEventConfigurator

 

Reply
twinControls
Admin
(@twincontrols)
Joined: 2 years ago

Member
Posts: 114

@runtimevictor TcEventConfigurator for TwinCAT 2, but you may be able to use it for TwinCAT 3 as well. I prefer creating my own array instead and passing the event data into that array as explained above. 

Reply
(@sarunas-z)
Joined: 1 year ago

Active Member
Posts: 3

@twincontrols If I am using twincat 3 how to create event list?

Reply
Share: