Device Temperature#
使用 Temperature State 功能(如果可用)可确定相机的当前内部温度状态。
该功能的使用#
确定设备温度#
要确定 device temperature,请执行以下操作:
- If the
DeviceTemperatureSelector
parameter is available, set the parameter to the desired location where the temperature should be measured, e.g.,传感器
. - Get the value of the
DeviceTemperature
parameter.
温度以摄氏度为单位给出浮点值。
示例代码#
ace 2, boost, and dart R Cameras#
/* 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);
ace Classic/U/L GigE 相机#
/* 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);
其他相机#
/* 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);
您也可以使用 pylon Viewer 轻松设置参数。