Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Does the Watchdog write to flash?

  • Please log in to reply
8 replies to this topic

#1 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 18 May 2011 - 08:55 AM

This conversation was moved from the website comments section:

Submitted by Stuart (not verified) on Mon, 2011-05-16 02:14.


My question is: does setting the watchdog on or off write to the flash.
If so does it count towards the ~20,000 write limits to the flash
before it is damaged?

I have several U3's. I am using the watchdog for safety when I have a laser on. If the software crashes or the usb cable is uplugged the watchdog will kick in and set the default outputs which will turn the laser off.

Every time I turn the laser on I enable the watchdog and every time I turn the laser off I disable the watchdog.

I use the commands




Submitted by LabJack Support on Mon, 2011-05-16 09:59.

Changing the watchdog's settings does write to flash and does count toward the 20k limit. And the settings are loaded each time the device resets or powers up. It seems OK to me to leave the watchdog on all the time. That will leave the fail safe on except when you program is up and running. You program will need to expect IO lines to be in the safe states and change them as necessary.

Submitted by Anonymous (not verified) on Mon, 2011-05-16 11:04.

So if I leave the watchdog on all the time (say at 30seconds) and then close the software the watchdog will keep kicking in every 30 seconds and I will see the LED next to the USB input flash once every 30seconds.

This is no problem for my hardware, but can I confirm that this continual resetting will not in any way damage the DAC card?

Also, can I ask, is there any way to programatically set the default outputs? If so, do you have an example LabVIEW vi?

Thanks for the fast response ;-)


Submitted by LabJack Support on Mon, 2011-05-16 11:23.

You are correct that the watchdog will trip every 30 seconds.The constant resetting should not be a problem for the labjack, though continual disconnecting and re-enumerating tends to cause problems for operating systems. Frequently the operating system will shut down a USB port if a device seems to be misbehaving. You can set the watchdog to just change an IO instead of resetting if you have problems with your computer side or if you prefer the LED didn't blink all the time.

Submitted by Stuart (not verified) on Mon, 2011-05-16 11:57.

I just downloaded the most recent LabVIEW code from your site. Firstly, a big improvement on the stuff I was using which is about a year old. Well done.

I think I need to use LJUD U3RAW Watchdog.vi but am a bit confused by the front panel of the vi.

Can the vi be configured to read or write? If so is WriteMask=0 for write and WriteMask = 1 for read?

To set the watchdog to reset the Digital I/O and not reset the device should I set WatchdogOptions = 4? (this would be integer 4 and not a bit) or should I set it to WatchdogOptions = 8 which is equivalent to b00001000. i.e. set bit 4?

Can I only choose one digital IO to set or can I choose multiple lines? If for example I want to set line 3 to high should I DIOConfig = 67? (i.e. b01000011)


Submitted by LabJack Support on Mon, 2011-05-16 12:20.

Any example that has the word RAW in its title is demonstrating the use of a low-level command. Low-level commands are the language that the LabJack device talks, and so can be complicated. If low-level commands are what you need then section 5 of the user's guide will explain their use: http://labjack.com/s...users-guide/5.2

Otherwise I would use the "Watchdog Simple.vi" example. This method allows our driver to worry about what bit goes where, so that you can use constants like the ones found in section 4.3: http://labjack.com/s...rs-guide/4.3.13

For the most part, low-level functions are only needed if you are porting to a new platform.

Submitted by Stuartb (not verified) on Tue, 2011-05-17 04:07.

One additional comment.

I can see the values being updated via LJControlPanel so I am writting correctly.

I have attached a screenshot to show this. (in this case i wrote timeout of 12 seconds)

So am I misunderstanding the functionality of Set DIO state on timeout? I expect that after 12 seconds timeout that LED1/RLY1 should go off but that the USB LED should not reset? But nothing happens.

Submitted by Stuartb (not verified) on Tue, 2011-05-17 03:04.

Sorry to be a pain, but this is still not working the way I expect it to. Can you help me understand how to set this up please.(we have at least 12 of your cards in products at the moment and are designed in to all of them. This is an important issue to me)

The simple watchdog command only configures the DAC card reset it does not allow simple setting of an output port to be reset.

I have tried to attach an image of my code where I have taken the information from 4.3.13 and updated the simple watchdog vi. I hope you can see the image. If not then essentially what I have done is to add some items to the arrays.(each array is now 5 items long)



VALUES: 0,1,8,0,5

(Before I run this I set output 8 to be high. I can see the LED1 light up and hear RLY1 switch)

What I expect to see happen is that after 5 seconds the LED will go off and I will hear the relay switch. This does not happen. Can you let me know what I am doing wrong?

If I change the VALUES to 1,1,8,0,5 then after 5 seconds the card resets and the USB LED flashes and LED 1 goes off and RLY1 switches. This is as I expect it, but I would rather have the output reset and not the whole DAC card.

Two supplementary questions:

1. Can I configure multiple outputs to change state on a reset?.

e.g. set EIO0, EIO1, EIO2 all to low.



VALUES: 0,1,8,0,9,0,10,0,5

2. Can I read if the watchdog is currently enabled?

If so I assume that reading this information from the flash does not count towards the 20,000 limit?



Submitted by LabJack Support on Tue, 2011-05-17 16:42.

It looks like your setup should work. Perhaps the IO line's direction isn't set properly. Use the Config Defaults section of control panel to set the IO that the watchdog will change to output.

With firmware 1.22 and later you can change up to two digital outputs when the watchdog expires.

The watchdog settings can be read. Though I'm not sure how to through the driver. I'll get someone else to post about that.

Submitted by Stuartb (not verified) on Wed, 2011-05-18 05:41.

