Device Temperature#
使用 Temperature State 功能(如果可用)可确定相机的当前内部温度状态。
该功能的使用#
确定设备温度#
要确定 device temperature,请执行以下操作:
- 如果
DeviceTemperatureSelector
参数可用,则将该参数设置为应该测量温度的所需位置,例如传感器
。 - 获取
DeviceTemperature
参数的值。
温度以摄氏度为单位给出浮点值。
示例代码#
ace 2、boost 和 dart IMX 相机#
// 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 core board
CEnumParameter(nodemap, "DeviceTemperatureSelector").SetValue("Coreboard");
// Get the current device temperature
double d = CFloatParameter(nodemap, "DeviceTemperature").GetValue();
// Set the measuring location to core board
camera.Parameters[PLCamera.DeviceTemperatureSelector].SetValue(PLCamera.DeviceTemperatureSelector.Coreboard);
// 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 core board */
errRes = PylonDeviceFeatureFromString(hdev, "DeviceTemperatureSelector", "Coreboard");
CHECK(errRes);
/* Get the current device temperature */
errRes = PylonDeviceGetFloatFeature(hdev, "DeviceTemperature", &d);
CHECK(errRes);
其他相机#
// 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);
您也可以使用 pylon Viewer 轻松设置参数。