49 / 172
Copyright © 2019 Toshiba Teli Corpotration, All rights reserved.
http://www.toshiba-teli.co.jp/en/
D4289451A
GenICam function API
Control Scalable using GenICam API.
Scalable
// GenICam node handle
CAM_NODE_HANDLE hWidth = NULL;
CAM_NODE_HANDLE hHeight = NULL;
CAM_NODE_HANDLE hOffsetX = NULL;
CAM_NODE_HANDLE hOffsetY = NULL;
// ROI = {OffsetX, Width, OffsetY, Height};
uint64_t ROI[] = {612,1224, 512,1024};
// Retrieve GenICam node.
Nd_GetNode(s_hCam, “Width”, &hWidth);
Nd_GetNode(s_hCam, “Height”, &hHeight);
Nd_GetNode(s_hCam, “OffsetX”, &hOffsetX);
Nd_GetNode(s_hCam, “OffsetY”, &hOffsetY);
// Set ROI
Nd_SetIntValue(s_hCam, hWidth, ROI[1]);
Nd_SetIntValue(s_hCam, hOffsetX, ROI[0]);
Nd_SetIntValue(s_hCam, hHeight, ROI[3]);
Nd_SetIntValue(s_hCam, hOffsetY, ROI[2]);
If you’re going to reduce width size, set Width, first. Then set OffsetX.
If you’re going to increase width size, set OffsetX, first. Then set Width.
If you’re going to reduce height size, set Height, first. Then set OffsetY.
If you’re going to increase height size, set OffsetY, first. Then set Height.
Please refer to [INode functions] and [IInteger node functions] in [TeliCamAPI Library manual] for more
detail.
Register access API
Control Scalable by accessing IIDC2 registers directly.
API name
Description
Cam_ReadReg
Read register value
Cam_WriteReg
Write register value
Scalable
Write to ‘Value’ field of ‘OffsetX’, ’Width’, ‘OffsetY’, ‘Height’ register.
// ROI = {OffsetX, Width, OffsetY, Height};
uint32_t ROI[] = {612,1224, 512,1024};
// Set ROI (in one by one)
Cam_WriteReg(s_hCam, 0x202094, 1, &ROI[0]);
Cam_WriteReg(s_hCam, 0x202098, 1, &ROI[1]);
Cam_WriteReg(s_hCam, 0x20209C, 1, &ROI[2]);
Cam_WriteReg(s_hCam, 0x2020A0, 1, &ROI[3]);
// Set ROI (in block)
Cam_WriteReg(s_hCam, 0x202094, 4, &ROI[0]);