I don't seem to be able to post images into comments. Hence I have put a word document here: https://www.yousendi...ndWNubHl4dnc9PQ

This shows that even using the LJControlPanel I cannot get the output to reset.

I have tried this with several DAC cards and I always get the same issue.

BTW: The channel selector for rest on timeout is not working correctly and is showing a different number that the one actually programmed. Also if you select one of the CIO channels it causes a fatal program error in LJControlPanel

Submitted by stuartb (not verified) on Wed, 2011-05-18 03:38.

I can see the config changing by opening LJControlPanel and checking what it reads. This proves that what I am setting is correct.

I have also set the defaults to define all relevant pins as outputs.

It is still not working. (i.e. not changing the state of the defined pin after the watchdog timeout period) Any ideas?

I have managed to read most of the watchdog settings using LJ_ioGET_CONFIG along with:


This is very useful, but the most useful one is still missing which is LJ_chSWDT_ENABLE. Do you know if I can read this value?

I couldn't see a way to post code onto you site so I have put is here https://www.yousendi...rdkdwM2xFQlE9PQ . This shows how I read and write the watchdog settings and also how I set the channel as an output. Please have a look and let me know if I am doing something wrong


#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 18 May 2011 - 09:10 AM

I moved this conversation to the forum because debugging/troubleshooting doesn't add much to the website. I'll post a summary in the website comments once we find the source of your troubles. I just tested using FIO5 and firmware 1.36. The IO responded properly. The watchdog timer can only set the state of IO pins, not the direction, so the pin must be set to output before the watchdog expires. The easy way to do this is to use LJControlPanel to set the the IO to output in the startup defaults (Config Defaults panel). Be sure to restart that U3 after changing the settings so that the new defaults are applied. What firmware and driver versions are you using?

#3 stubon

  • Members
  • 19 posts

Posted 19 May 2011 - 03:17 AM


This details that I am using:

Firmware: 1.32
bootloader: 0.27
hardware: 1.30
driver: 3.25 (labjackud.dll)

You mention using firmware 1.36. This is odd because I am using a board that I bought last week and downloaded all the most recent versions of the firmware and software from your website yesterday. Both LJSelfUpgrade and LJControl panel tell me that the firmware is up to date.

I noticed this post here: https://forums.labja...?showtopic=5200 and it seems that they had a similar problem back in January and you pointed them towards a beta release of the firmware 1.36.

So I have upgraded the firmware to beta 1.36 and everything works! Excellent.

But, I am not really comfortable using beta release drivers as the systems we have out at customers are strictly controlled under Pharmaceutical CFR and it won't be easy to get them to agree to upgrade to a beta release.
When do you plan to release this fully?

Also, I have attached my code that reads (and writes) the Watchdog settings. It can read all the settings apart from whether or not the watchdog it enabled. Have you had any luck finding out what command I need to send to return this value?

You mentioned in #9 that in firmware versions 1.22 and later it is possible to set two outputs. I have not figured out how to do this. Can you help?

I did find a post about two outputs for U9 devices (I have a U3) http://labjack.com/s...rs-guide/4.3.13
In this I noticed outputs A and B. I tried to send the same commands to my U3 that work for output A as output B instead but got an error.

Also, on customer PC's I have installed the drivers only (basic bare bones installer). Is there any way I can easily ask them to upgrade the firmware without asking them to uninstall LabJackUD then install the full software LabJackUDSetup with LJSelfUpgrade? i.e. can I write a bit of code to perform this upgrade to firmware?


Attached Files

#4 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 19 May 2011 - 07:00 AM

Did 1.36 work for your application? We are just about ready for a new release, we might might be able to speed if you need it. The watchdog can be read through low level functions, but the driver currently doesn't support it. We are adding this functionality to the driver. I'll talk to the driver guys about the DIOB problem, they probably just don't have support for it.

#5 stubon

  • Members
  • 19 posts

Posted 19 May 2011 - 08:21 AM

Hi, Yes 3.16 worked for me (I put that in bold and underlined in my reply) Yes I would like an official release. I don't think my customers will accept a beta. I look forward to the update to be able to read the full DAC settings. Once it is implemented a LabVIEW example would be nice. (see the attached code to see how far I got with it) DIOB would be useful. For example in my application when I have the laser on the door is locked. If comms is lost then the Laser is turned off, but the door is still locked. If I could use DIOB then I could unlock the door too. Thanks for your help

#6 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 19 May 2011 - 12:16 PM

To answer the firmware upgrading side, there is the Python firmware upgrader which you could use with the barebones install: http://labjack.com/support/firmware. Note though that this options has Python related requirements involving additional software.

As for LJSelfUpgrade, it requires the UD driver and the LJUDDotNet driver. The LJUDDotNet driver is not included in the bare bones installer but with it you can run the LJSelfUpgrade executable. The only additional requirement is that you need the correct version of the LJSelfUgrader executable that was built for the specific version of the LJUDDotNet driver.

#7 stubon

  • Members
  • 19 posts

Posted 27 May 2011 - 04:13 AM

Hi, Do you have an idea when the 3.16 dll might be officially released? Also, is DIOB watchdog reset something that you are planning to implement for the U3? Thanks

#8 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 27 May 2011 - 02:30 PM

Do you have an idea when the 3.16 dll might be officially released?
Also, is DIOB watchdog reset something that you are planning to implement for the U3?


The next release will probably be 3.30 and include several changes. We are working on finishing up the 64-bit support and then hopefully releasing a version of this in the next week or two.

#9 stubon

  • Members
  • 19 posts

Posted 21 June 2011 - 04:14 AM

Hi Guys, Any update on the release of this driver? It has been a beta release for almost 6 months now. I really need a fully released version of this before I roll it out to my customers. Thanks Stuart

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users