Last Updated on Wednesday, December 15, 2004 at 11:04:24. by Joel Corbo

AlarmSender, General Information/Help

Contents

Overview

The AlarmSender is a LabView program that sends error messages from the four LabView based monitors (MagMon, SiMon, RadMon, and PlasMon) to the Central Alarmer. It has the capability to send up to six distinct error messages, and it will attempt to reconnect to the Central Alarmer if the connection is broken.

Starting and Stopping the AlarmSender

Since the AlarmSender sends information from the monitoring software on the four machines running LabView, this software must be started BEFORE the AlarmSender. Follow the documentation for those programs to start them.  If there is no such documentation, just look around the desktop for a LabView file that looks like the correct one (or two, on RadMon and PlasMon) and open that.  After this is done, AlarmSender may be started. Double-click on the "AlarmSender_V1.2.llb" icon on the desktop. This should start LabView and either bring up the AlarmSender front panel or bring up a list of VI’s.  If the front panel opens immediately, great.  If not, double-click on "AlarmSender.vi" in the VI list to bring up the AlarmSender front panel.

To start the AlarmSender, click on the little white arrow in the upper left part of the LabView window. Make sure the Central Alarmer is running first, because if it is down the AlarmSender will immediately return an error message. Also, the AlarmSender may initially send an error message to the Central Alarmer on startup. This should clear in a few seconds. To stop the AlarmSender, either stop the monitoring software or click on the two buttons on the LabView front panel in the red box labeled "Push to Stop!" NEVER stop the AlarmSender by clicking on the little red stop sign at the upper left of the LabView window!

Also note that RadMon has a special version of the AlarmSender called "BeamSender" which must be started as well.  This is the thing that communicates with the "Is There Beam?" indicator on the Central Alarmer.

The Front Panel

The AlarmSender front panel consists of four distinct groups of controls and indicators, each in a different colored box:

"Push to Stop!" (RED box): These two buttons are used to stop the AlarmSender without stopping the monitoring software at the same time. Press both "stop 1" and "stop 2" to stop the AlarmSender.

"Alarm Message" (GREEN box): This is the text of the error string being sent by the AlarmSender. It is always of the form "statusXXXSTOP," where XXX is a three-digit error code. These codes will be explained later in this document.

"Alarm Tester" (YELLOW box): These buttons are used to send false alarm messages to test to see whether the AlarmSender is sending correctly. They should only be used by experts to debug the Alarm subsystem, and never by shift crew.

"AlarmSender Controls" (BLUE box): These are the user-changeable settings for the AlarmSender. In general, they should not be changed once optimal settings have been found. The port number is the port to which the client has been assigned on PhAlarm and should never be changed. The hostname should always be set to "phalarm.phobos.bnl.gov." The wait time is the delay between sends, which is there so as not to take up all of the CPU time; it is measured in milliseconds. The heartbeat is the time the AlarmSender waits between reads of the iteration counter on the monitoring software; it is measured in milliseconds and its use will be explained later. The "Reconnect to PhAlarm" button is there to do just that. However, a manual reconnect should not be required since the AlarmSender attempts to reconnect automatically. Finally, the "Unable to Send, Attempting to Reconnect" indicator turns red when the AlarmSender looses connection with the Central Alarmer and turns gray again once the connection is reestablished.

The Global Panel

The global panel is the means by which the AlarmSender communicates with the monitoring software. It has three groups of indicators:

"Alarms" (YELLOW box): These are the globals that relay the six error conditions. True means that there IS an error condition, and false means that there is NOT an error condition.

"Number of Iterations" (PURPLE box): These are the globals that tell the AlarmSender how many iterations the monitoring software has gone through. There are two of them for the machines (RadMon and PlasMon) that have two different VI’s running at once. By looking at this number at two different times (with a delay set by the heartbeat control on the front panel) and verifying that they are different, the AlarmSender determines whether the monitoring software is running.

"Stop" (RED box): This global is connected to the stop button on the monitoring software. It stops the AlarmSender when the monitoring software is stopped.

BeamSender

There is a special version of the AlarmSender on RadMon called BeamSender.  The BeamSender is there specifically to communicate with the "Is There Beam?" indicator on the Central Alarmer, port number 6360.  It is a stripped-down version of the AlarmSender with only one alarm Boolean which is set to TRUE if there is beam and FALSE if there is no beam; it also has no iteration counters.  The BeamSender is only capable of sending two error codes: "111" for beam and "222" for no beam.  It has its own front and global panel, separate from the regular MagMon AlarmSender.  Other than this, it behaves exactly like the other AlarmSenders in terms of starting and stopping and should be treated the same.

Troubleshooting

Sub-contents

The Central Alarmer just went down.  Do the AlarmSenders need to be restarted?

