Temprecord Command-Line Parameters

Contents  Previous  Next

Introduction > Command-Line Parameters

When starting Temprecord from the command line (from a “DOS Prompt”, there are numerous command-line options that can be used.  Some of these enable you to perform repetitive tasks from a batch file and are useful when setting up or reading a large number of loggers.

 

Temprecord already implements the ability to specify TRX files to load on the command-line.  These existing command-line parameters are unaffected.

 

All settings (such as COM port, parameter defaults, export settings, etc) that are currently in use are also used for any operations specified through command-line options.

 

As an example of the use of the added command-line options, entering the command:

 

trw  /stop /read /save fred /reuse /start /exit

 

will stop the logger, read the data, save it as a file FRED.TR, reuse the logger, start the logger again, and TRW will then exit.  If any errors occur, all processing of commands stops and a message describing the problem is displayed.

 

The command:

 

trw /read

 

will start TRW, read the logger data, and remain open with the logged data displayed.

 

These command-line parameters are useful for performing  a series of operations on one logger.  If you have a batch of loggers to read and reconfigure, auto mode operation is probably preferable.

 

Using the Command-Line Options

Commands can be carried out by any of the following methods:

 

From a DOS Command Prompt:

Click on Start

Click on Programs

Click on MS-DOS Prompt

At the C:> prompt, type the Temprecord command, i.e. “trw”, followed by a space, followed by the command-line options, followed by the “Enter” key.

 

From a Batch File:

Click on Start

Click On Programs

Click on Accessories

Click on NotePad

In NotePad, enter the commands you wish to execute, one per line.

Click on Save, and enter the folder and name of the file.  Be sure to give it an extension .BAT, e.g. “doit.bat”.

 

To execute the batch file, type its name at a DOS command prompt, or create a shortcut to it.

 

From A Shortcut:

Open the folder you want to create the shortcut in, unless you want the shortcut to be on your desktop.

Right-click in the folder (or on the desktop).

Click on “New”

Click on “Shortcut”

Enter the TRW command-line, including the path, e.g.:
  "C:\Program Files\Temprecord\TRW\trw.exe" /read

Don’t forget to add the “.EXE” to the TRW program name.

Click on Next

Enter a name for the shortcut.

Click on Finish.

 

To use the shortcut, double click it.

 

  WARNING     The TRW program contains many prompts and safeguards when dealing with Temprecord data.  As an example, TRW will prompt you before reusing a logger if it believes you have not yet read and saved the data, as reusing a logger makes any data in it inaccessible.  These prompts are NOT issued when using the command-line functions of TRW.  It is the user’s responsibility to make sure that data has been saved before reusing a logger with the /REUSE command line option.

 

Command-Line Reference

The command-line options are described in the order you would normally carry out the commands if you were using them from TRW. Note however that the command-line options can be specified in any order on the command line.  

 

The order of execution of the commands is NOT necessarily the order in which you specify them, but is instead the order that would make the most sense.  As an example, if you specify the command:

 

trw /export /read

 

the logger would be read first, then the data would be exported.

 

Some combinations of command-line options are not sensible and in this case an error message will be displayed and no commands will be executed.

 

Command

/STOP

Example

trw /stop

Function

Stops the logger.  If the logger is not in the logging state an error message is issued.  If the logger is already stopped, no error is issued.  

 

Command

/OPEN <filename>

Example

trw /open fred

Function

Opens a Temprecord data file from disk.  An error is raised if no filename is specified, if the file is not found or if it is not a valid Temprecord data file.  If no filetype is specified, .TRX is assumed.  If  the filename contains spaces, you need to  enclose it in double quotes, e.g. trw /open "data from fred.tr".

 

Command

/READ

Example

trw /read

Function

Reads the data from the logger.  The logger must be present, and either logging or stopped or an error results.

 

Command

/SAVE [<filename>]

Example

trw /read /save

trw /read /save fred

Function

Saves the loaded Temprecord data to a disk file as a Temprecord data file.  An error results if there is no data loaded, i.e. a /READ or /OPEN command line option must also be specified.  If no filename is specified and the loaded data is from a file, an error is issued.  If no filename is specified and the loaded data is from a logger, a filename is constructed from the logger serial number.  If a filename is specified and no filetype, .TRX is assumed.  

 

NOTE: If the file already exists it is overwritten.  You will not be prompted before overwriting, even if that option is checked in TRW.

 

If  the filename contains spaces, you need to  enclose it in double quotes, e.g. trw /read /save "data from fred.tr".  

 

Command

/EXPORT [<filename>]

Example

trw /read /export

trw /read /export fred

Function

Saves the loaded Temprecord data to a disk file as an ASCII file (i.e. performs the same function as the ‘Export’ function from within TRW).  An error results if there is no data loaded, i.e. a /READ or / OPEN command line option must also be specified.  If no filename is specified and the loaded data is from a file, the name of the export file is the name of the loaded TRX file, but with filetype as specified in the Options/Export settings of TRW.  If no filename is specified and the loaded data is from a logger, a filename is constructed from the logger serial number, and the  filetype is as specified in the Options/Export settings of TRW.  If a filename and filetype is specified, it is used as the exported filename.  If no filetype is specified but no filetype, the filetype as specified in the Options/Export settings of TRW is used.  

 

When exporting data with this option, the export settings as specified in the Options/Export settings of TRW apply.

 

NOTE: If the file already exists it is overwritten.  You will not be prompted before overwriting, even if that option is checked in TRW.

 

If  the filename contains spaces, you need to  enclose it in double quotes, e.g. trw /read /export "data from fred.txt".

 

Command

/REUSE

Example

trw /reuse

Function

Reuses the logger.  If the logger is not present, not a multiple use type, or it is not in the stopped state, an error message is issued.  If the logger is protected with a password and no password is supplied with the /PASSWORD option, or the password supplied is incorrect, an error results.  When the logger is reused, all parameters are left unchanged.  If you require different parameters to be used, specify them using the Options/Defaults settings in TRW and use the /DEFAULTS command-line option also.

 

NOTE:  No warning is issued if the data in the logger has not been read and/or saved.  This option should not be used unless the data from the logger has been successfully read and saved, either by previous operations, or on the same command line.  

 

Command

/PASSWORD

Example

trw /reuse /password 1234

Function

Supplies a password to be used when reusing the logger or setting the logger parameters to the defaults.  This option is required when the logger is protected by a password and the /REUSE or /DEFAULTS command-line options are used.

 

Command

/START

Example

trw /start

Function

Starts the logger.  If no logger is present, or if the logger is not in the READY state, an error results.

 

Command

/AUTO

Example

trw /auto

Function

Starts Auto Mode when TRW starts.  This option would normally be used on it's own, or only with the /KIOSK option below.

 

Command

/KIOSK

Example

trw /kiosk

Function

Starts TRW in "Kiosk mode", with a reduced set of functions and capabilities.

 

Command

/EXIT

Example

trw /open fred /export /exit

Function

Exits TRW when all command have been successfully carried out.  If any command resulted in a error, a message will be displayed, and TRW will exit after this message has been cleared.

 

Examples

Some examples of common functions follow:

 

Example

trw /stop

Function

Stops the logger and leaves TRW running.

 

Example

trw /stop /save /reuse /exit

Function

Stops the logger, saves the data to a filename based on the logger serial number (overwriting any file of the same name), reuses the logger, and then exits TRW.

 

Example

trw /open sample1 /export /exit

Function

Reads the file SAMPLE1.TRX from disk, exports it as SAMPLE1.PRN (or whatever the current export filetype is set to) and then exits TRW.

 

Example

trw /stop /read /save sample2 /export sample2 /exit

Function

Stops the logger, reads it, saves the data to SAMPLE2.TR, exports it to SAMPLE2.PRN (or whatever the current export filetype is set to) and then exits TRW.  Note that in this example if no filetype is specified after the /EXPORT option, the export filename will be based on the logger serial number, even though a filename was supplied with the /SAVE option.

 

If you enter the above command line into a batch file, and replace the filename with “%1”, i.e. create a file called exportit.bat with the following line in it:.

 

trw /stop /read /save %1 /export %1 /exit

 

you will be able to type the command:

 

exportit sample2

 

to carry out the commands.

 


(C) 1992-2019 Temprecord International Ltd
20/04/2014 5:53:36 PM
Temprecord Web Help