Euresys Coaxlink Series Скачать руководство пользователя страница 27

27

6. The

onCicEvent

callback function receives a

const CicData &

. This structure is defined in

include/EGrabberTypes.h

. It contains a few pieces of information about the event that

occurred. Here, we display the

timestamp

and

numid

of each event. The

numid

indicates

which CIC event occurred.

7. Call

processEvent<CicData>(1000)

:

n

the grabber starts waiting for a CIC event;

n

if an event occurs within

1000

ms, the grabber executes the

onCicEvent

callback

function;

n

otherwise, a

timeout

exception will be thrown.

Example of program output:

timestamp: 1502091779 us, numid: 0x8041 (Start of camera trigger)
timestamp: 1502091784 us, numid: 0x8048 (Received acknowledgement for previous CXP
trigger message)
timestamp: 1502091879 us, numid: 0x8043 (Start of light strobe)
timestamp: 1502092879 us, numid: 0x8044 (End of light strobe)
timestamp: 1502097279 us, numid: 0x8042 (End of camera trigger)
timestamp: 1502097284 us, numid: 0x8048 (Received acknowledgement for previous CXP
trigger message)
timestamp: 1502191783 us, numid: 0x8041 (Start of camera trigger)
timestamp: 1502191783 us, numid: 0x8045 (CIC is ready for next camera cycle)
timestamp: 1502191788 us, numid: 0x8048 (Received acknowledgement for previous CXP
trigger message)
timestamp: 1502191883 us, numid: 0x8043 (Start of light strobe)
timestamp: 1502192883 us, numid: 0x8044 (End of light strobe)
timestamp: 1502197283 us, numid: 0x8042 (End of camera trigger)
timestamp: 1502197288 us, numid: 0x8048 (Received acknowledgement for previous CXP
trigger message)
timestamp: 1502291788 us, numid: 0x8041 (Start of camera trigger)
timestamp: 1502291788 us, numid: 0x8045 (CIC is ready for next camera cycle)
...

5. Euresys::EGrabber

Coaxlink

Programmer Guide

Содержание Coaxlink Series

Страница 1: ...Coaxlink Coaxlink Driver Version 9 5 2 PROGRAMMER GUIDE EURESYS s a 2018 Document D204EN Programmer Guide Coaxlink 9 5 2 2015 built on 2018 03 28...

Страница 2: ...d in this book is not allowed without prior notice EURESYS s a may modify the product specification or change the information given in this documentation at any time at its discretion and without prio...

Страница 3: ...ant files 13 5 Euresys EGrabber 14 5 1 A first example 15 5 2 Acquiring images 16 5 3 Configuring the grabber 18 5 4 Events 20 Background 20 Counters 21 Notifications 21 Callback functions 22 Event id...

Страница 4: ...oc builtins js 37 6 3 doc grabbers js 38 6 4 doc module1 js 40 7 EGrabber for MultiCam users 42 8 NET assembly 49 8 1 A first example 49 8 2 Differences between C and NET EGrabber 50 8 3 Single thread...

Страница 5: ...f cameras and frame grabbers in a uniform and consistent way n GenTL is about data transport The TL suffix stands for Transport Layer The GenTL standard defines a set of C functions and data types for...

Страница 6: ...nApi implementation is a software module that can read and interpret register description files The EMVA provides a reference implementation but it is fairly difficult to use and logging is very poor...

Страница 7: ...don t have any associated value they have side effects Command features are meant to be executed When a command is executed some action happens in the camera e g a software trigger is generated Obvio...

Страница 8: ...he system defines relevant pieces of information info commands that can be queried using get info functions allows exercising that module s functionality using specific functions Additionally all modu...

Страница 9: ...eatures such as digital I O lines belong in the interface module This means that the GenApi features controlling the I O lines are attached to the interface Each interface also acts as parent to one o...

Страница 10: ...re retrieved through info commands see BUFFER_INFO_CMD_LIST in the standard GenTL header file The buffer module is the only module that doesn t have read write port functions it doesn t have GenApi fe...

Страница 11: ...he gcReadPort method and the TLOpenInterface function as the tlOpenInterface method n All GenTL functions return a GC_ERROR code indicating success or failure When a function returns a code other than...

Страница 12: ...display their id include iostream include EGrabber h 1 static const uint32_t CARD_IX 0 static const uint32_t DEVICE_IX 0 void showInfo Euresys EGenTL gentl 2 Euresys EGrabber grabber gentl CARD_IX DE...

Страница 13: ...ace is defined in the standard GenTL header file which has been automatically included by EGenTL h in step 1 4 Find out how many cards are present in the system 5 Retrieve the id of the n th card 6 Eu...

