Topic: General - Advanced Techniques
Subject: Using DASYLab for a long term, un-attended monitoring application
There are numerous 24x7 applications where the computer and DASYLab need to run continuously, without major interruption. This article will list techniques to ensure that the applications run smoothly. This is a loose collection of techniques collected over the years, and should apply to DASYLab V10 and later.
Long duration applications on any Microsoft Windows-based PCs may have a wide variety of software and services installed. Some of these may affect your performance, because they are running, and others may have small bugs referred to as "memory-leaks". Over time, these things can affect the performance of the DASYLab application, and may even cause the program or the computer to crash and lose your data.
To avoid this, I've assembled a list of suggestions to consider. The most important is to secure your data, followed by ensuring that the computer continues to operate smoothly.
Generally, configure the computer to minimize interruptions from the operating system and other software. And plan for the worst case - that the computer may crash. You can configure DASYLab to minimize data loss, and even to restart when the computer restarts.
- Power management should be aggressively disabled for un-attended systems.
- If the monitor goes blank, will the users think that the computer is off?
- Or, do you want to allow the monitor to go to sleep, to save energy?
- Screen savers can consume resources; disable them.
- Use a UPS, universal power supply with battery backup, to minimize the effect of power glitches.
- Avoid running any other programs, including Virus protection software.
- Many software packages run on a schedule, and may consume resources
- Disable unneeded software.
- Review the list of programs that start automatically when the computer starts and disable as many as possible
- Disable Windows and other automatic updates
- Many Windows updates restart the computer automatically
- See below for hints on how to start DASYLab automatically if the computer should restart
- Look at other software that updates frequently, such as Java or Adobe, and disable the automatic updates
- Disable the automatic Daylight Savings Time feature
- Changing the time while a file is being logged to the hard drive may adversely affect the time stamp on the data.
- DASYLab WILL NOT pick up the time change while it is running. It must be stopped and restarted.
- If not needed, you may want to disable the network.
- Configure the computer with ample memory (RAM), so that it minimizes the impact of Virtual memory accessing the hard drive.
- Start with a clean computer and keep it clean:
- ensure that the computer's hard drive is large enough for the amount of data being stored.
- Start with a freshly checked and defragmented hard drive.
- Periodic hard drive maintenance should be done to optimize performance.
- Clean up unneeded files using the Windows Disk Cleanup tool
- Defragment the hard drive
- Periodically restart DASYLab or the computer
It may make sense to periodically restart the DASYLab V12 application, and possibly the computer, to ensure that the application will run without an unexpected termination. Restarting the DASYLab application will stop the acquisition and reset the data acquisition device, clearing internal buffers. Restarting the computer will do the same, and will also restart other software.
Early versions of DASYLab had a time limitation that they would not run for more than about 44 days continuously. A multimedia timer used by many modules and functions will “roll over”, and subsequent computations fail with a variety of unexpected errors. To work around this limitation, those versions of DASYLab must be periodically restarted -- weekly or monthly.
These techniques rely on the DASYLab program, the DAQ hardware, and the computer correctly restarting the application.
- Restart DASYLab periodically
- One way to ensure that the DASYLab program is running efficiently is to restart it on a defined schedule. DASYLab Full and Pro have the Action module with several useful Actions for program control.
- Action: Stop/Restart Flowchart: This will stop acquisition, clear internal buffers, reset timers, all very quickly. There may be a brief loss of data, but most long running applications are collecting slowly, and are not likely to lose data. "Append to File" or "Multi-File" should be used in the Write Data module to ensure that the data is stored reliably.
- Action: Exit/Restart Windows: This is the best way to ensure that DASYLab, Windows, and other programs all reset and clear memory.It takes longer because it's a full reboot, and the application needs to be configured to start up when Windows starts. (See below)
- Monitor the DASYLab application
The operator will need to make some provision for monitoring the application - either a Remote Desktop program, or a periodic e-mail that acts like a Watchdog.
- Use the Action module to monitor an EVENT -- you can use a Read Variable module to read the System Variable for Day, Week, Month:
- ${ACTUAL_DAY}: 0-31 represents the current day of the month
- ${ACTUAL_WEEKDAY}: 0-7 represents Sunday through Saturday
- ${ACTUAL_MONTH}: 1-12 represents the current month (January through December)
- The Event would be "Input Value Changed". Another Event might be Falling Edge, to monitor when the week changes from 7 to 0. You can also use a Trigger module to monitor the value, and the Event would then be Rising or Falling Edge, to match the trigger settings.
- When the event is detected, send an Email using the Email module
- If the email is not received, it is an indication that the computer may have a problem
- File management
Take advantage of some of the advanced features of the Write Data module, in combination with the Action module, to ensure that your data is secure.
Should the power fail, the computer crash, or DASYLab crash, data that has been stored using the Write Data module may be lost. There are several features that will minimize possible loss of data. If the operating shuts down and restarts before a file is "closed", Windows may not close it on the hard drive, and the file will be lost or be unusable.
- Use Multifile/Chain File name series or use "Append to File" to ensure that data files are not accidentally overwritten.
- Use the Multfile/Chain File name series with the Action module, creating a new file periodically, to secure data and to keep file sizes manageable.
- Configure the Write Data module to “Save data every” 1-10 blocks, so that the file is secure. This is a checkpoint feature, and forces Windows to close and reopen the file, flushing memory to the hard drive. The file will be usable even if the system crashes.
- Use "Combi" file names to incorporate user and system elements into the file name.
- Note that DASYLab does not automatically change a root file name except when the worksheet stops and restarts or when directed by the Action Module using the "Close and reopen File" Action for the Write Data module.
- See above for Events that you can easily monitor (new day, week or month, for example).
- Start DASYLab when Windows Starts
- Configure Windows to associate *.DSB and *.DSQ with DASYLab. When you double-click on a worksheet file DASYLab will open with that file loaded. (Note... if DASYLab is open, it will not open the new file).
- This is now the default for DASYLab V12, but not for DASYLab V11 and earlier.
- You can configure it in Windows using Folder Options-->File Types to associate *.DSB and *.DSQ with DASYLab.exe.
- Create a shortcut for the worksheet (DSB) or the Sequencer file (DSQ). Put it into the Windows startup folder. This will allow DASYLab to start up when the computer starts and the user is logged in.
- If a Windows login is required, download a Windows utility to automatically login. I found one such utility at the SysInternals section of Microsoft.com. There are other utilities on the internet - be cautious when choosing which to use.
- Ensure that your IT and computer security professionals are aware of your requirements to automatically restart the computer. Many companies have policies that require the user enter the login information.
- Configure DASYLab to AutoStart -- open the Measurement Menu and choose the AutoStart (toggle). This is not stored in the worksheet.
I hope that this collection of ideas has been useful.
The attached Code or Example is provided As Is. It hasnot been tested or validated as a product, for use in a deployed application orsystem, or for use in hazardous environments. You assume all risks foruse of the Code or Example.