跳转到内容

Device Temperature#

相机的 Device Temperature 功能可让您确定相机内部不同位置的相机温度,例如核心板、传感器板或相机外壳。

该功能的使用#

确定设备温度#

要确定 device temperature,请执行以下操作:

  1. 如果 DeviceTemperatureSelector 参数可用,则将该参数设置为应该测量温度的所需位置,例如核心板
  2. 获取 DeviceTemperature 参数的值。

温度以摄氏度为单位给出浮点值。

示例代码#

ace 2 和 boost 相机#

// Set the measuring location to core board
camera.DeviceTemperatureSelector.SetValue(DeviceTemperatureSelector_Coreboard);
// Get the current device temperature
double d = camera.DeviceTemperature.GetValue();
INodeMap& nodemap = camera.GetNodeMap();
// Set the measuring location to core board
CEnumerationPtr(nodemap.GetNode("DeviceTemperatureSelector"))->FromString("Coreboard");
// Get the current device temperature
double d = CFloatPtr(nodemap.GetNode("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();
// Set the measuring location to core board
Pylon.DeviceFeatureFromString(hdev, "DeviceTemperatureSelector", "Coreboard");
// Get the current device temperature
double d = Pylon.DeviceGetFloatFeature(hdev, "DeviceTemperature");
/* 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 = CFloatPtr(nodemap.GetNode("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();
// Get the current device temperature
double d = Pylon.DeviceGetFloatFeature(hdev, "DeviceTemperature");
/* 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 轻松设置参数。