Gage Applied for all your needs of Digitizers  
Access Gage Support

print this

email this

Need a Solution?
GaGe application engineers can provide the answer




 

Frequently Asked Questions


General Questions

Questions Related to Specific Gage Products

Can't Find an Answer?


General Questions

Q. I am using GageScope in a remote location. In the event of a power failure I want GageScope to restart, get past the first prompt, load a setup file and start executing in the Autosave mode-but the previously created Autosave files must not be overwritten by GageScope when it restarts. How can this be accomplished?

A. While GageScope was not originally designed to allow this type of operation, there is a "backdoor" approach that will let us perform the required tasks. Batch files and a few simple utilities solve the problem of moving the previous data files to a safe location.

First, let's get GageScope to accept "keyboard" data from a file. DOS allows the redirection of the standard input (keyboard) and standard output (the text screen). We can use this facility to force a predetermined character stream (keyboard characters) to be read by GageScope's keyboard input routines. GageScope understands IBM PC ASCII character codes and keyboard extensions. The IBM PC generates an ASCII character if the key pressed is an ASCII character. A zero character (ASCII 00) is generated if the key pressed is a "special key" (function keys, cursor keys, etc.) followed by the scan code assigned to that key (50 Hex for the down arrow). The Table below shows six useful keys to help us with this application.

Name Code(s) Description
CR 0Dh ASCII "cr" character
ESC 1Bh ASCII "esc" character
UP 0048h Keyboard up arrow key
LEFT 004Bh Keyboard left arrow key
RIGHT 004Dh Keyboard right arrow key
DOWN 0050h Keyboard down arrow key


The next step is to run GageScope and record the keys pressed to perform the required task(s). In our example we must clear the user name message (CR), cancel current signal display (ESC), and place a number of escape codes to ensure that the display and start of program is okay (our example uses 24 escapes). Now open the menus and down arrow to the LOAD SETUP entry (CR, DOWN 4 times). Return allows a filename to be specified; enter the filename (START_UP in our example) and return (CR, START_UP, CR). Then we must start the automatic save acquisition: right arrow to the CAPTURE menu, down arrow to AUTO SAVE and return to start the acquisitions (RIGHT 2 times, DOWN 3 times, CR).

Once the proper sequence of keys is determined then a binary input file can be created. Our example file is called INPUT_AS.BIN. The simplest method to create this file is to use the MSDOS DEBUG utility. Only four commands are required. Start DEBUG by typing "DEBUG INPUT_AS.BIN". Next, dump the current data to the screen at the hyphen prompt by "d" (note that the data starts at some address followed by a ":0100"). Now we need to add the data using the edit command "E 100". Type the following for our example:

0D 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 0D 00 50 00 50 00 50 00 50 0D 53 54 41 52 54 5F 55 50 0D 00 4D 00 4D 00 50 00 50 00 50 0D

We also need to change the size of the file to be written. This value is contained in the CX register and can be modified by the "rcx" command and then enter 37 (37 hex equals the 55 decimal bytes entered). Lastly, write the file by the "w" command and quit with "q".

Preserving the previously saved data files requires a safe location which will be different every time the computer restarts. Let's assume that we want a sub-directory (OLD_DATA) of the GageScope (GAGESCOP) directory to contain the previous data. Two small utilities can be created to get and print the date or time to the text console (THE_DATE.EXE and THE_TIME.EXE, respectively). When the output is redirected to a file, a batch file can be built during the start-up sequence that will create a directory based on the date and a sub-directory based on the time. We then will end up with a directory structure similar to the following:

GAGESCOP
OLD_DATA
96_11_28
09_06_30
13_23_22
14_39_20
23_11_08
96_11_29
01_07_00
06_48_16

We need some method of entering the proper commands for the batch file. Several small text files were created that allow for making and changing directories and the base path to the old data directory. CD.TXT is "cd " (note the trailing space), MD.TXT is "md " (again note the trailing space) and OLD_DATA.TXT is "\GAGESCOP\

OLD_DATA\". The RESTART.BAT batch file creates the \GAGESCOPE\OLD_DATA directory (if it does not already exist), then creates the sub-directory of the current date (if it does not already exist), changes to this directory, and then creates a sub-directory from the current time and moves to it. All of the signal files in the GageScope directory are then moved to this sub-directory, and the directory is changed back to the GageScope directory where the GS.BAT file is called. The GS.BAT file calls GageScope with the standard input redirected from a binary input file INPUT_AS.BIN (GAGESCOP < INPUT_AS.BIN).

The contents of the AUTOEXEC.TXT file should be added to the AUTOEXEC.BAT file so that the RESTART.BAT file will be called from the GageScope directory during the boot sequence.

Once GageScope starts in this way the keyboard has no effect on the program, because of the very nature of the redirection of the standard input and output. Since the input file runs out of data, the program has no more input, and because the input was re-directed the keyboard is essentially disabled as long as GageScope is running. When control of the system is desired, the computer must be restarted and the boot sequence interrupted to stop the automatic restart sequence.

back

 

 KineticSystems | DynamicSignals © Gage Applied Technologies 2008 | Site Map