Jump to content

LabVIEW Watchdog Framework


Recommended Posts

Description

The Watchdog is composed of 3 main sections of code:

  1. Perpetrators: A perpetrator is something the watchdog knows to monitor or look out for. The most common perpetrator would be "elapsed time". We want the watchdog to notify us if a certain amount of time has elapsed. But...what if you wanted the watchdog to monitor many types of perpetrators? Disk usage? CPU usage? Temperature?  Hence the perpetrator class was born and is a circumstance that the watchdog watches out for.
  2. Barks: a bark is what happens when the watchdog spots a perpetrator. You might want the watchdog to send you an email, or a text message or write to file or... Hence the "bark" class was born. When the watchdog sees a perpetrator it barks.
  3. Watchdog: this is the asynchronous engine that monitors perpetrators and barks when it spots a condition.

Perpetrators and barks can be extended through inheritance so you can create your own circumstances to monitor and actions to take. The watchdog can monitor N perpetrators and preform M barks. 

API Example

Below we see an example usage of the watchdog written using the Sequencer Pattern

First, we create a perpetrator. In this case we want the watchdog to watch for time. If the watchdog is not petted within one second it will bark. Note you can build an array of Perpetrators.

2019-05-18_16h17_57.png.dea5164d08757d7bded4f14e3ff534fc.png

 

WatchDog Bark Configuration. Here we see three barks being configured. The first bark is a dialog box that will appear with the text "My Popup". The second is to send an email. The third is to send a text message.

2019-05-18_16h13_08.png.8b439feb37e98b8553d886091222aaa0.png

Last we "set the watcdog loose" to start monitoring our perpetrator. Here you can see we start the watchdog and tell it to monitor perpetrators and preform bark actions. In a for loop we pet the watchdog. Petting the watchdog reset equal to true resets the condition the watchdog was monitoring. So that if it noticed a perpetrator, it will start monitoring again. Because the watchdog is set to monitor a timeout not to exceed one second, it will bark twice. Unless the watchdog is petted again, it will always report that the timeout has occurred each time pet is executed.

2019-05-18_16h19_57.png.6f42432d0aad857b8060a5ce0a854ba3.png

 

UML

All UML and API documentation are included in the Word document per released zip file

 

2019-05-18_16h54_27.png.75a0c1f6fd9b8d7cbb34c37e04a6fd7e.png

Software Requirements

LabVIEW 2017

Release Notes

1.0.0-11(Watchdog 1.0.0-11.zip)

  1. Fixed spelling errors and regenerated documentation.

1.0.0-9 (Watchdog 1.0.0-9.zip)

  1. Refactored locations of files on disk to be more structured
  2. Completed documentation
  3. Using timestamp for timeout perpetrator.
  4. Updated example with instructions

1.0.0-3 (Watchdog 1.0.0-3.zip)

  1. This is the initial release. Very very alpha

 

Edited by cjcilino
Link to comment

My apologies for not having much info on this page yet. I'm just trying to get the code in a presentable state and then I'll broadcast it's purpose and stuff....

 

And Cirrus Logic is not affiliated with NI. I'm not sure why my profile reads "NI"... hmmm.... I'll see if i can get that squared away.

Link to comment
On 4/3/2019 at 12:03 PM, cjcilino said:

I'm also

You're also what?!

 

11 hours ago, cjcilino said:

And Cirrus Logic is not affiliated with NI. I'm not sure why my profile reads "NI"... hmmm.... I'll see if i can get that squared away.

Make sure your lavag email is not @ni.com and then pm Michael. He can fixit.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.