Skip to content

Temperature Alarms#

The Temperature Alarms feature works in combination with the Event Notification feature to notify you when the temperature in an image falls below or exceeds the temperature values specified.

Using the Feature#

How It Works#

To use temperature alarms you first need to specify an image ROI via the Auto Function ROI feature.

You can specify two ROIs per image in which to monitor the temperature. For each ROI, you can specify a lower threshold, an upper threshold, or both. When you've done that, you can set up the event notification. Then, if the temperature drops below or exceeds the thresholds specified, you will receive a message.

Info

Currently, an event can only occur if the camera is already open and then changes its state from, e.g., LowerTempAlarm to UpperTempAlarm. No event occurs, if the camera starts up in an error state.

Configuring Temperature Alarms#

  1. Set the AutoFunctionROISelector parameter to the desired image ROI, e.g., ROI1.
  2. Use the following parameters to specify the size of the image ROI:

    • AutoFunctionROIWidth
    • AutoFunctionROIHeight
  3. Use the following parameters to specify the position of the image ROI:

    • AutoFunctionROIOffsetX
    • AutoFunctionROIOffsetY
  4. Set the BslTemperatureAlarmsROISelector parameter to the image ROI that you have configured before, e.g., ROI1.

  5. Use the BslTemperatureAlarmsLowerTemperatureThreshold parameter to specify the lower threshold of the image ROI for when an alarm is triggered.
  6. Set the BslTemperatureAlarmsLowerTemperatureHysteresis parameter to the desired value.
  7. Use the BslTemperatureAlarmsUpperTemperatureThreshold parameter to specify the upper threshold of the image ROI for when an alarm is triggered.
  8. Set the BslTemperatureAlarmsUpperTemperatureHysteresis parameter to the desired value if necessary.

Hysteresis

As temperatures usually oscillate around around a certain value, the Temperature Alarms feature includes a hysteresis option. This allows you to specify a tolerance range so that alarms are not triggered constantly. To better understand this, consider the following example:

Lower Hysteresis: You specify the lower temperature threshold to be 10 °C and the lower hysteresis to 2 °C. When the temperature rises to 12 °C the temperature state will change from LowerTempAlarm to TempOk. Now, only when the temperature reaches the lower temperature threshold of 10 °C again, a lower temperature alarm is triggered.

Upper Hysteresis: You specify the upper temperature threshold to be 10 °C and the upper hysteresis to 2 °C. When the temperature falls to 8 °C the temperature state will change from UpperTempAlarm to TempOk. Now, only when the temperature reaches the upper temperature threshold of 10 °C again, an upper temperature alarm is triggered.

Enabling Event Notifications#

Info

You can only use the Temperature Alarms event if the PixelFormat parameter is set to a temperature-based pixel format (Data32f or Mono 12).

  1. Set the EventSelector parameter to one of the following values:

    • TemperatureAlarmsROI1: Use this option if you have configured ROI 1 before.
    • TemperatureAlarmsROI2: Use this option if you have configured ROI 2 before.
  2. Set the EventNotification parameter to On.

When a temperature alarms event occurs, you will receive a message with the following information:

  • EventTemperatureAlarmsROI1 or EventTemperatureAlarmsROI2: Unique identifier of the event.
  • EventTemperatureAlarmsROI1Timestamp or EventTemperatureAlarmsROI2Timestamp: Timestamp for when the event occured.
  • EventTemperatureAlarmsROI1Status or EventTemperatureAlarmsROI2Status: Current temperature state of the image ROI. The following states are available:
    • TempOk: The Temperature is Ok.
    • LowerTempAlarm: The Temperature dropped below the minimum threshold.
    • UpperTempAlarm: The Temperature exceeds the maximum threshold.
    • LowerUpperTempAlarm: The temperature dropped below the minimum and exceeds the maximum threshold.

Sample Code#

