Sunteți pe pagina 1din 7

LNCmd Command Line File Manager

Introduction
LNCmd is a console, or command line program, used to work with files residing
on dataloggers that support file hosting. LNCmd works through the LoggerNet
server running on the same PC (localhost) to view the file directory of a specific
datalogger, send files to the datalogger, retrieve files from the datalogger, or
delete files on the datalogger. The primary use is to automate the retrieval of
files, such a camera images, from a datalogger. The other functions are primarily
used for setup and testing but could also be automated if needed. LNCmd can be
called from the LoggerNet Task Master or from other scheduling programs. Note
that LNCmd is not the most efficient means to collect datalogger data and is not
recommended for that purpose.
LNCmd Commands
List-Stations
List-Files
Send-File
Delete-File
Retrieve-File
(Note on syntax: Strings in angle brackets (< >) are required but the actual value
depends on name of the station, device or file. Strings in brackets ([ ]) are
optional. Otherwise, the string must be entered exactly as specified. LNCmd is
not case sensitive except that the devices, CPU or CRD, must be uppercase.)
Retrieve-File
The Retrieve-File command is used to retrieve a file, or a number of files from a
datalogger.
LNCmd will remember which files were on the datalogger the last time any files
were retrieved, and will only retrieve new files unless the force option is used.
This allows wildcards to be used for retrieving files while insuring that previously
retrieved files will not be retrieved multiple times.
The Retrieve-File command accepts the same wildcard characters that are used
by MSDOS.
An output filename can be specified when retrieving a single file. The output
filename cannot be specified if wildcards are used.
Retrieve-File Options

-NoDateCheck
File doesn't have to have a date and time later than a
previously downloaded file of the same name.
-Force
Get the file regardless of its date, whether previously
downloaded or not.
Syntax:
[options] Retrieve-File <station> <Device:Filename> <OutputFilename>

Example:
LNCmd retrieve-file cr1000 CPU:*.jpg

Results:
Connected to the LoggerNet server
Image29.jpg:2005-03-21 12:30:32 is not a new file.
Image28.jpg:2005-03-21 12:29:32 is not a new file.
Existing usu.jpg File deleted
Receiving usu.jpg from CR1000 Bytes Received: 8770

Example:
LNCmd -force retrieve-file cr1000 CPU:*.jpg

Results:
Connected to the LoggerNet server
Receiving Image29.jpg from CR1000 Bytes Received: 34832
Existing Image28.jpg File deleted
Receiving Image28.jpg from CR1000 Bytes Received: 34832
Existing usu.jpg File deleted
Receiving usu.jpg from CR1000 Bytes Received: 8770

Example:
LNCmd retrieve-file cr1000 image28.jpg c:\temp.jpg

Results:
Connected to the LoggerNet server
Receiving Image28.jpg from CR1000

Bytes Received: 34832

List-Stations
The List-Stations command will show the list of dataloggers in the LoggerNet
network. Not all of the dataloggers shown will necessarily support file operations.
Syntax:

LNCmd list-stations

Example (may need quotation marks if program files is two words):


LNCmd list-stations

Results:
Stations:
Connected to the LoggerNet server
CR9000_Bob
CR10XPB
CR1000
CR9000

List-Files
The List-Files command will attempt to connect to the datalogger and retrieve a
list of files residing on the device specified. In the example above we are listing
the files in the dataloggers main memory, so we specified the device name CPU.
In order to list the files on an external memory card we would specify CRD. If the
device name is omitted then CPU is used by default.
Syntax:
LNCmd List-Files <Station> [Device]

Example:
LNCmd list-files cr1000 CPU

Results:
Files:
Connected to the LoggerNet server
2005-04-22 07:59:44
0
Directry.Dir
2005-04-14 07:20:34
4271
TableDef.tdf
2005-03-24 09:22:54
2094
GEORGE2.CR1
2005-03-21 12:30:32
34832
Image29.jpg
2005-03-21 12:29:32
34832
Image28.jpg
2005-04-13 13:03:34
2273
B13738_1.CR1
2005-04-22 07:40:28
8650
usu.jpg

Send-File
The Send-File command will attempt to connect to the datalogger and send the
specified file to the specified device.
Syntax:

Send-File <Station> <Filename> [Device]

Example:
LNCmd send-file cr1000 usu.jpg CPU

Results:
Connected to the LoggerNet server
Sending to CR1000 Bytes Sent: 8650

Delete-File
The Delete-File command will erase the file on the datalogger in the specified
device. If no device is specified the default CPU device is assumed.
Syntax:
Delete-File <Station> [Device]:<Filename>

Example:
LNCmd delete-file cr1000 CPU:usu.jpg

Results:
Connected to the LoggerNet server
The transaction succeeded

Additional Options
/login username:password
-log
These two additional options must be used as the first command line parameter
when used.
Examples:
LNCmd /login operator:oppass Retrieve-File CR1000 *.jpg
LNCmd Log Retrieve-File CR1000 *.jpg

The login option is for use with LoggerNet Admin versions that have security
enabled.

The Log option will cause LNCmd to log progress information to a file named
lncmd.log in the current directory. Note that LNCmd appends to this file forever;
the user must manually remove or delete it.

Using LNCmd from the LoggerNet TaskMaster

LNCmd can be automated as a LoggerNet Task in the TaskMaster. This allows


files to be retrieved on a schedule, following datalogger data collection, or on
datalogger Call-back. See the TaskMaster for more information.
To use LNCmd from a task, enter (or browse to) LNCmd in the File Name box.
For example:
C:\Program Files\Campbellsci\LoggerNet\LNCmd.EXE
Enter the commands in the Command Line Options. For example to retrieve all
the camera images from a station name CR1000_2:
retrieve-file CR1000_2 *.jpg
Enter the directory where the images should be stored in the Start In box:
For example to store the image in the default LoggerNet directory:
C:\Campbellsci\LoggerNet
LNCmd can be used as task that runs after data collection with a station. If the
station is called using a dialed link (e.g. Phone Modem), it might be necessary to

increase the Delay Hangup setting for that station if the call is hung up after
collection but before the LNCmd task is started. This setting is found on the
Hardware tab in the Setup Screen in LoggerNet.

S-ar putea să vă placă și