Configuration of the camera
STINGRAY Technical Manual
V4.4.2
336
Examples: cycle time
The following three examples allow you:
•
A: to access cycle time either via UniAPI or via byte array
•
B: to extract cycle offset, cycles and seconds
•
C: to combine cycle offset/cycles/seconds to a valid time
Example Example code and description
A
nCycleTime can be accessed:
•
using the SIS structure S_SIS_DATA of the UniAPI:
nCycleTime = * (UINT32 *) &Sis[0];
•
using byte array: If you can access the image buffer as an array of bytes you can
assemble the first four bytes of the image buffer (assuming that the SIS is in the first
row):
nCycleTime = data[0] + (data[1]<<8) +
(data[2]<<16) + (data[3]<<24);
B
This Cycle time can be devided into its components:
nCtSeconds = ((nCycleTime & 0xFE000000) >> 25;
nCtCycles = ((nCycleTime & 0x01FFF000) >> 12;
nCtOffset = nCycleTime & 0x00000FFF;
C
These values can be combined
dTime = nCtS
nCtCycles / 8000 +
nCtOffset / 24576000;
Table 162: Examples: cycle time