C++ // Select a pixel format that represents the pixel as a temperature value, e.g., Mono12 camera.PixelFormat.SetValue(PixelFormat_Mono12); // Select a ROI in which the observation window is to be defined e.g. ROI1 camera.AutoFunctionROISelector.SetValue(AutoFunctionROISelector_ROI1); // Define an area where the temperature is to be observed by specifying // the width, height, offset_x and offset_y of the observation window camera.AutoFunctionROIWidth.SetValue(50); camera.AutoFunctionROIHeight.SetValue(50); camera.AutoFunctionROIOffsetX.SetValue(20); camera.AutoFunctionROIOffsetY.SetValue(20); // Select a ROI in which the temperature is to be observed e.g. ROI1 camera.BslTemperatureAlarmsROISelector.SetValue(BslTemperatureAlarmsROISelector_ROI1); // Specify upper temperature threshold of the ROI selected camera.BslTemperatureAlarmsUpperTemperatureThreshold.SetValue(1200); // Specify lower temperature threshold of the ROI selected camera.BslTemperatureAlarmsLowerTemperatureThreshold.SetValue(300); // Specify upper temperature hysteresis of the ROI selected camera.BslTemperatureAlarmsUpperTemperatureHysteresis.SetValue(5); // Specify lower temperature hysteresis of the ROI selected camera.BslTemperatureAlarmsLowerTemperatureHysteresis.SetValue(5); // Select the TemperatureAlarmsROI1 event notification camera.EventSelector.SetValue(EventSelector_TemperatureAlarmsROI1); // Enable event notifications for TemperatureAlarmsROI1 camera.EventNotification.SetValue(EventNotification_On); // NOTE: notice that events are only resolved when the status changes e.g. from // Temperature Ok to Upper Temperature Alarm. For example, if the camera wakes up // in an Upper Temperature Alarm state, no event is triggered!

C++ INodeMap& nodemap = camera.GetNodeMap(); // Select a pixel format that represents the pixel as a temperature value, e.g., Mono12 CEnumParameter(nodemap, "PixelFormat").SetValue("Mono12"); // Select a ROI in which the observation window is to be defined e.g. ROI1 CEnumParameter(nodemap, "AutoFunctionROISelector").SetValue("ROI1"); // Define an area where the temperature is to be observed by specifying // the width, height, offset_x and offset_y of the observation window CIntegerParameter(nodemap, "AutoFunctionROIWidth").SetValue(50); CIntegerParameter(nodemap, "AutoFunctionROIHeight").SetValue(50); CIntegerParameter(nodemap, "AutoFunctionROIOffsetX").SetValue(20); CIntegerParameter(nodemap, "AutoFunctionROIOffsetY").SetValue(20); // Select a ROI in which the temperature is to be observed e.g. ROI1 CEnumParameter(nodemap, "BslTemperatureAlarmsROISelector").SetValue("ROI1"); // Specify upper temperature threshold of the ROI selected CIntegerParameter(nodemap, "BslTemperatureAlarmsUpperTemperatureThreshold").SetValue(1200); // Specify lower temperature threshold of the ROI selected CIntegerParameter(nodemap, "BslTemperatureAlarmsLowerTemperatureThreshold").SetValue(300); // Specify upper temperature hysteresis of the ROI selected CIntegerParameter(nodemap, "BslTemperatureAlarmsUpperTemperatureHysteresis").SetValue(5); // Specify lower temperature hysteresis of the ROI selected CIntegerParameter(nodemap, "BslTemperatureAlarmsLowerTemperatureHysteresis").SetValue(5); // Select the TemperatureAlarmsROI1 event notification CEnumParameter(nodemap, "EventSelector").SetValue("TemperatureAlarmsROI1"); // Enable event notifications for TemperatureAlarmsROI1 CEnumParameter(nodemap, "EventNotification").SetValue("On"); // NOTE: notice that events are only resolved when the status changes e.g. from // Temperature Ok to Upper Temperature Alarm. For example, if the camera wakes up // in an Upper Temperature Alarm state, no event is triggered!

