Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
261 views
in Technique[技术] by (71.8m points)

C++. Camera Link. How to grab images from framegrabber while setting camera parameters using serial LVDS communication

The camera link standard enables images to be grabbed from the framegrabber while also providing serial UART communication with the camera (which is connected to the framegrabber). So it should be possible to say change the camera's exposure time or the camera's gain setting while simultaneously grabbing images. However I am unable to do this. My framegrabber manufacturer has supplied 2 SDKs;

One for communicating with the framegrabber. This is based on the U3VLib library One for communicating with the camera. This is based on the clsers2i library

The problem is there is only one cable from the PC (usb) to the framegrabber and I can only connect to the port using either the U3VLib sdk OR the clsers2i sdk. But not both at the same time. If I try and do that I get a "port already in use" error eg.

void* serialPort = NULL;
result = clGetNumSerialPorts(&lPortCount);
if (result == 0)
{
   // initialize serial port
   result = clSerialInit(lPortCount - 1, &serialPort);
}

Now this works OK ie. I can initialize the serial port as long as I am NOT connected to the framegrabber using U3VLib.

I connect to the framegrabber using the U3V Library functions. So something like;

result = U3V_GetDeviceInfo((USHORT)1, &nDeviceInfo); // use 1st detected device
result = U3V_OpenDevice(nDeviceInfo.DeviceGUID, &pDeviceHandle, LogCallbackFunction, ....);
result = U3V_OpenControl(pDeviceHandle, &pControlHandle);

etc.

This works OK as long as Im not connected using clsers2i.lib.

SO I'm currently having to toggle between the 2 ie. disconnecting one and connecting to the other. This is time consuming and takes several seconds and does not provide a great user experience. Anyone out there with any experience of programming camera link communication using C++ (or similar). I just want to be able to communicate with the framegrabber and the camera simultaneously.

question from:https://stackoverflow.com/questions/65648404/c-camera-link-how-to-grab-images-from-framegrabber-while-setting-camera-para

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...