05-04-2021 11:02 AM
Hi, I am trying to read the details if an error is written to the windows event log within the application log.
I have a sample script in C# that I am trying to copy over to LabVIEW.
However, I am getting faults at attempting to do this.
I am looking to pull the date and time, event ID, Message, and Source to perform some comparisons on and log this data to a front panel. However, I am falling at the first hurdle.
Has anyone attempting to read from the Windows event log from LabVIEW before?
I've attached an image of the block diagram and also included the VIs - along with the C# code that I am attempting to replicate.
Thanks,
Scot07
Solved! Go to Solution.
05-04-2021 03:10 PM - edited 05-04-2021 03:32 PM
You haven't given a lot of details in terms of what is going on; but a few things stand out to me:
05-04-2021 04:29 PM - edited 05-04-2021 04:30 PM
One last thing I forgot to add at the end - make sure you close references (including the event callback refnum) when you are finished.
05-04-2021 05:28 PM
Thanks tyk007!
I have put together a VI to try and recreate what is in the link.
Couple more questions:
Thanks again,
Scot07
05-04-2021 06:16 PM
The bit where the callback keeps running is this:
You need to create and add a "GC.Collect" node that runs after your references are closed for it to stop by itself.