91 / 177
Copyright © 2018 - 2020 Toshiba Teli Corporation, All rights reserved.
https://www.toshiba-teli.co.jp/en/
DAA00195C
// GenICam node handle
CAM_NODE_HANDLE hMode = NULL;
CAM_NODE_HANDLE hSequence = NULL;
CAM_NODE_HANDLE hSource = NULL;
CAM_NODE_HANDLE hAdditionalParameter = NULL;
CAM_NODE_HANDLE hDelay = NULL;
CAM_NODE_HANDLE hTriggerSoftware = NULL;
// Retrieve GenICam node.
Nd_GetNode(s_hCam, "TriggerMode", &hMode);
Nd_GetNode(s_hCam, "TriggerSequence", &hSequence);
Nd_GetNode(s_hCam, "TriggerSource", &hSource);
Nd_GetNode(s_hCam, "TriggerAdditionalParameter", &hAdditionalParameter);
Nd_GetNode(s_hCam, "TriggerDelay", &hDelay);
Nd_GetNode(s_hCam, "TriggerSoftware", &hTriggerSoftware);
// 1. Select a trigger mode by 'TriggerMode'.
Nd_SetEnumStrValue(s_hCam, hMode, "On");
// 2. Select a trigger sequence of random trigger shutter by 'TriggerSequence'.
Nd_SetEnumStrValue(s_hCam, hSequence, "TriggerSequence6"); // Bulk mode
// 3. Select a trigger source of random trigger shutter by 'TriggerSource'.
Nd_SetEnumStrValue(s_hCam, hSource, "Software");
// Software
// 4.Select a trigger activation of hardware trigger by 'LineInverterAll'.
// -- not applicable for Software Trigger
// 5.Set the number of frames to exposure in Bulk mode by
'TriggerAdditionalParameter'.
Nd_SetIntValue(s_hCam, hAdditionalParameter, 3);
// 3 frames
// 6.Set a trigger delay by 'TriggerDelay'.
Nd_SetFloatValue(s_hCam, hDelay, 1000.0);
// 1ms
// 7.Open and Start image stream.
// 7.1.Open Stream
s_hStrmEvt = CreateEvent(NULL, FALSE, FALSE, NULL);
Strm_OpenSimple(s_hCam, &s_hStrm, &s_uiImgBufSize, s_hStrmEvt);
s_pucImgBuf = (uint8_t *)VirtualAlloc(NULL, s_uiImgBufSize, MEM_RESERVE
| MEM_COMMIT, PAGE_EXECUTE_READWRITE);
// 7.2.Stream Start
Strm_Start(s_hStrm);
// 8.Execute software trigger in SoftwareTrigger mode by 'TriggerSoftware'.
Nd_CmdExecute(s_hCam,hTriggerSoftware);
// 9.Receive Image
uint32_t uiSize = s_uiImgBufSize;
CAM_IMAGE_INFO sImageInfo;
for(int i=0; i<3; i++)
{
WaitForSingleObject(s_hStrmEvt, 1000);
Strm_ReadCurrentImage(s_hStrm, s_pucImgBuf, &uiSize, &sImageInfo);
}
// 10.Stop and Close image stream.
// 10.1.Stream Stop
Strm_Stop(s_hStrm);
// 10.2.Close Stream
Strm_Close(s_hStrm);
CloseHandle(s_hStrmEvt);
VirtualFree(s_pucImgBuf, 0, MEM_RELEASE);