C# // Select a pixel format that represents the pixel as a temperature value, e.g., Mono12 camera.Parameters[PLCamera.PixelFormat].SetValue(PLCamera.PixelFormat.Mono12); // Select a ROI in which the observation window is to be defined e.g. ROI1 camera.Parameters[PLCamera.AutoFunctionROISelector].SetValue(PLCamera.AutoFunctionROISelector.ROI1); // Define an area where the temperature is to be observed by specifying // the width, height, offset_x and offset_y of the observation window camera.Parameters[PLCamera.AutoFunctionROIWidth].SetValue(50); camera.Parameters[PLCamera.AutoFunctionROIHeight].SetValue(50); camera.Parameters[PLCamera.AutoFunctionROIOffsetX].SetValue(20); camera.Parameters[PLCamera.AutoFunctionROIOffsetY].SetValue(20); // Select a ROI in which the temperature is to be observed e.g. ROI1 camera.Parameters[PLCamera.BslTemperatureAlarmsROISelector].SetValue(PLCamera.BslTemperatureAlarmsROISelector.ROI1); // Specify upper temperature threshold of the ROI selected camera.Parameters[PLCamera.BslTemperatureAlarmsUpperTemperatureThreshold].SetValue(1200); // Specify lower temperature threshold of the ROI selected camera.Parameters[PLCamera.BslTemperatureAlarmsLowerTemperatureThreshold].SetValue(300); // Specify upper temperature hysteresis of the ROI selected camera.Parameters[PLCamera.BslTemperatureAlarmsUpperTemperatureHysteresis].SetValue(5); // Specify lower temperature hysteresis of the ROI selected camera.Parameters[PLCamera.BslTemperatureAlarmsLowerTemperatureHysteresis].SetValue(5); // Select the TemperatureAlarmsROI1 event notification camera.Parameters[PLCamera.EventSelector].SetValue(PLCamera.EventSelector.TemperatureAlarmsROI1); // Enable event notifications for TemperatureAlarmsROI1 camera.Parameters[PLCamera.EventNotification].SetValue(PLCamera.EventNotification.On); // NOTE: notice that events are only resolved when the status changes e.g. from // Temperature Ok to Upper Temperature Alarm. For example, if the camera wakes up // in an Upper Temperature Alarm state, no event is triggered!

```C / Macro to check for errors /

define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)#

GENAPIC_RESULT errRes = GENAPI_E_OK; / Return value of pylon methods / / Select a pixel format that represents the pixel as a temperature value, e.g., Mono12 / errRes = PylonDeviceFeatureFromString(hdev, "PixelFormat", "Mono12"); CHECK(errRes); / Select a ROI in which the observation window is to be defined e.g. ROI1 / errRes = PylonDeviceFeatureFromString(hdev, "AutoFunctionROISelector", "ROI1"); CHECK(errRes); / Define an area where the temperature is to be observed by specifying / / the width, height, offset_x and offset_y of the observation window / errRes = PylonDeviceSetIntegerFeature(hdev, "AutoFunctionROIWidth", 50); CHECK(errRes); errRes = PylonDeviceSetIntegerFeature(hdev, "AutoFunctionROIHeight", 50); CHECK(errRes); errRes = PylonDeviceSetIntegerFeature(hdev, "AutoFunctionROIOffsetX", 20); CHECK(errRes); errRes = PylonDeviceSetIntegerFeature(hdev, "AutoFunctionROIOffsetY", 20); CHECK(errRes); / Select a ROI in which the temperature is to be observed e.g. ROI1 / errRes = PylonDeviceFeatureFromString(hdev, "BslTemperatureAlarmsROISelector", "ROI1"); CHECK(errRes); / Specify upper temperature threshold of the ROI selected / errRes = PylonDeviceSetIntegerFeature(hdev, "BslTemperatureAlarmsUpperTemperatureThreshold", 1200); CHECK(errRes); / Specify lower temperature threshold of the ROI selected / errRes = PylonDeviceSetIntegerFeature(hdev, "BslTemperatureAlarmsLowerTemperatureThreshold", 300); CHECK(errRes); / Specify upper temperature hysteresis of the ROI selected / errRes = PylonDeviceSetIntegerFeature(hdev, "BslTemperatureAlarmsUpperTemperatureHysteresis", 5); CHECK(errRes); / Specify lower temperature hysteresis of the ROI selected / errRes = PylonDeviceSetIntegerFeature(hdev, "BslTemperatureAlarmsLowerTemperatureHysteresis", 5); CHECK(errRes); / Select the TemperatureAlarmsROI1 event notification / errRes = PylonDeviceFeatureFromString(hdev, "EventSelector", "TemperatureAlarmsROI1"); CHECK(errRes); / Enable event notifications for TemperatureAlarmsROI1 / errRes = PylonDeviceFeatureFromString(hdev, "EventNotification", "On"); CHECK(errRes); / NOTE: notice that events are only resolved when the status changes e.g. from / / Temperature Ok to Upper Temperature Alarm. For example, if the camera wakes up / / in an Upper Temperature Alarm state, no event is triggered! / ```

Back to top