Alarm Management¶
This component gets the alarm and warning events from the TCP client, logging the received alarms and warnings to have a record of the different events occurred while operating the system. This component has a different from the previous ones, and this is that the code that runs on the MCC, also known as EUI, and the one running on the HHD are different. This is due to the limited capabilities of the HHD. Therefore, the alarm management and logging is done in the MCC and then the HHD connects to it and obtains the alarms stored at the MCC. To do so, there are three different classes, these are:
Alarm Recpetion Task.lvclass: this class receives the alarms/faults and warnings, from the GetEventsFromTMA.lvclass, and stores the notAcked ones in memory until they are acked. In addition to this, the received alarms and warnings are sent to the AlarmSavingTask.lvclass for storing them.
AlarmSavingTask.lvclass: this task manages the alarm and warning log file.
Alarm Recpetion Task HHD.lvclass: this class is the one used in the HHD instead of the Alarm Recpetion Task.lvclass. It just connects to the Alarm Recpetion Task.lvclass and requests for certain data.
Alarm Recpetion Task.lvclass¶
This class receives the alarms/faults and warnings, from the GetEventsFromTMA.lvclass, and stores the notAcked ones in memory until they are acked. In addition to this, the received alarms and warnings are sent to the AlarmSavingTask.lvclass for storing them.
Task process¶
This task was created using the NI GOOP Developing Suite, this task is object oriented and the communication between methods is done using queues and user events. The task main is contained in the process.vi, here there is one loop. The loop is used for CMD reception, see Figure \ref{figureninety-seven7cdf3b852338e4a91ad92f619e4760aa}. This process has only one instance that manages all the received alarms and warnings.
Methods¶
Here each of the available methods are listed.
Alarm Recpetion Task_Init.vi¶
Initialize the alarm Reception task:
- Launch the TCP server, see this section, used to communicate with the HHD. For doing this a xml file is needed, in this file a section with the name “AlarmsForHHDServerConnectionData” must be found to initialize the server. The configuration used for this TCP server can be found in the “HMIConfig.xml” file located at the Configuration folder inside the HMIComputers repo.
- Add the needed object references to the class object.
- Launch the alarm reception task process.
CleanUp¶
Stop the process
CMD_AckAllNotACKED¶
This method acks all the not acked events stored in memory and are sends them to the AlarmSavingTask.lvclass to save them as acked.
CMD_AckAllNotACKEDSubsystem¶
This method acks the not acked events stored in memory filtered by the specified subsystem and are sends them to the AlarmSavingTask.lvclass to save them as acked.
CMD_GetNotACKED¶
This method is used to get the not acked events stored in memory. This vi has a timeout for the response of 180000 ms
CMD_GetNotACKEDSubsystem¶
This method is used to get the not acked events stored in memory filtered by the specified subsystem. This vi has a timeout for the response of 180000 ms
CMD Reception loop¶
This loop receives the CMDs from the public methods and executes the required actions depending on the received command. This loop has a state for each method as well as some other states used for loop managing, each state is explained in the next sections.
Init¶
This state is just executed once and is the first executed one. Here the initialization actions are executed. These are:
Initialization of local variable
Registration of events for the event structure
Alarm event from the GetEventFromTMA.lvclass
Warning event from the GetEventFromTMA.lvclass
TCP_Server_DataFrom event used by the TCP server to receive the TCP messages from the Alarm Recpetion Task HHD.lvclass and respond to them requests.
TCP_Server_Error event that reports the errors from the TCP server.
Updating the displayed name of the VI for debug purposes
Idle¶
This state is executed constantly after executing every new CMD, here the events created at the methods are received and executed in the next iteration, in the event called “EventsToProcess” see Figure \ref{figureonehundredsixc97367bfed5dc44c431073461f082020}.
In addition to this, the events generated by the GetEventFromTMA.lvclass are received, these are:
Error event: this event receives the fault events and sets the next state to be EV-ErrorEvent, see Figure \ref{figureonehundredsevenafa8a4f05207dde8ec45e93725761de2}.
Warning event: this event receives the warning events and sets the next state to be EV-WarningEvent, see Figure \ref{figureonehundredeighte35b74ee9bf49df5064a2b6ba88b2156}.
As said before, for working with the HHD, that has less computational power, there is a TCP communication between them to get the alarms logged at the EUI in the MCC. Therefore, there are two other events registered at the event structure inside the Idle case, these are:
TCP_Server_DataFrom: event used by the TCP server to receive the TCP messages from the Alarm Recpetion Task HHD.lvclass and respond to the requests, see Figure \ref{figureonehundrednine68a2eacef6c3b86a2b93ec16c46f8897}.
TCP_Server_Error: event that reports the errors from the TCP server, see Figure \ref{figureonehundredten663150cdd483bb932f7508038f274f71}.
Timeout¶
This state is executed when there is something that must be executed in the specified timeout of the Idle state event structure, see Figure \ref{figureonehundredelevenffea54a30df54a93c2d371689872356d}.
ShowWindow¶
This state is used to show the front panel of the process.
HideWindow¶
This state is used to hide the front panel of the process.
CMD-GetNotACKED¶
This case executes when the public method CMD_GetNotACKED is used, here the not acked events stored in memory, using the shift register of the while loop, are sent as a response to the calling method.
CMD-GetNotACKEDSubsystem¶
This case executes when the public method GetNotACKEDSubsystem is used, here the not acked events stored in memory, using the shift register of the while loop, are filtered by the specified subsystem and are sent as a response to the calling method.
CMD-AckAllNotACKED¶
This case executes when the public method CMD_AckAllNotACKED is used, here the not acked events stored in memory, using the shift register of the while loop, are sent to the AlarmSavingTask.lvclass to save them as acked and the memory is cleared, wiring an empty array to the shift register of the while loop.
CMD-AckAllNotACKEDSubsystem¶
This case executes when the public method CMD_AckAllNotACKEDSubsystem is used, here the not acked events stored in memory, using the shift register of the while loop, filtered by the specified subsystem are sent to the AlarmSavingTask.lvclass to save them as acked and are removed from memory.
Shutdown¶
This state is reached when the shutdown CMD is received. This loop is used to stop the CMD receiver loop.
Error¶
This state is reached when an error occurs at the task, here the error is published and cleared for the next iteration.
EV-ErrorEvent¶
This case is executed when an error event is received at the event structure inside the Idle case. Here the received error (fault) event is sent to the AlarmSavingTask.lvclass to save it and it is added to the notAcked events in memory, indexing it into the shift register of the while loop.
EV-WarningEvent¶
This case is executed when a warning event is received at the event structure inside the Idle case. Here the received warning event is sent to the AlarmSavingTask.lvclass to save it and it is added to the notAcked events in memory, indexing it into the shift register of the while loop.
Server.lvclass¶
This class when initialized launches a task that contains a TCP server. The class main elements are explained in the following sections.
Configuration file explained¶
This task requires from a configuration file for initialization, in**.xml* format that contains the following sections:
Service_Name: the name you want to set to the server, default is empty.
Port: the port of the server the clients will connect to.
Listen_Timeout_in_ms: timeout for listening to new clients.
Receive_Timeout_in_ms: timeout for reading from TCP clients, this timeout is set to check every client.
BytesToRead: bytes to read from TCP.
ReadMode: here the read mode is configured, the options are: sel=‘Standard’>0; sel=‘Buffered’>1; sel=‘CRLF’>2; sel=‘Immediate’>3
Task process¶
This task was created using the NI GOOP Developing Suite, this task is object oriented and the communication between methods is done using queues and user events. The task main is contained in the process.vi, here there are three loops, see Figure \ref{figureonehundredtwenty-threef8028a78c1fca2eaaca83ba905948bed}.
The loop on top is used for CMD reception.
The TCP Listening Loop, is the one reading the TCP connections from the clients for any new data.
New Connection Manager loop, is the one managing the new client connections.
CMD Reception loop¶
This loop receives the CMDs from the methods and passes the required actions to the corresponding loop.
####### Init
Here the local variables are initialized to the default values.
####### Idle
This state is executed constantly after executing every new CMD, here the events created at the methods are received and executed in the next iteration.
####### Timeout
This state is executed when there is something that must be executed in the specified timeout of the Idle state event structure, see Figure \ref{figureonehundredtwenty-six1e2f937dc618605c620b5684a5813697}.
####### ShowWindow
This state is used to show the front panel of the process.
####### HideWindow
This state is used to hide the front panel of the process.
####### CMD-SendData
This case is called from the SendDataTCP method. Here the specified message is sent to the specified TCP client, the identification of the client is done using the connection reference ID (i32) data to the process. The different client connections are stored in a DVR and there the specified connection is searched, if found the message is sent if not an error is sent as a response to the method. If any error occurred during the process they are sent to the process as a response.
####### CMD-SendData2All
This case is called from the SendDataTCP2All method. Here the specified message is sent to all the TCP clients. If any error occurred during the process they are sent to the process as a response.
####### Shutdown
This state is reached when the shutdown CMD is received. This loop is used to stop the process.
####### Error
This state is reached when an error occurs at the task, here the error is published, into a user event that can be registered by the calling task, and cleared for the next iteration.
The TCP Listening Loop¶
This loop is responsible of publishing the telemetry over TCP. This loop contains a very simple state machine with 5 states, each of them is explained in the upcoming sections.
####### Initialize
####### StatusCheck
Here the connected clients are cheked:
If there are no clients connected the next state is StatusCheck
If there are clients connected the next state is ListenCommands
####### ListenCommands
Here the messages from the connected clients are obtained, and if any client is no longer available the client is removed from the active clients.
The next state is always StatusCheck.
####### ErrorHandling
Here the same VI from the Error case in the CMD reception loop is used to publish the error as an event.
The next state is always StatusCheck.
####### Exit
Here all the connections are closed and the loop is stopped.
There is no next state after this case.
New Connection Manager¶
This loop is responsible of managing the new TCP client connections. This loop contains a very simple state machine with 5 states, each of them is explained in the upcoming sections.
####### Initialize
Here the TCP server is initialized.
The next state is always WaitNewConnection.
####### WaitNewConnection
Here the server waits for new TCP client connections.
The next state is always CheckExit.
####### CheckExit
Here the local variable Stop is checked to stop the loop.
If TRUE the next state is Exit.
If FALSE the next state is WaitNewConnection.
####### ErrorHandling
Here the following actions are done:
All the connections are closed, and the server is stopped.
The error is publish using the same VI from the Error case in the CMD reception loop.
The next state is always Initialize.
####### Exit
Here all the connections are closed and the loop is stopped.
There is no next state after this case.
AlarmSavingTask.lvclass¶
This task manages the alarm and warning log file.
Task process¶
This task was created using the NI GOOP Developing Suite, this task is object oriented and the communication between methods is done using queues and user events. The task main is contained in the process.vi, here there is one loop. The loop is used for CMD reception, see Figure \ref{figureonehundredforty-fourd08155d3845bd28604cd56590eb0f14f}. This process has only one instance that manages all the received alarms and warnings.
Methods¶
Here each of the available methods are listed.
AlarmSavingTask_Init.vi¶
Initialize the object:
- Set the folder where the alarm log files will be stored into the object
- Launch the process
CleanUp¶
Stop the process
CMD_GetFiltered¶
Get the events from the AlarmHistory file based on the speficied filters. This request has a response with a timeout of 180000 ms.
The available filters are:
- System: these are the different subsystem available (Azimuth, Elevation, balancing, cable wraps, …)
- Type: all, alarm, warning or info
- Date interval: specifying from which date to which date.
CMD_SaveEventArray¶
Save the specified event array to the log file of the actual day.
There is one AlarmHistory file per day, this file contains all the events that ocurred in a certain day.
CMD Reception loop¶
This loop receives the CMDs from the public methods and executes the required actions depending on the received command. This loop has a state for each method as well as some other states used for loop managing, each state is explained in the next sections.
Init¶
This state is just executed once and is the first executed one. Here the initialization actions are executed. These are:
Initialization of local variable
Registration of events for the event structure
Updating the displayed name of the VI for debug purposes
Idle¶
This state is executed constantly after executing every new CMD, here the events created at the methods are received and executed in the next iteration.
Timeout¶
This state is executed when there is something that must be executed in the specified timeout of the Idle state event structure, see Figure \ref{figureonehundredfifty-oneffea54a30df54a93c2d371689872356d}.
ShowWindow¶
This state is used to show the front panel of the process.
HideWindow¶
This state is used to hide the front panel of the process.
CMD-SaveEventArray¶
This case is called from the CMD_SaveEventArray method. Here the specified event array from the method is saved into the AlarmHistory file of the actual day.
There is one AlarmHistory file per day, this file contains all the events that occurred in a certain day.
CMD-GetFiltered¶
This case is called from the CMD_GetFiltered method. Here the AlarmHistory files that correspond to the specified date interval are read and the events that match the specified filters are sent to the method as a response.
The available filters are:
- System: these are the different subsystem available (Azimuth, Elevation, balancing, cable wraps, …)
- Type: all, alarm, warning or info
- Date interval: specifying from which date to which date.
Shutdown¶
This state is reached when the shutdown CMD is received. This loop is used to stop the CMD receiver loop.
Error¶
This state is reached when an error occurs at the task, here the error is published and cleared for the next iteration.
Alarm Recpetion Task HHD.lvclass¶
This class is the one used in the HHD instead of the Alarm Recpetion Task.lvclass. It just connects to the Alarm Recpetion Task.lvclass and requests for certain data.
Task process¶
This task was created using the NI GOOP Developing Suite, this task is object oriented and the communication between methods is done using queues and user events. The task main is contained in the process.vi, here there is one loop. The loop is used for CMD reception, see Figure \ref{figureonehundredfifty-nine81f14738587b3624e4235ee988df923b}.
Methods¶
Here each of the available methods are listed.
Alarm Recpetion TaskHHD _Init.vi¶
Initialize the alarm Reception task for the HHD:
- Launch the TCP client, used to communicate with the EUI in the MCC. For doing this a xml file is needed, in this file a section with the name “AlarmsForHHDClientConnectionData” must be found to initialize the server.
- Launch the alarm reception task process.
CleanUp¶
Stop the process
CMD_AckAllNotACKED¶
Send the request to the AlarmRecption Task.lvclass process to ack all the notAcked events
CMD_AckAllNotACKEDSubsystem¶
Send the request to the AlarmRecption Task.lvclass process to ack all the notAcked events that correspond to the specified subsystem
CMD_GetNotACKED¶
Send the request to the AlarmReception Task.lvclass to get all the not acked events.
CMD_GetNotACKEDSubsystem¶
Send the request to the AlarmReception Task.lvclass to get the not acked events that correspond to the specified system
CMD Reception loop¶
This loop receives the CMDs from the public methods and executes the required actions depending on the received command. This loop has a state for each method as well as some other states used for loop managing, each state is explained in the next sections.
Init¶
This state is just executed once and is the first executed one. Here the initialization actions are executed. These are:
Initialization of local variable
Updating the displayed name of the VI for debug purposes
Idle¶
This state is executed constantly after executing every new CMD, here the events created at the methods are received and executed in the next iteration.
Timeout¶
This state is executed when there is something that must be executed in the specified timeout of the Idle state event structure, see Figure \ref{figureonehundredsixty-eightffea54a30df54a93c2d371689872356d}.
ShowWindow¶
This state is used to show the front panel of the process.
HideWindow¶
This state is used to hide the front panel of the process.
CMD-GetNotACKEDSubsystem¶
This case is called from the CMD_GetNotACKEDSubsystem method. Here the request to the AlarmReception Task.lvclass to get the not acked events that correspond to the specified system is sent and the response is sent to the calling method.
CMD-GetNotACKED¶
This case is called from the CMD_GetNotACKED method. Here the request to the AlarmReception Task.lvclass to get all the not acked events is sent and the response is sent to the calling method.
CMD-AckAllNotACKED¶
This case is called from the CMD-AckAllNotACKED method. Here the request to the AlarmReception Task.lvclass to ack all the not acked events is sent.
CMD-AckAllNotACKEDSubsystem¶
This case is called from the CMD-AckAllNotACKEDSubsystem method. Here the request to the AlarmReception Task.lvclass to ack all the not acked events that correspond to the specified subsystem is sent.
Shutdown¶
This state is reached when the shutdown CMD is received. This loop is used to stop the CMD receiver loop.
Error¶
This state is reached when an error occurs at the task, here the error is published and cleared for the next iteration.