05-05-2020 12:00 PM
Hi Group,
I'm working on CameraLink device with DALSA Framegrabber, and I'm trying to grab camera frames to LabVIEW for further processing. I tried to use "Reg Event Callback Functionality" with acquisition events like EndOfFrame.
Based on Sapera SDK [1] Examples all acquisition events works fine with .NET application and WindowsForms. However when I extract common functionality into DLL and run it from LabVIEW, I don't see any events handled, even inside DLL.
I've prepared basic test that works in C# (see sample) but it doesn't receive any event in LabVIEW. It should handle error event as I don't have a server no. 4. In Sapera logs I see that the error is logged in case of triggering error event, but all other logs are the same as when running in .NET.
Do you know what I can try to make it running, as Sapera support replied that they don't see any issues with my code from their side?
What can be different between running .NET application vs. LabVIEW that might impact this behaviour?
Kind regards
RP
Static VI (when running it is never called):
[1] https://www.teledynedalsa.com/en/products/imaging/vision-software/sapera-lt/
C# source:
static private void ErrorHandler(object sender, SapErrorEventArgs e) {
SapManager.DisplayMessage(e.Message); // throws stack overflow, but is triggered!
}
static void Main(){
SapManager.Error += ErrorHandler;
SapManager.DisplayStatusMode = SapManager.StatusMode.Event;
SapManager.GetServerName(4);
}
09-12-2020 12:33 PM
Hi rpietruc, I've got the exact same problem (Win 10, LV18 SP1 64-bit) using the Sapera SDK (.NET assembly DALSA.SaperaLT.SapClassBasic 8.41.0.1955). No error when registering SapAcqDeviceToBuf.XferNotify, after setting EventType to EndOfFrame for SapAcqDeviceToBuf.Pairs(0), but the callback VI never gets called when calling Snap() which does produce an image.
There is also no way, afaik, to implement SapProcessing, which you need for further live processing, since the base class does not have a constructor and a daughter needs to be derived. It would work no problem in C# but not in LabVIEW.
At least for live image rendering (SapView), I ended up launching an asynchronous VI which monitors the SapBufferWithTash's index and displays the n-1 image (invoke node SapView.Show()) every time it increments. That works.
For further processing, my plan is to do it post-processing after saving the images in the buffer. Not ideal for "live" processing/rendering.
09-14-2020 03:45 AM
You're registering an event to a .NET constant.
You'll have to create the class using a .NET constructor.
If you put a probe on the .NET wire, you'll notice it is 0x00000000.
The flat sequence structure is redundant and distracting...
09-26-2020 11:28 AM
Thanks @wiebe@CARYA for reply, unfortunately I can't call SapManager constructor because the library doesn't implement any public constructor. There are classes that derives from SapManager, however the SapManager events (e.g. SapManager.Error) are not visible from derived classes, like SapAcquisition.
09-26-2020 11:30 AM - edited 09-26-2020 11:53 AM
--
09-26-2020 11:52 AM
Thank you Frenmerican for code snippets, I've ended up with C wrapper library using PostLVUserEvent function, however your code is worth checking as it doesn't require extra coding in C.
05-16-2022 05:10 PM
Hello Frenmerican,
even though your answer is a few years old now, did you find a way to process the data on Labview or copy it into an array with the Sapera SDK?
Best regards
05-02-2024 03:06 AM
Hi,
i'm facing a similar problem : I want to acquire the data from an axcis camera with the grabber. Has anyone develop something that might help me?
Any support would be appreciated!
Have a nice day.
05-16-2024 09:02 AM
Anyone evolved in this? I am also having this problem and don´t have any good solution so far...