Страница 14: ...the most important of which is also named Euresys EGrabber namespace Euresys class EGrabber In this text we ll refer to this class as a grabber A grabber encapsulates a set of related GenTL modules n...

Страница 15: ...ry 7 showInfo catch const std exception e 7 std cout error e what std endl 1 Include EGrabber h which defines the Euresys EGrabber class and includes the other header files we need such as EGenTL h an...

Страница 16: ...EGrabber to acquire images from a camera connected to a Coaxlink card include iostream include EGrabber h void grab Euresys EGenTL gentl Euresys EGrabber grabber gentl 1 grabber reallocBuffers 3 2 gra...

Страница 17: ...amp the buffer was acquired other BUFFER_INFO definitions omitted BUFFER_INFO_CUSTOM_ID 1000 Starting value for GenTL Producer custom IDs typedef int32_t BUFFER_INFO_CMD Notice that getInfo is a templ...

Страница 18: ...grabber both have to be configured according to the application requirements n The camera configuration must be compatible with the frame grabber configuration and vice versa Configuration basically...

Страница 19: ...grabber gentl grabber runScript config js int main try configure catch const std exception e std cout error e what std endl and the configuration script is var grabber grabbers 0 var FPS 150 camera c...

Страница 20: ...ols n CoaXPress interface events events also coming from the interface related to the CoaXPress interface New buffer events are standard in GenTL They occur when a buffer is filled by the frame grabbe...

Страница 21: ...lector CameraTriggerRisingEdge grabber setInteger DeviceModule EventNotification true grabber setString DeviceModule EventSelector CameraTriggerFallingEdge grabber setInteger DeviceModule EventNotific...

Страница 22: ...public private callback function for new buffer events virtual void onNewBufferEvent const NewBufferData data callback function for data stream events virtual void onDataStreamEvent const DataStreamDa...

Страница 23: ..._NUMID_CIC_STROBE_FALLING_EDGE End of light strobe EVENT_CUSTOM_DATASTREAM EVENT_DATA_NUMID_DATASTREAM_START_OF_CAMERA_READOUT Start of camera readout EVENT_DATA_NUMID_DATASTREAM_END_OF_CAMERA_READOUT...

Страница 24: ...that the context in which callback functions are executed This is the subject of the next section 5 5 EGrabber flavors When should the callback functions be called From which context i e which thread...

Страница 25: ...so the need for synchronization is present as it is in the single thread model Of course the application must also be aware that it might receive notifications for events of type X that are older than...

Страница 26: ...data numid 6 getEventDescription data numid std endl int main try EGenTL gentl MyGrabber grabber gentl while true grabber processEvent CicData 1000 7 catch const std exception e std cout error e what...

Страница 27: ...8043 Start of light strobe timestamp 1502092879 us numid 0x8044 End of light strobe timestamp 1502097279 us numid 0x8042 End of camera trigger timestamp 1502097284 us numid 0x8048 Received acknowledge...

Страница 28: ...rabber grabber gentl while true 3 catch const std exception e std cout error e what std endl There are very few differences between this program and the CallbackOnDemand version 1 MyGrabber is derived...

Страница 29: ...td endl 1 In onNewBufferEvent create a temporary ScopedBuffer object buf The ScopedBuffer constructor takes two arguments n the grabber owning the buffer since we are in a class derived from EGrabber...

Страница 30: ...uffer timestamp 77186019809 us event timestamp 77186051614 us buffer timestamp 77186039810 us event timestamp 77186071611 us buffer timestamp 77186059811 us event timestamp 77186091602 us buffer times...

Страница 31: ...to coaxlink scripts dir doc basics js or more simply gentl script coaxlink doc basics js Euresys GenApi Script is case sensitive Statements are always separated by semicolons JavaScript is more permis...

Страница 32: ...ction Arrays Construction var empty var x 3 14159 2 71828 var mix 1 false abc Access to array elements var sum x 0 x 1 bracket notation Adding elements x 2 1 61803 x 3 14159 2 71828 1 61803 x 4 1 4142...

Страница 33: ...lity assertEqual true 1 2 2 assertEqual true 1 2 Equality and inequality JavaScript operators lead to confusing and inconsistent conversions of their operands They are not implemented in Euresys GenAp...

Страница 34: ...rtEqual inner x x function Nested assertEqual outer x x var y not accessible outside Nested x changed in Nested function NoBlockScope var x 1 assertEqual 1 x if true The scope of variables is the func...

