跳至內容
測試伺服器
開發伺服器

Device Temperature#

透過 Device Temperature camera feature,您可以測量相機內部不同位置的溫度,例如核心機板、Ethernet PHY 組件(若適用)、感光元件機板或相機外殼。

使用 Temperature State 功能(若適用)來判定相機目前的內部溫度狀態。

使用功能#

測定 Device Temperature#

若要測量 Device Temperature:

  1. 若 buffer operator 的 DeviceTemperatureSelector 參數可用,請將該參數設定為您希望測量溫度的目標位置,例如: Sensor.
  2. 取得 DeviceTemperature 參數中選擇性地指定 HTML 記錄檔 (*.html) 的路徑與檔名。

溫度以攝氏度數的浮點數值表示。

範例程式碼#

ace 2、boost 和 dart R 相機#
// Set the measuring location to sensor
camera.DeviceTemperatureSelector.SetValue(DeviceTemperatureSelector_Sensor);
// Get the current device temperature
double d = camera.DeviceTemperature.GetValue();
INodeMap& nodemap = camera.GetNodeMap();
// Set the measuring location to sensor
CEnumParameter(nodemap, "DeviceTemperatureSelector").SetValue("Sensor");
// Get the current device temperature
double d = CFloatParameter(nodemap, "DeviceTemperature").GetValue();
// Set the measuring location to sensor
camera.Parameters[PLCamera.DeviceTemperatureSelector].SetValue(PLCamera.DeviceTemperatureSelector.Sensor);
// Get the current device temperature
double d = camera.Parameters[PLCamera.DeviceTemperature].GetValue();
/* 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 */
double d = 0;
/* Set the measuring location to sensor */
errRes = PylonDeviceFeatureFromString(hdev, "DeviceTemperatureSelector", "Sensor");
CHECK(errRes);
/* Get the current device temperature */
errRes = PylonDeviceGetFloatFeature(hdev, "DeviceTemperature", &d);
CHECK(errRes);
# Set the measuring location to sensor
camera.DeviceTemperatureSelector.Value = "Sensor"
# Get the current device temperature
d = camera.DeviceTemperature.Value
ace Classic/U/L GigE 相機#
// Get the current device temperature
double d = camera.TemperatureAbs.GetValue();
INodeMap& nodemap = camera.GetNodeMap();
// Get the current device temperature
double d = CFloatParameter(nodemap, "TemperatureAbs").GetValue();
// Get the current device temperature
double d = camera.Parameters[PLCamera.TemperatureAbs].GetValue();
/* 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 */
double d = 0;
/* Get the current device temperature */
errRes = PylonDeviceGetFloatFeature(hdev, "TemperatureAbs", &d);
CHECK(errRes);
# Get the current device temperature
d = camera.TemperatureAbs.Value
其他相機#
// Get the current device temperature
double d = camera.DeviceTemperature.GetValue();
INodeMap& nodemap = camera.GetNodeMap();
// Get the current device temperature
double d = CFloatParameter(nodemap, "DeviceTemperature").GetValue();
// Get the current device temperature
double d = camera.Parameters[PLCamera.DeviceTemperature].GetValue();
/* 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 */
double d = 0;
/* Get the current device temperature */
errRes = PylonDeviceGetFloatFeature(hdev, "DeviceTemperature", &d);
CHECK(errRes);
# Get the current device temperature
d = camera.DeviceTemperature.Value

您也可以 use the pylon Viewer 來輕鬆設定參數。