Request Event File Information

Contents:


Introduction:

The document describes how to use the request event file feature of SDR. To use this feature, you will need to have two computer systems running and have them connected using Network (LAN) cards. See the document NETWIN95.TXT on how to setup SDR on a network.

The purpose of this feature is to allow a computer system to request event files from SDR. I use this feature in WinQuake 2.5 and above, and for the Request Data Web page at http://www.seismicnet.com/request.html.


How it Works:

SDR checks a shared directory on the main computer system running Windows, or some other operating system that allows drive mapping, every 10 seconds for a request file. The request file has information in the file that is used by SDR to create the event file. This file has the start time, number of minutes to save, save nth data point (time compression), channel name, and a file name to call the saved output event file.

It's up to you to write a program that takes the information from the user, this could be a CGI script connected to a Web page form etc, and create the request file in the shared directory that SDR is checking every 10 seconds.

If SDR finds a request file it parses out the information and tries to create the event file. SDR does an automatic Replay to create and save the event file data. The event file needs to be saved into another shared directory on the main computer system. There is no point in having the event file saved on the SDR system since there is no way for the main computer to have access to it.

After SDR reads the request file it deletes it. Your program needs to wait for the event file to show up in the other shared event file directory. DO NOT have SDR save the event files in the same directory as the request file. The request file shared directory should only be used for the request file. SDR has to check this directory every 10 seconds. If there are any other file in this directory it will take longer for SDR to search for request files. Your program should wait for about 30 to 45 seconds for the event file to show up. If after this time period there is no event file found there was an error over at the SDR end or there is a setup problem.

SDR versions older then version 2.4 would not report back an error. It just wouldn't produce an event file. Version 2.4 and above now reports back an error condition by using the output file and placing a small error message in it. The user should check the file size of the event file, and, if its under 200 bytes long then there was an error, and SDR placed an error message in the file instead of the actual PSN formatted event file data.


Setting Up SDR:

The only thing you need to do in SDR is set the Request Control File Path option under the F5 setting screen. Place the full path to the shared directory that will be used for the request file. Only input a directory and not a directory and file name.

Example: g:\sdr\request\


Request File Name and Format:

The name of the request file is: RQ??????.SYn where the ?????? can be any characters to make the file name unique, and n is the system number. The system number can be changed under the F5 settings, and is usually 1 if you only have one SDR system running. For the ?????? part of the name I use the hour, minute and seconds of the current time that the request file is created. The full file name and path used to create the request file should look something like this:

C:\SDR\REQUEST\RQ142308.SY1

If you have more than one SDR system, it is up to your program too know what system the channel is on. I use a simple file that my Request Web page CGI script reads to do the channel to system number mapping.

The content of the file is one single line of text with the request information in it. The fields are separated with spaces. The format of the line is:

MM DD YY HH MIN UTC/LocalChar SaveTime SaveNth# ChannelName_or_list OutputName

Where:

MM is the start time month (1 -> 12).

DD is he start time day (1 -> 31).

YY is the start time year (97 or 98 etc).

HH is the start time hour (00 -> 23).

MIN is the start time minute (00 -> 59).

UTC/LocalChar tells SDR if the start time is Local or UTC. This needs to be single uppercase U or L character.

SaveTime is the number of minutes to save.

SaveNth is used to control the sample rate of the event file. A 1 in this field will tell SDR to save every sample. A 2 in this field will save every other sample producing an event file 1/2 the size of an event file saved with a 1 for SaveNth. The sample rate of the event file will be 1/2 of the system sample rate. A 3 in this field will save every third sample (Note: SDR averages the data between saved samples).

ChannelName_or_list is the file name extension that is set by each Channel Setting screens. On my system the channel / file extension are called LC1 LC2 etc. More then one channel can be replayed per request file by placing more then one file name in this string. File names should be separated by a coma with out any spaces. Example: LC1,LC2 If more then one file name is present the OutputName field below is not used.  

OutputName is the full path and file name that SDR will use to create the event file or, with version 2.4 and above, it will hold an error message string if SDR encounters any problems. The path part of the name needs to point to a shared directory that the SDR system has access too. The file name part can be anything. I use the month, day, hour, minute and then the channel name for my CGI script. Example: g:\sdr\reqdata\02151238.LC1 Remember that SDR is running under DOS so the file name needs to be in the 8.3 DOS file name format. This field is not used if more then one ChannelName file name is present.

Example of the text command in a request file:

02 15 97 12 23 U 10 1 LC1 G:\SDR\REQFILE\02151223.LC1

This command will request a LC1 channel event file starting at 02/15/97 12:23 (Note that seconds are not used) UTC time. The file should be 10 minutes long and have no time (Save-Nth = 1) compression. The event file will be called G:\SDR\REQFILE\02151223.LC1. In this example the G: drive on the SDR system would be mapped to the C: (or some other local drive) on the requesting computer system.

Starting with version 2.5, SDR can now be forced into an alarm state by placing the the keyword "TRIGGER" (without the  "") in the first line of the request file. When SDR finds a request file with this keyword, SDR will create a set of event files, one per channel, in about 5 minutes.

If you need any help getting this working please feel free to contact me.


[ Top ] [ SDR Help ]

Larry Cochrane - www.seismicnet.com/contact.html