The AlarmSender has been designed to handle a broken connection. If the Central Alarmer goes down, the AlarmSender will close the TCP port it was communicating with and will attempt to reopen it. It will continue closing and reopening the port until it receives a valid connection ID from the Central Alarmer, which will only happen when the Alarmer is brought back online. It will then send error strings again. In principle, the AlarmSenders will only need to be restarted if the monitoring software is stopped or if LabView crashes.

 

I got a "Client has timed out" error on a LabView-based client.  What should I do?

NOTE: This information applies ONLY to clients running on LabView.  For a LINUX based client, the shift crew is on its own.

First, go to the monitor indicated in the error dialog box. Check to see if the monitoring software and AlarmSender are running by bringing up their front panel displays and looking at the little arrow in the upper left of the display. If the arrow is black, then the program is running; if it is white, then the program is not running. Click on any white arrows to start the program; this should turn them black. If all of the arrows are black but the Central Alarmer still shows orange, something is wrong with the AlarmSender.

To restart the AlarmSender, click on the two buttons in the red area labeled "Push to Stop!" if the sender is still running. This should stop the sender, turning the arrow at the upper left to white. Once the AlarmSender is stopped, close it, leaving the monitoring software running. Go to the desktop, find the "AlarmSender_V1.2.llb" icon, and double-click on it. Eithe the AlarmSender front panel will open immidiately, or a file list will appear.  If the latter happens, choose "AlarmSender.vi" to bring up the AlarmSender front panel. Click on the white arrow in the upper left of the LabView window to start the AlarmSender.

It might also be the case that LabView has stopped working altogether for whatever reason. If this is so, both the monitoring software and the AlarmSender will need to be restarted. First, try to stop all of the running software using the stop buttons on their front panels, NOT the button with the red stop sign at the upper left of the LabView window. Once the software is stopped, close all of the windows and exit from LabView. If LabView is unresponsive so that closing it the conventional way is not possible, right-click on a clear space in the Windows taskbar at the bottom of the screen. Select "Task Manager." Select the application you want to quit (i.e. LabView) and click on "End Task" at the bottom of the window. Select things like "Quit" and "End Task" in the dialog boxes that come up, and LabView should quit. Once this is done, restart the monitoring software by double-clicking on the appropriate icon on the desktop. Note that for PlasMon and RadMon there are two different VI’s that must be started. Run the software by clicking on the white arrow in the upper left of the LabView window. Only after the monitoring software is started, start the AlarmSender as indicated in the preceding paragraph.

If the AlarmSender still cannot connect to the Central Alarmer, repeat this process once or twice and make a note of it in the logbook. Note that it might take a few minutes for the AlarmSender to connect, especially if the "wait time" and "heartbeat" times have been set high. If all else fails, call the AlarmSender expert.
 
 

I got a "No heartbeat from client" error on a LabView-based client.  What should I do?

NOTE:  This information applies ONLY to clients running on LabView.  In principle, this error should not arrise on LINUX based clients.

This error indicates that the AlarmSender is sending just fine, but that there may be something wrong with the monitoring software. This may be a temporary problem as the AlarmSender may miss a heartbeat read; if this is the case then the error will clear itself. If it persists, something is wrong with the monitoring software. First, go to the monitor indicated in the dialog box. Check to see if the monitoring software is running by bringing up its front panel display and looking at the little arrow in the upper left of the display. If the arrow is black, then the program is running; if it is white, then the program is not running. Click on a white arrow to start the program; this should turn it black. If it starts correctly, the error message should clear.

If the monitoring software was running properly to begin with, the timing needs to be changed between heartbeat reads. Bring up the AlarmSender front panel. In the blue box, find the control labeled "heartbeat." Increase it by five seconds, noting that the display is in MILLISECONDS, so you will need to increase it by 5000. If this does not clear the error after a minute or so, increase it again. Note these changes in the logbook. If the error still does not go away, there is one last thing to check.

Select the "Windows" menu at the top of the AlarmSender’s LabView window, and choose "Show Diagram." Look for an icon with a picture of a little globe in it; any one of them will do. Right-click on it and select "Open Front Panel" from the menu; it should be the second-to-last option. This will bring up the AlarmSender Global front panel. Loot at the two indicators in the purple box; they should be labeled "Number of Iterations" and "Number of Iterations 2." For PlasMon and RadMon, both of these numbers should be increasing; for SiMon and MagMon only the first should be increasing. Note that for some of the monitoring software it will take 20 or 30 seconds for the number to increment, so wait a little while before deciding if it is or isn’t. If neither is increasing, but the monitoring software is definitely running, something strange is going on. Call the AlarmSender expert. If the number(s) is(are) increasing, pick the slowest if there are two of them running and time how long on average it takes to increment. Add ten seconds or so to this number and use this as the value for "heartbeat" on the AlarmSender front panel, remembering to convert to milliseconds. Be sure to click in the gray area of the front panel after changing this value to make sure the change takes effect. If after a minute or so this still does not clear the error, make a note in the logbook and call the AlarmSender expert.

 