Страница 35: ...of xs sum x assertEqual 1111 sum var obj one 1 two 2 var sum 0 for var x of obj sum x assertEqual 3 sum var str Coaxlink var sum for var c of str sum c assertEqual Coaxlink sum function ContinueAndBre...

Страница 36: ...exit before the end of the try block finallyDone true f fail assertEqual 1 x assertEqual fail caught assert finallyDone f return assertEqual 1 x assert caught assert finallyDone f assertEqual 2 x ass...

Страница 37: ...ber 0x16 Number 0x16 22 console log Number 1e 9 Number 1e 9 1e 9 console log String false String false false console log String true String true true console log String 3 14 String 3 14 3 14 console l...

Страница 38: ...scribes the grabbers object of Euresys GenApi Script It can be executed by running gentl script coaxlink doc grabbers js The builtin object grabbers is a list of objects giving access to the available...

Страница 39: ...ated by pIsAvailable GenICam node elements if grabbers length var port grabbers 0 InterfacePort console log Playing with port tag get f console log InterfaceID port get InterfaceID set f v port set Li...

Страница 40: ...ort if port console log Playing with port tag var brStandard 0x00000000 var brRevision 0x00000004 var standard port brRead brStandard var revision port brRead brRevision if 0xc0a79ae5 standard console...

Страница 41: ...log Hello from module filename console log module exports contains for var e in module exports console log e typeof module exports e console log Completed execution of module filename 6 Euresys GenAp...

Страница 42: ...ommands CAM file Euresys GenApi script CallbackOnDemand Callback functions CallbackSingleThread CallbackMultiThread Initialization MultiCam MCSTATUS status McOpenDriver NULL if status MC_OK EGrabber E...

Страница 43: ...tus void mem malloc BUFFER_SIZE if mem status McCreate MC_DEFAULT_SURFACE_HANDLE surface if status MC_OK status McSetParamInt surface MC_SurfaceSize BUFFER_SIZE if status MC_OK status McSetParamPtr su...

Страница 44: ...nScript script McSetParamInt H id value or McSetParamNmInt H name value grabber setInteger M name value McSetParamFloat H id value or McSetParamNmFloat H name value grabber setFloat M name value McSet...

Страница 45: ...e MC_ChannelState_ACTIVE stop McSetParamInt channel MC_ChannelState MC_ChannelState_IDLE grab 10 images McSetParamInt channel MC_GrabCount 10 McSetParamInt channel MC_ChannelState MC_ChannelState_ACTI...

Страница 46: ...status McSetParamInt channel MC_SignalEnable MC_SIG_SURFACE_ PROCESSING MC_SignalEnable_ON if status MC_OK enable END_EXPOSURE events status McSetParamInt channel MC_SignalEnable MC_SIG_END_EXPOSURE M...

Страница 47: ...al void onNewBufferEvent const NewBufferData data ScopedBuffer buffer this data process buffer virtual void onCicEvent const CicData data handle Cic event Synchronous blocking event handling MultiCam...

Страница 48: ...ntl configure grabber enable Cic events enableEvent CicData void waitForEvent uint64_t timeout wait for an event processEvent CicData timeout private onCicEvent is called by processEvent when a Cic ev...

Страница 49: ...sys EGenTL gentl new Euresys EGenTL 1 using Euresys EGrabberCallbackOnDemand grabber new Euresys EGrabberCallbackOnDemand gentl CARD_IX DEVICE_ IX 2 String card grabber getStringInterfaceModule Interf...

Страница 50: ...he ID of the device This time we use getStringDeviceModule to target the device module 5 Finally read the camera resolution This time we use getIntegerRemoteModule because values must be read from the...

Страница 51: ...ent delegate grabber onDataStreamEvent delegate grabber onCicEvent delegate grabber onIoToolboxEvent delegate grabber onCxpInterfaceEvent delegate A complete example is given in the next section 8 3 S...

Страница 52: ...of the callback function simply display basic information about the event 4 This ends the definition of the onCicEvent callback function 5 Enable onCicEvent callbacks 6 Start the grabber and enter an...

Страница 53: ...on SFNC Standard Features Naming Convention Glossary Buffer module GenTL module that represents a memory buffer Buffers must be announced to the data stream that will fill them with image data Callbac...

Страница 54: ...le that contains the frame grabber settings relating to the camera Parent of the data stream module Sibling of the remote device GenApi The GenICam standard that deals with camera and frame grabber co...

Страница 55: ...implements tools such as rate converters delay lines etc Hosted in the interface module Register description XML file mapping low level hardware registers to camera or frame grabber features Remote d...

Отзывы: