Does the Watchdog write to flash?
Posted 18 May 2011 - 08:55 AM
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
LJ_ioPUT_CONFIG, LJ_chSWDT_RESET_DEVICE,1 or 0
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)
IO TYPES: LJ_ioPUT_CONFIG,LJ_ioPUT_CONFIG,LJ_ioPUT_CONFIG,LJ_ioPUT_CONFIG,LJ_ioSWDT_CONFIG
(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.
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
Posted 18 May 2011 - 09:10 AM
Posted 19 May 2011 - 03:17 AM
This details that I am using:
driver: 3.25 (labjackud.dll)
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.
i.e. LJ_chSWDT_UDPATE_DIOB etc
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?
Posted 19 May 2011 - 07:00 AM
Posted 19 May 2011 - 08:21 AM
Posted 19 May 2011 - 12:16 PM
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.
Posted 27 May 2011 - 04:13 AM
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.
Posted 21 June 2011 - 04:14 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users