For Those who Need to Install a Copy of AlarmSender

This section of documentation is for anyone who needs to hook the AlarmSender up to his monitoring software. It starts with a general how-to and then gives a few specifics for the four individual monitors.

Sub-contents

How to connect the AlarmSender to preexisting monitoring software

The first thing that needs to be done to connect the AlarmSender to preexisting monitoring software is to create alarms within the monitoring software. These should be Booleans that return true if there is an alarm and false if there is no alarm. The current version of the AlarmSender automatically resets alarms to false after it sends out the alarm code to the Central Alarmer. Therefore, it is strictly speaking not necessary for the monitoring software to reset the alarm variable to false when the alarm condition ends, although it would still be nice if it did anyway.

Once the alarms are created, they must be connected to the global panel, along with the while loop iteration counters and the stop button. Since the LabView help menu is totally useless when it come to explaining how to create a global variable, the process will be briefly outlined here. Right-click on the circuit diagram, select "Structures," and select the global variable icon. Place it wherever you want it. Right-click on this new icon, select "Replace," and select "Replace a VI." Look for "AlarmSender_V1.2.llb" in the directory structure and double-click on it. Select "AlarmSenderGlobal.vi." The global icon should now have something written in it besides a question mark. Right-click on the icon yet again and select "Select Item." Pick the global variable you are interested in from the list that appears and connect it to whatever you need to connect it to.

All available alarms (up to six) and the stop global MUST be connected to the monitoring software. At least one of the iteration counters must be connected as well. However, if only one is connected, the global variables associated with the other in the AlarmSender code MUST be removed. If this is not done, the AlarmSender will send error code 999 immediately upon startup and will not stop.

 

Specifics for the four existing monitors

RadMon: The port number should be set to 6341. The only other change that needs to be made here is to change the "wait time" and "heartbeat" settings. The correct settings are listed in the next section.

SiMon: The port number should be set to 6340. Since SiMon has only one VI, references to "Number of Iterations 2" should be removed from the circuit diagram of the AlarmSender. The "wait time" and "heartbeat" also need to be changed.

PlasMon: The port number should be 6342. The "wait time" and "heartbeat" need to be changed.

MagMon: The port number is 6343. Since MagMon has only one VI, references to "Number of Iterations 2" should be removed from the circuit diagram of the AlarmSender. The "wait time" and "heartbeat" also need to be changed.

 

Wait Time and Heartbeat settings for the four LabView monitors

RadMon: 1000ms, 25000ms

SiMon: 5000ms, 40000ms

PlasMon: 1000ms, 45000ms

MagMon: 1000ms, 4500ms

 

Error Codes Demystified

A three-digit error code is used to relay the error conditions found by the AlarmSender to the Central Alarmer. This code takes a different form depending on how many alarms go off at once.

Zero Alarms: Returns 000.

One Alarm: The three digits in the error code are the same. They are the number of the alarm (e.g. Alarm2 returns 222, Alarm5 returns 555, etc.).

Two Alarms: The first and third digits are the numbers of the alarms, smallest in the first position. The middle digit is zero (e.g. Alarm3+Alarm5 returns 305, Alarm2+Alarm6 returns 206).

Three Alarms: The digits are the numbers of the alarms, in numerical order (e.g. Alarm1+Alarm2+Alarm4 returns 124, Alarm1+Alarm4+Alarm5 returns 145).

Four Alarms: The first and third digits are the numbers of the alarms that are NOT going off, with the smallest in the last position (notice the difference between this and the two alarm case). The middle digit is zero (e.g. Alarm1+Alarm3+Alarm4+Alarm5 returns 602, Alarm1+Alarm3+Alarm5+Alarm6 returns 402).

Five Alarms: The middle digit is the number of the alarm that is NOT going off. The first and third digits are zero (e.g. Alarm1+Alarm3+Alarm4+Alarm5+Alarm6 returns 020, Alarm1+Alarm2+Alarm3+Alarm4+Alarm5 return 060).

All Six Alarms: Returns 777.

Iteration Counter Fails to Increase: Returns 999. This error implies that the AlarmSender is operational but the monitoring software has somehow stopped.

Client has Gone to Sleep:  Returns 011.  This code. implemented only for the ROCDB port, signals to the Central Alarmer that the client has gone to sleep so that it does not alarm when it fails to receive messages from the client.

 


Please send all comments and suggestions regarding this page to Gerrit van Nieuwenhuizen