RD Controls<P> EPICURE Software Release Note 115.0<P> <b> EPICURE Example Data Logger</b>

RD Controls

EPICURE Software Release Note 115.0

EPICURE Example Data Logger

Deb Baddorf

Introduction

We have created a minimal data logger for EPICURE devices. This data acquisition example program functions as a simple data logger. The program will run from an individual's account, and log data for up to ten (10) devices to a file in the same area.

The code and some information is currently in:

WARNER::EPICURE_EXAMPLES:DATA_LOGGER*

What It Does

The data logger will read up to 10 device names from an input file, collect data at the times specified, and log scaled readings to a file. The output files are named with the date, in the form:

DATA_LOGGER_ mm_ dd_ hhmm.DAT
A startup command file is provided which will start the data logger as a detached process, and also submit a batch job to restart the logger each night at midnight. This is so you get a new output data file for each day.

The device names and frequencies will be written to the first line of this file. The time and scaled readbacks will be appended to the log file everytime the data request list completes. The format of the data written to the log file will be:

timestamp1 readback1 [timestamp2-if-different] readback2 etc.
where the timestamp displays the time the device was read by the front-end in the form HH:MM:SS. The timestamp for the first device reading will always be displayed. The other devices will display timestamps ONLY if they differ from the timestamp of the previous device. Any data acquisition errors will be written to the log file in place of a reading.

What You Do

Copy Files

First, create a subdirectory in which to run the data logger. SET DEFAULT to this subdirectory. Copy these files from WARNER::EPICURE_EXAMPLES:

into your directory. The remaining two files are not necessary to run the logger, but may be copied if you wish:

Edit Files

Edit the List of Devices

The code is ready to run as it stands. Edit file DATA_LOGGER_LIST.DAT and insert the device names and collection times desired. The two devices names currently in the file are for example purposes only, and may be removed. Up to ten devices may be specified. The data file should contain pairs of device names and frequencies. The frequency should be in the form

T Evt + Sec
where Evt is the event number and Sec is an offset from this event in seconds. For example, the following data list will read three devices at event T5 plus 2 seconds:
M00H T5+2.0

N00H T5+2.0

P00H T5+2.0

Edit the Start file

You should edit the DATA_LOGGER_START.COM file, and change the batch queue name to the correct format for your VAX. No change is necessary on any DISNEY node. [Please do not run the data logger on WARNER, which is reserved for code development.]

The DATA_LOGGER_START.COM file is set up to work correctly on any DISNEY node. If you are on some other VAX, edit the start file and change the batch queue naming scheme. As written, the command file will:

The name for the batch queue may be different on other VAXes. The command file currently decides the name of the VAX on which you are currently running (ex: mynode). The restart batch job is submitted to a batch queue named mynode_BATCH. If there is no such batch queue, the restart job will fail to be submitted, and your original logger process will continue to write to the same output file until you stop it.

To START the Logger

After editting files as described above, simply type:

$ @DATA_LOGGER_START
If you don't have a copy of the data logger running currently (which you won't, the first time), there will be a message which you can ignore:
%SYSTEM-W-NONEXPR, nonexistent process
There will be a message about the data logger process which has been started:
%RUN-S-PROC_ID, identification of created process is xxxxxxxx
There will be a message about the batch job submitted to run at midnight:
Job DATA_LOGGER_START (queue queue_name, entry nnn) holding until

tomorrow's_date_ 00:00

The same start command file is re-used at midnight each day to stop and restart the data logger with a new output file.

To STOP the Logger

To stop the data logger, you need to stop the current detached process, plus delete the job in the batch queue which will restart the logger at midnight.

Determine the name of the detached process: take your username (truncated, if necessary to 12 characters) and append ``_DLOGGER''. Truncate again, to 15 characters, and this is the process name. You can do SHOW SYSTEM to verify this name and find the ID number. FINGER/ALL your_username may be useful, but it won't show you the process name. Then stop the process using either the name or the ID number:

$ STOP process_name

$ STOP /ID= xxxxxxxx

Next, find the batch job which is waiting for midnight:

$ SHOW QUEUE * /BATCH
The name of the batch job will be DATA_LOGGER_START and the username will be yours. Locate the number listed in the ENTRY column of the display. Delete the batch job by typing:
$ DELETE/ENTRY= entry_number

Keywords: EPICURE, datalogger

Distribution:

normal

Security, Privacy, Legal

rwest@fsus04.fnal.gov