Healy - AutoADCP for VMDAS

(provided by Dr. Charles Flagg) The purpose of the AutoADCP routine is to provide a method for unattended operation of shipboard ADCPs. The primary functions include the ability to change the ADCPs configuration based upon the ship’s location and to assure that data collection continues by means of a watchdog timer. An earlier version of the program was developed for RD Instruments’ DAS 2.48 to operate on ships of opportunity and was later adopted for use on several research vessels. With the development of a new generation of ADCPs and PC operating systems, a new version of AutoADCP was needed that was compatible with VM-DAS and Windows 95 through XP. Unlike the original AutoADCP system that made use of the user-exit capability of DAS 2.48, the new version is a standalone Visual Basic program that initiates and controls the operation of VM-DAS through keyboard emulation. The routine’s operation is governed by a control file, which defines the file and directory structure for both AutoADCP and VM-DAS. Included in the control file is a default options (*.ini) file used at the startup of the ADCP, a regions file described below, as well as a history file in which each action taken by the AutoADCP routine is logged. An important component of the system identified in the control file is the regions file which establishes a set of polygonal regions, each of which is associated with a VM-DAS option (*.ini) file. The regions are defined by a series of latitude/longitude coordinates for the vertices that describe each polygon. The polygons are of arbitrary complexity, and sub-regions within other regions are allowed. The vertices are listed in order proceeding around the perimeter of the region in either direction. At intervals during operation, the AutoADCP routine determines the ship’s position by reading the last GGA entry in the most recent *.N1R file. This position is then compared with the regions in the region-file, in the order in which they are listed, stopping at the first instance when the ship’s position falls within one of the regions. By arranging the order in which the regions are listed, with small sub-regions listed first, it is possible to control the operation of the ADCP in a complex geographic area. Aside from controlling the operation of the ADCP through the different option files, the AutoADCP routine periodically checks that the data collection process is continuing by checking the size of the *.ENR file of the highest numbered data collection session. If the *.ENR file has not changed in size since the last time it was queried, it is assumed that the data collection has stopped prematurely. It is possible that someone stopped the data collection from the keyboard inadvertently, or there was some other fault that caused the program to hang. Regardless of whether or not VM-DAS is still running, the task manager is used to stop VM-DAS after which VM-DAS is restarted and data collection re-initiated. This ability to monitor the continued operation of a program is referred to as a software watchdog timer and it relies on the continuing operation of the operating system, the network and the AutoADCP program. Thus, the watchdog will not protect against a system crash, although it should protect the data collection process during most other conditions. The steps in setting up the AutoADCP system include the following:

  • Create an AutoADCP subdirectory under C:\Program Files and copy into it the AutoADCP executable, Visual Basic source code, and example control and regions files
  • Make a shortcut on the desktop for the AutoADCP executable. Change the icon to the one in the AutoADCP subdirectory.
  • Generate or edit an AutoADCP control file so that it points to the correct files for the current application and computer. Included in the control file are: paths to AutoADCP.exe and VM-DAS.exe (not the shortcuts), the path to the options (*.ini) files, the default options filename, the path and name of the history file, and the path and name of a favorite ASCII editor.
  • Define a set of regions. These are usually based upon water depth and areas where bottom track would or would not be used. Include port areas where you’d like the ADCP to be on so that it can continue to acquire navigation data but where data collection will be minimized. Each region should be associated with its own options (*.ini) file.
  • Set up a series of option files for each of the regions. This can be done either using the option editing feature of VM-DAS or by directly editing the *.ini files using an ASCII editor.
  • Carefully go through each options file to ensure that it has the correct configuration for the associated region and that all the paths and/or filenames are correct for the PC controlling the ADCP. There are a lot of details in these files so go through them thoroughly.
  • Check the *.txt file or files that will be pointed to by the options files. Refer to the BroadBand or Ocean Surveyor manuals for the meaning and optimal settings for the commands.

Once the AutoADCP system has been set up, double click on the desktop icon to start the program. When AutoADCP is running, you will see that there are several options in the menu across the top that will load the control file and start and stop VM-DAS and the data collection. See the example AutoADCP screen in Figure 1. Below the menu are a series of text boxes that show which files are controlling the data collection and where the ADCP data is being stored. Below those boxes is displayed the history of activity during the current and all the past sessions contained in the history file. To the right of the history box are several buttons that use the ASCII editor that you have specified in the AutoADCP control file to display the region, option (*.ini) and *.txt files. Viewing and editing of these files can be done while data are being collected, but configuration changes will only take effect when and if the VM-DAS reloads those files. There is also a button which allows you to add comments to the history file which you might do, for instance, if you have made temporary changes to test the performance of various ADCP settings. The last set of boxes in the lower right-hand corner show the UTC time and the ship’s GPS position obtained from the *.N1R file the last time that it was queried. The actual operation of AutoADCP is controlled by the menu across the top of the window. First load the AutoADCP control file. This will bring up a dialog box to designate the proper control file. After the control file is loaded, the region file text box will show the region file specified in the control file and the history text box will display past history, and that AutoADCP has started. The next menu item starts VM-DAS. The VM-DAS window should open with a blank screen. The next menu item causes VM-DAS to load the default option file specified in the control file. If for some reason VM-DAS does not correctly open the option file, close VM-DAS using the close VM-DAS menu button, re-open VM-DAS and load the option file. At this point, the option and *.txt files should be displayed in the text boxes. Start Data Collection begins the data collection process, and the output file preface will be displayed in the data files text box. The GPS time and ship’s position boxes will remain blank until the navigation file is queried for the ship’s position. When the ship crosses from one region to another, AutoADCP will stop the data collection, load the appropriate option file specified in the region file and restart data collection using the new configuration. The change in regions will be noted in the history file. If for some reason the data collection stalls, the watchdog timer will discover this after a reasonable interval and attempt to restart the data collection. This also will be noted in the history file. When data collection is complete or if you want to use VM-DAS to edit a configuration, stop the data collection first using the AutoADCP menu, otherwise AutoADCP may notice that data collection has stopped and will restart data collection. When data collection is done, stop the data collection, close VM-DAS, and quit AutoADCP using the menu buttons. If you find any bugs in the program or have suggestions for its improvement, please contact Charles Flagg, (631) 344-3128, flagg@bnl.gov