LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Logging

Solved!
Go to solution

Hi all,

 

I was wondering if someone could point me in the right direction where I can read about and see examples of event logging.  I have written programs before that run well for a long time or until the end user has stopped the program, but sometimes the program will only last a short time and stop recording for example.  I would like to see what's going on.  I read a thread about Action Engines, but I am not sure how to apply that to my program (at least not yet).

 

Any infomation would be greatly appreciated 🙂

0 Kudos
Message 1 of 20
(8,562 Views)

Your best best to begin with is just to use "Highlight Execution" to see what's going on under the hood when things fail. If your application fails randomly over long periods of time, you should instead look into error handling. That little yellow and black wire you see on most VIs? You can use it to let your program fix itself, while it's running!

 

Here's a nice guide to error responses in LabVIEW that I use quite frequently: https://decibel.ni.com/content/servlet/JiveServlet/previewBody/42163-102-1-83306/LabVIEW%20Error%20R...

 

You can also just log things to a spreadsheet, or put indicators on your front panel showing various application health things.

Message 2 of 20
(8,559 Views)

Thank you for the suggestions.  I will certainly look into these!

0 Kudos
Message 3 of 20
(8,543 Views)

Regarding what you were saying about action engines, this is a common way I deal with error logging. In addition to adding logic to your program that decides what to do in case of an error (eg: ignore it and keep going, stop because it is critical, etc, basically this is what the document that ijustlovemath posted goes over), you also might want to log your errors so you can look at them later - that's where error logging comes in. What I often do is write an action engine that is in charge of my error logging, and it is basically just a VI that you call whenever you want to log errors that might be on the error wire (or you could even make it just log events in general, instead of only errors), so you wire in the error or a string about the event or whatever, maybe a priority level to be fancy, and then the VI takes the info and gets the date and time and formats that and appends it to a file that it is keeping on an uninitialized shift register (you will want to write the VI so it checks if it is the first time it is called and if so, creates a file and puts that on the shift register). Hopefully this makes sense. If not, I can explain more.

 

--Hope

0 Kudos
Message 4 of 20
(8,508 Views)

I developed an Event Logger back in LV 6i that has been enhanced over the years and after becoming our most re-used set of VIs is now used in almost every one of the applications I deliver.

 

It is a set of VIs that first launch a background thread that watches a queue and logs any updates to a text file with a time stamp.

 

The queue ref is stored in an AE (is anyone suprised by that by now?) that is wrapped in a re-entrant VI that has a Error In and an Error Out. If the error is set the call chain and the error cluster are qued up to be logged.

 

All of my peers love it.

 

It lets me go back in time to investigate what may have happened three months ago and determine exactly what error may have occured.

 

Ben

 

Spoiler
If you would like to purchase the Event Logging Suite we use, PM me and I will get you connected to a boss who will be happy to sell it to you.
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 20
(8,489 Views)

Thanks Hope,

 

I read some more about Action Engines and I tried making my own event logger for errors.  It is a simple one (I think).  I attached it as well as the main VI for my program.  Do you think this is something I should use for my application?  Or am I way off?

Download All
0 Kudos
Message 6 of 20
(8,477 Views)

I should probably give you some more information about my program, sorry about that.

 

I am programming a scanning multimeter where the end user can select the number of channels they need to use, name them, monitor and record them.  The program will check if the channel has reached some compliance and send a text message if it has (to be added).  It also has an update button which allows the user to add new channels, remove channels or rename channels.  The user can also enter how often the meter takes a measurement too.

0 Kudos
Message 7 of 20
(8,473 Views)
Hi Natalie,

I can't look at it now because I'm traveling and thus away from my computer for the weekend. (I'm in Israel so the weekend starts on Friday 🙂 ). But I should be able to look at it when I get back Saturday night.

--Hope
0 Kudos
Message 8 of 20
(8,470 Views)

Thank you, enjoy your weekend 🙂

0 Kudos
Message 9 of 20
(8,437 Views)

Oh actually, I rewrote some of my code!  So far it is recording the state and errors.  I would still love some feedback though if you don't mind!  🙂

Download All
0 Kudos
Message 10 of 20
(8,436 Views)