02-05-2022 02:00 AM
Hi All,
Any one help me to understand C# dll event step and convert into LabVIEW. attached files (LV Source code, Supporting DLL) for your reference
C# code - Event step
-------------------
private static void Instance_InterfaceCollectionUpdate(IEnumerable<IHardwareInterface> added, IEnumerable<IHardwareInterface> removed)
{
.................
}
Advanced thank you
Regards,
Prashant Vernekar
Solved! Go to Solution.
02-07-2022 02:30 PM - edited 02-07-2022 02:34 PM
You don't call events - you provide a handler (eg. your callback VI or the C# method snippet you posted) and the thread that executes the event will call it when the event is fired.
You have created a callback for the event, but forgotten two things:
02-16-2022 01:05 AM - edited 02-16-2022 01:06 AM
Hi tyk007,
Greetings for the day.
Thank you for your replay.
but I'm getting some error like "System.ArgumentNullException: Key cannot be null.". attached error image for your reference.
Please help me, if i missing any configuration device manager before read device name.
Thanks,
Prashant Vernekar
02-16-2022 03:08 AM - edited 02-16-2022 03:09 AM
.Net IEnumerator's are always initialized to point to the record previous to the first one, aka invalid. Same is true if you call Reset() on an IEnumerator.
You need use a loop and call MoveNext() first before you can retrieve a Current() value.
02-16-2022 04:29 AM
Thank you rolfk
now its working fine
Thanks,
Prashant